Skip to content

Commit

Permalink
feat: added visual hint when copied level code
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-lungarella authored and Lincoln-Ab committed Oct 29, 2024
1 parent 532761b commit ff7b245
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Secondary mechanics are:
| TOTAL | ----- | ------ | ------ | ----- | 29 |


- [ ] Add hint when copied level code;
- [x] Add hint when copied level code;
- [x] Disable save button when name or code is missing in import window;
- [x] Update level interface when importing a level;
- [x] Duplicate inspection panel for normal/custom levels;
Expand Down
Binary file added assets/ui/paste_check_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 assets/ui/paste_check_icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bre7mikpnncf"
path="res://.godot/imported/paste_check_icon.png-88ccdc01eb1267b185eb2cc0ba130c89.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ui/paste_check_icon.png"
dest_files=["res://.godot/imported/paste_check_icon.png-88ccdc01eb1267b185eb2cc0ba130c89.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
3 changes: 3 additions & 0 deletions scripts/user_interface/custom_level_inspect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const LEVEL_BUILDER = preload("res://packed_scene/scene_2d/LevelBuilder.tscn")
const BUILDER_UI = preload("res://packed_scene/user_interface/BuilderUI.tscn")
const LEVEL_MANAGER = preload("res://packed_scene/scene_2d/LevelManager.tscn")
const GAME_UI = preload("res://packed_scene/user_interface/GameUI.tscn")
const PASTE_CHECK_ICON = preload("res://assets/ui/paste_check_icon.png")

var _level_name: String
var _level_code: String
Expand Down Expand Up @@ -96,6 +97,8 @@ func _on_background_gui_input(event: InputEvent) -> void:

func _on_copy_btn_pressed() -> void:
DisplayServer.clipboard_set(_level_code)
copy_btn.icon = PASTE_CHECK_ICON
copy_btn.add_theme_color_override("icon_normal_color", Color.WEB_GREEN)


func _on_delete_btn_pressed() -> void:
Expand Down
1 change: 1 addition & 0 deletions scripts/user_interface/level_import.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends Control

const BUTTON_ERROR = preload("res://assets/resources/themes/button_error.tres")

var _inserted_code: String

@onready var code: Button = %Code
Expand Down

0 comments on commit ff7b245

Please sign in to comment.