Skip to content

Commit

Permalink
Merge pull request #2 from ywmaa/new_brush_system
Browse files Browse the repository at this point in the history
New brush system
  • Loading branch information
ywmaa authored Oct 28, 2024
2 parents 53674d0 + da46f75 commit 35de7ca
Show file tree
Hide file tree
Showing 77 changed files with 1,503 additions and 954 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*]
charset = utf-8
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

patreon: YwmaaStudio
custom: ['https://youtube.com/YwmaaGamesStudio', 'https://twitter.com/ywmaaDev','https://discord.gg/Fp7ncA2xHw']
custom: ['https://youtube.com/YwmaaGamesStudio', 'https://x.com/ywmaapersonal','https://discord.gg/Fp7ncA2xHw']
30 changes: 6 additions & 24 deletions .github/workflows/Publish-Godot-Project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,18 @@ env:
PROJECT_NAME: "My-Touch" # Needs to be added, PLEASE DON'T USE SPACES
ITCH_PROJECT_NAME: "my-touch" # Needs to be added
ITCH_USER_NAME: "ywmaa" # Needs to be added
GODOT_VERSION: 4.1.1 # Needs to be added
GODOT_VERSION: 4.3 # Needs to be added
GODOT_ANDROID_KEYSTORE_DEBUG_PATH: "/home/runner/work/My-Touch/My-Touch/android/debug.keystore" # Needs to be added
GODOT_ANDROID_KEYSTORE_DEBUG_USER: "androiddebugkey" # Needs to be added
GODOT_ANDROID_KEYSTORE_DEBUG_PASSWORD: "android" # Needs to be added
GODOT_ANDROID_KEYSTORE_RELEASE_PATH: "" # Needs to be added
GODOT_ANDROID_KEYSTORE_RELEASE_USER: "" # Needs to be added
GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD: "" # Needs to be added
jobs:
CleanArtifacts:
# This job clears out the previous artifacts made so you don't run out of space in your github account
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 1hr

Export:
needs: CleanArtifacts # wait for artifacts to clean before making a new one
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
Expand Down Expand Up @@ -112,10 +102,11 @@ jobs:
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: exports
path: exports
overwrite: true

Release:
needs: Export
Expand Down Expand Up @@ -211,7 +202,7 @@ jobs:
content: v${{ github.event.inputs.export_version }}
mode: 0655

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: VERSION
path: ./VERSION.txt
Expand All @@ -222,7 +213,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download Exports
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: exports
path: exports
Expand Down Expand Up @@ -258,12 +249,3 @@ jobs:
./butler push linux-release-v${{ github.event.inputs.export_version }}.zip ${{env.ITCH_USER_NAME}}/${{env.ITCH_PROJECT_NAME}}:linux-release
./butler push mac-release-v${{ github.event.inputs.export_version }}.zip ${{env.ITCH_USER_NAME}}/${{env.ITCH_PROJECT_NAME}}:mac-release
./butler push android-release-v${{ github.event.inputs.export_version }}.zip ${{env.ITCH_USER_NAME}}/${{env.ITCH_PROJECT_NAME}}:android-release
# Cleanup:
# needs: [Export, Release, Publish]
# runs-on: ubuntu-latest
# steps:
# - uses: geekyeggo/delete-artifact@v1
# with:
# name: VERSION
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export.cfg

*.mt.tres
*.mt.res
exports/*
Binary file added UI/graphics/tools/layers_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions UI/graphics/tools/layers_icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://2laa5p61x6uj"
path="res://.godot/imported/layers_icon.png-d6ebca362e67f9e8bf6ef2e1f18d2e02.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://UI/graphics/tools/layers_icon.png"
dest_files=["res://.godot/imported/layers_icon.png-d6ebca362e67f9e8bf6ef2e1f18d2e02.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added UI/graphics/tools/properties_settings_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions UI/graphics/tools/properties_settings_icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bm5uju3gv805p"
path="res://.godot/imported/properties_settings_icon.png-e78332d20a5eb020a6e0e2a77e60dc1f.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://UI/graphics/tools/properties_settings_icon.png"
dest_files=["res://.godot/imported/properties_settings_icon.png-e78332d20a5eb020a6e0e2a77e60dc1f.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added UI/graphics/tools/redo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions UI/graphics/tools/redo.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bdvp2p8534rib"
path="res://.godot/imported/redo.png-d6dac43fdea077a00b54de53edb1e4fb.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://UI/graphics/tools/redo.png"
dest_files=["res://.godot/imported/redo.png-d6dac43fdea077a00b54de53edb1e4fb.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added UI/graphics/tools/undo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions UI/graphics/tools/undo.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bl02c1qtbrhqv"
path="res://.godot/imported/undo.png-4a33aafcb80d7ca705f63bd040d8e518.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://UI/graphics/tools/undo.png"
dest_files=["res://.godot/imported/undo.png-4a33aafcb80d7ca705f63bd040d8e518.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
27 changes: 14 additions & 13 deletions UI/panels/graph/Camera2D.gd
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,19 @@ func _input(event: InputEvent) -> void:
elif event.is_action_released("pan"):
drag = false
elif event.is_action_pressed("zoom_in", false, true): # Wheel Up Event
zoom_camera(-1)
if !drag:
zoom_camera(-1)
elif event.is_action_pressed("zoom_out", false, true): # Wheel Down Event
zoom_camera(1)

if !drag:
zoom_camera(1)
elif event is InputEventPanGesture:
# Pan Gesture on a Laptop touchpad
offset = offset + event.delta.rotated(rotation) * 1/zoom * 2 # for moving the canvas
elif event is InputEventMagnifyGesture: # Zoom Gesture on a Laptop touchpad
if event.factor < 1:
zoom_camera(1)
zoom_camera(-0.3)
else:
zoom_camera(-1)
elif event is InputEventPanGesture and OS.get_name() != "Android":
# Pan Gesture on a Latop touchpad
offset = offset + event.delta.rotated(rotation) * 1/zoom * 7 # for moving the canvas
zoom_camera(0.3)
elif event is InputEventMouseMotion && drag:
offset = offset - event.relative.rotated(rotation) * 1/zoom
update_transparent_checker_offset()
Expand Down Expand Up @@ -134,10 +135,10 @@ func _set_camera_rotation_degrees(degrees: float) -> void:


# Zoom Camera
func zoom_camera(dir: int) -> void:
func zoom_camera(dir: float) -> void:
var viewport_size = get_viewport().size
if mt_globals.smooth_zoom:
var zoom_margin = zoom * dir / 5
var zoom_margin = (zoom * dir) / (pow(mt_globals.zoom_speed, -1))
var new_zoom = zoom + zoom_margin
if new_zoom > zoom_min && new_zoom < zoom_max:
var new_offset = (
Expand All @@ -148,18 +149,18 @@ func zoom_camera(dir: int) -> void:
tween.set_trans(Tween.TRANS_LINEAR).set_ease(Tween.EASE_IN)
tween.connect("step_finished", _on_tween_step)
tween.tween_property(self, "zoom", new_zoom, 0.05)
tween.tween_property(self, "offset", new_offset, 0.05)
#tween.tween_property(self, "offset", new_offset, 0.05)

else:
var prev_zoom := zoom
var zoom_margin = zoom * dir / 10
var zoom_margin = zoom * dir / 5.0
if zoom + zoom_margin > zoom_min:
zoom += zoom_margin

if zoom > zoom_max:
zoom = zoom_max

offset = offset + ((viewport_size * 0.5) - mouse_pos).rotated(rotation) * -(zoom - prev_zoom)
#offset = offset + ((viewport_size * 0.5) - mouse_pos).rotated(rotation) * -(zoom - prev_zoom)
zoom_changed()


Expand Down
1 change: 0 additions & 1 deletion UI/panels/graph/Canvas.gd
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ func render(p:Node, layers_array:Array[base_layer], _parent_layer:base_layer=nul
instance.owner = self
if layer is project_layer:
render(instance, layer.project.layers_container.layers)

4 changes: 2 additions & 2 deletions UI/panels/graph/Preview.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends TextureRect

func _process(delta):
if !texture.viewport_path:
texture.viewport_path = mt_globals.main_window.find_child("AppRender").get_path()
texture.viewport_path = mt_globals.main_window.app_render.get_path()
queue_redraw()
if !get_parent().get_parent().get_parent().visible or get_parent().get_parent().get_parent().has_focus == false:
return
Expand All @@ -12,7 +12,7 @@ func _process(delta):
ToolsManager.previous_mouse_position = get_local_mouse_position()

func _draw():
ToolsManager.call("draw_preview", self, get_local_mouse_position())
ToolsManager.call_thread_safe("draw_preview", self, get_local_mouse_position())

func pass_event_to_tool(event) -> bool:
if Input.is_action_just_pressed("mouse_left"):
Expand Down
Empty file modified UI/panels/graph/TransparentChecker.gdshader
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion UI/panels/graph/graph.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ snap_2d_vertices_to_pixel = true
physics_object_picking = true
sdf_oversize = 0
sdf_scale = 0
size = Vector2i(1240, 720)
size = Vector2i(1201, 720)
render_target_update_mode = 4

[node name="TransparentChecker" type="ColorRect" parent="SubViewportContainer/Viewport" node_paths=PackedStringArray("graph")]
Expand Down
8 changes: 7 additions & 1 deletion UI/panels/graph/resize_rect.gd
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ func _ready():
$"Y+".gui_input.connect(_on_child_gui_input.bind(Vector2.DOWN))

func _process(_delta):
visible = ToolsManager.TOOLS[3].tool_active
if ToolsManager.current_tool and ToolsManager.current_tool.tool_name == "Crop Tool" and ToolsManager.current_tool.tool_active:
visible = true
return
if ToolsManager.shortcut_tool and ToolsManager.shortcut_tool.tool_name == "Crop Tool" and ToolsManager.shortcut_tool.tool_active:
visible = true
return
visible = false

func _draw():
var anchor = (resize_direction + Vector2.ONE) * 0.5
Expand Down
Loading

0 comments on commit 35de7ca

Please sign in to comment.