diff --git a/.github/workflows/godot-ci-test.yml b/.github/workflows/godot-ci-test.yml new file mode 100644 index 000000000..a121bad7d --- /dev/null +++ b/.github/workflows/godot-ci-test.yml @@ -0,0 +1,113 @@ +name: "godot-ci-test" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + GODOT_VERSION: 3.2.1 + EXPORT_NAME: Pixelorama + +jobs: + export-windows: + name: Windows Export 🗔 + runs-on: ubuntu-latest + container: + image: docker://barichello/godot-ci:3.2.1 + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v1 + with: + submodules: true + - name: Setup 💻 + run: | + mkdir -v -p build/windows-64bit ~/.local/share/godot/templates + mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable + - name: Windows Build 🔧 + run: godot -v --export "Windows Desktop 64-bit" ./build/windows-64bit/$EXPORT_NAME.exe + - name: Clone Pixelorama Repository 📁 + run: | + git clone https://github.com/Orama-Interactive/Pixelorama.git + cp -R /__w/Pixelorama/Pixelorama/Pixelorama/pixelorama ./build/windows-64bit + - name: Upload Artifact 🚀 + uses: actions/upload-artifact@v1 + with: + name: Windows-64bit + path: ./build/windows-64bit/ + + export-linux: + name: Linux Export 🐧 + runs-on: ubuntu-latest + container: + image: docker://barichello/godot-ci:3.2.1 + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v1 + with: + submodules: true + - name: Setup 💻 + run: | + mkdir -v -p build/linux-64bit ~/.local/share/godot/templates + mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable + - name: Linux Build 🔧 + run: godot -v --export "Linux/X11 64-bit" ./build/linux-64bit/$EXPORT_NAME.x86_64 + - name: Clone Pixelorama Repository 📁 + run: | + git clone https://github.com/Orama-Interactive/Pixelorama.git + cp -R /__w/Pixelorama/Pixelorama/Pixelorama/pixelorama ./build/linux-64bit + - name: Upload Artifact 🚀 + uses: actions/upload-artifact@v1 + with: + name: Linux-64bit + path: ./build/linux-64bit/ + + export-mac: + name: Mac Export 🍎 + runs-on: ubuntu-latest + container: + image: docker://barichello/godot-ci:3.2.1 + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v1 + with: + submodules: true + - name: Setup 💻 + run: | + mkdir -v -p build/mac ~/.local/share/godot/templates + mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable + - name: Mac Build 🔧 + run: godot -v --export "Mac OSX" ./build/mac/$EXPORT_NAME.zip + - name: Upload Artifact 🚀 + uses: actions/upload-artifact@v1 + with: + name: Mac + path: ./build/mac/ + + export-web: + name: Web Export 🌐 + runs-on: ubuntu-latest + container: + image: docker://barichello/godot-ci:3.2.1 + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v1 + with: + submodules: true + - name: Setup 💻 + run: | + mkdir -v -p build/web ~/.local/share/godot/templates + mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable + - name: Web Build 🔧 + run: godot -v --export "HTML5" ./build/web/index.html + - name: Install rsync 📚 + run: | + apt-get update && apt-get install -y rsync + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: build/web # The folder the action should deploy. + TARGET_FOLDER: early_access diff --git a/.gitignore b/.gitignore index e6961cc5d..a3b95ca40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ # Godot-specific ignores .import/ -export_presets.cfg # Imported translations (automatically generated from CSV files) *.translation diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 000000000..8dcaca7c4 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,193 @@ +[preset.0] + +name="Windows Desktop 64-bit" +platform="Windows Desktop" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=true +binary_format/embed_pck=false +custom_template/release="" +custom_template/debug="" +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PoolStringArray( ) +application/icon="res://assets/graphics/icons/icon.ico" +application/file_version="0.7" +application/product_version="0.7" +application/company_name="Orama Interactive" +application/product_name="Pixelorama" +application/file_description="Pixelorama - Your free & open-source sprite editor" +application/copyright="Orama Interactive 2020" +application/trademarks="" + +[preset.1] + +name="Linux/X11 64-bit" +platform="Linux/X11" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.1.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=true +binary_format/embed_pck=false +custom_template/release="" +custom_template/debug="" + +[preset.2] + +name="Mac OSX" +platform="Mac OSX" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.2.options] + +custom_template/debug="" +custom_template/release="" +application/name="Pixelorama" +application/info="Pixelorama - Your free and open-source sprite editor" +application/icon="res://assets/graphics/icons/icon.icns" +application/identifier="com.orama_interactive.pixelorama" +application/signature="" +application/short_version="0.7" +application/version="0.7" +application/copyright="Orama Interactive 2020" +display/high_res=false +privacy/camera_usage_description="" +privacy/microphone_usage_description="" +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false + +[preset.3] + +name="HTML5" +platform="HTML5" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.3.options] + +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=true +html/custom_html_shell="" +html/head_include="" +custom_template/release="" +custom_template/debug="" + +[preset.4] + +name="Windows Desktop 32-bit" +platform="Windows Desktop" +runnable=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.4.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=false +binary_format/embed_pck=false +custom_template/release="" +custom_template/debug="" +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PoolStringArray( ) +application/icon="res://assets/graphics/icons/icon.ico" +application/file_version="0.7" +application/product_version="0.7" +application/company_name="Orama Interactive" +application/product_name="Pixelorama" +application/file_description="Pixelorama - Your free & open-source sprite editor" +application/copyright="Orama Interactive 2020" +application/trademarks="" + +[preset.5] + +name="Linux/X11 32-bit" +platform="Linux/X11" +runnable=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.5.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=false +binary_format/embed_pck=false +custom_template/release="" +custom_template/debug="" diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 5417721d3..181d37b17 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -249,10 +249,22 @@ func _ready() -> void: left_cursor = find_node_by_name(root, "LeftCursor") right_cursor = find_node_by_name(root, "RightCursor") canvas = find_node_by_name(root, "Canvas") + + var pencil_cursor_image = preload("res://assets/graphics/cursor_icons/pencil_cursor.png") + var eraser_cursor_image = preload("res://assets/graphics/cursor_icons/eraser_cursor.png") + left_cursor_tool_texture = ImageTexture.new() - left_cursor_tool_texture.create_from_image(preload("res://assets/graphics/cursor_icons/pencil_cursor.png")) + if pencil_cursor_image is Image: + left_cursor_tool_texture.create_from_image(pencil_cursor_image) + elif pencil_cursor_image is ImageTexture: + left_cursor_tool_texture.create_from_image(pencil_cursor_image.get_data()) + right_cursor_tool_texture = ImageTexture.new() - right_cursor_tool_texture.create_from_image(preload("res://assets/graphics/cursor_icons/eraser_cursor.png")) + if eraser_cursor_image is Image: + right_cursor_tool_texture.create_from_image(eraser_cursor_image) + elif eraser_cursor_image is ImageTexture: + right_cursor_tool_texture.create_from_image(eraser_cursor_image.get_data()) + tabs = find_node_by_name(root, "Tabs") main_viewport = find_node_by_name(root, "ViewportContainer") second_viewport = find_node_by_name(root, "ViewportContainer2") @@ -648,19 +660,27 @@ func redo_custom_brush(_brush_button : BaseButton = null) -> void: func update_custom_brush(mouse_button : int) -> void: var brush_type : int = current_brush_types[mouse_button] if brush_type == Brush_Types.PIXEL: - var pixel := Image.new() - pixel = preload("res://assets/graphics/pixel_image.png") - brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel, 0) + var pixel = preload("res://assets/graphics/pixel_image.png") + if pixel is Image: + brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel, 0) + elif pixel is ImageTexture: + brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel.get_data(), 0) elif brush_type == Brush_Types.CIRCLE: - var pixel := Image.new() - pixel = preload("res://assets/graphics/circle_9x9.png") - brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel, 0) + var pixel = preload("res://assets/graphics/circle_9x9.png") + if pixel is Image: + brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel, 0) + elif pixel is ImageTexture: + brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel.get_data(), 0) + left_circle_points = plot_circle(brush_sizes[0]) right_circle_points = plot_circle(brush_sizes[1]) elif brush_type == Brush_Types.FILLED_CIRCLE: - var pixel := Image.new() - pixel = preload("res://assets/graphics/circle_filled_9x9.png") - brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel, 0) + var pixel = preload("res://assets/graphics/circle_filled_9x9.png") + if pixel is Image: + brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel, 0) + elif pixel is ImageTexture: + brush_type_buttons[mouse_button].get_child(0).texture.create_from_image(pixel.get_data(), 0) + left_circle_points = plot_circle(brush_sizes[0]) right_circle_points = plot_circle(brush_sizes[1]) else: diff --git a/src/Autoload/Import.gd b/src/Autoload/Import.gd index 12e1ff9ff..88cdd1e25 100644 --- a/src/Autoload/Import.gd +++ b/src/Autoload/Import.gd @@ -109,7 +109,7 @@ func add_randomised_brush(fpaths : Array, tooltip_name : String) -> void: var first_image : Image = loaded_images.pop_front() # The index which this random brush will be at - var next_random_brush_index := Global.file_brush_container.get_child_count() + var next_random_brush_index : int = Global.file_brush_container.get_child_count() Global.file_brushes.append(first_image) Global.create_brush_button(first_image, Global.Brush_Types.RANDOM_FILE, tooltip_name)