Skip to content

Commit

Permalink
fix: bug when ui menu does not hide when wait
Browse files Browse the repository at this point in the history
  • Loading branch information
ramaureirac committed Jan 6, 2024
1 parent 9ab5710 commit 2e34a20
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 18 deletions.
6 changes: 3 additions & 3 deletions assets/sprites/characters/chr_pawn_archer.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cjkpd4x507ra2"
path.etc2="res://.godot/imported/chr_pawn_archer.png-5b344ef7a373376638b1716671d15ca2.etc2.ctex"
path.s3tc="res://.godot/imported/chr_pawn_archer.png-5b344ef7a373376638b1716671d15ca2.s3tc.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}

[deps]

source_file="res://assets/sprites/characters/chr_pawn_archer.png"
dest_files=["res://.godot/imported/chr_pawn_archer.png-5b344ef7a373376638b1716671d15ca2.etc2.ctex"]
dest_files=["res://.godot/imported/chr_pawn_archer.png-5b344ef7a373376638b1716671d15ca2.s3tc.ctex"]

[params]

Expand Down
6 changes: 3 additions & 3 deletions assets/sprites/characters/chr_pawn_chemist.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://brgrjjiidgxun"
path.etc2="res://.godot/imported/chr_pawn_chemist.png-9a30b9cb683733355e4ca530a1a2f3c8.etc2.ctex"
path.s3tc="res://.godot/imported/chr_pawn_chemist.png-9a30b9cb683733355e4ca530a1a2f3c8.s3tc.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}

[deps]

source_file="res://assets/sprites/characters/chr_pawn_chemist.png"
dest_files=["res://.godot/imported/chr_pawn_chemist.png-9a30b9cb683733355e4ca530a1a2f3c8.etc2.ctex"]
dest_files=["res://.godot/imported/chr_pawn_chemist.png-9a30b9cb683733355e4ca530a1a2f3c8.s3tc.ctex"]

[params]

Expand Down
6 changes: 3 additions & 3 deletions assets/sprites/characters/chr_pawn_knight.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ewitxujpa3p3"
path.etc2="res://.godot/imported/chr_pawn_knight.png-622d737eb704ae4753cf69084d8a5a9f.etc2.ctex"
path.s3tc="res://.godot/imported/chr_pawn_knight.png-622d737eb704ae4753cf69084d8a5a9f.s3tc.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}

[deps]

source_file="res://assets/sprites/characters/chr_pawn_knight.png"
dest_files=["res://.godot/imported/chr_pawn_knight.png-622d737eb704ae4753cf69084d8a5a9f.etc2.ctex"]
dest_files=["res://.godot/imported/chr_pawn_knight.png-622d737eb704ae4753cf69084d8a5a9f.s3tc.ctex"]

[params]

Expand Down
6 changes: 3 additions & 3 deletions assets/sprites/characters/chr_pawn_mage.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dtnp3dsqu2yy6"
path.etc2="res://.godot/imported/chr_pawn_mage.png-a242cd7466699ab6c12bda79a3fe25d2.etc2.ctex"
path.s3tc="res://.godot/imported/chr_pawn_mage.png-a242cd7466699ab6c12bda79a3fe25d2.s3tc.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}

[deps]

source_file="res://assets/sprites/characters/chr_pawn_mage.png"
dest_files=["res://.godot/imported/chr_pawn_mage.png-a242cd7466699ab6c12bda79a3fe25d2.etc2.ctex"]
dest_files=["res://.godot/imported/chr_pawn_mage.png-a242cd7466699ab6c12bda79a3fe25d2.s3tc.ctex"]

[params]

Expand Down
6 changes: 3 additions & 3 deletions assets/sprites/characters/chr_pawn_placeholder.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bob12its3i651"
path.etc2="res://.godot/imported/chr_pawn_placeholder.png-f962d0d4aae444ea7a2403f9b6f5323e.etc2.ctex"
path.s3tc="res://.godot/imported/chr_pawn_placeholder.png-f962d0d4aae444ea7a2403f9b6f5323e.s3tc.ctex"
metadata={
"imported_formats": ["etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}

[deps]

source_file="res://assets/sprites/characters/chr_pawn_placeholder.png"
dest_files=["res://.godot/imported/chr_pawn_placeholder.png-f962d0d4aae444ea7a2403f9b6f5323e.etc2.ctex"]
dest_files=["res://.godot/imported/chr_pawn_placeholder.png-f962d0d4aae444ea7a2403f9b6f5323e.s3tc.ctex"]

[params]

Expand Down
6 changes: 5 additions & 1 deletion src/enemy_controller.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var tactics_camera = null
var arena = null
var targets = null

var ui_control : TacticsPlayerControllerUI = null


func can_act():
for p in get_children():
Expand All @@ -20,9 +22,10 @@ func reset():
for p in get_children(): p.reset()


func configure(my_arena, my_camera):
func configure(my_arena, my_camera, my_ui_control):
tactics_camera = my_camera
arena = my_arena
ui_control = my_ui_control
curr_pawn = get_children().front()


Expand Down Expand Up @@ -71,6 +74,7 @@ func attack_pawn(delta):

func act(delta):
targets = get_parent().get_node("Player")
ui_control.set_visibility_of_actions_menu(false, null)
match stage:
0: choose_pawn()
1: chase_nearest_enemy()
Expand Down
2 changes: 1 addition & 1 deletion src/level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func _ready():
camera = $TacticsCamera
ui_control = $PlayerControllerUI
player.configure(arena, camera, ui_control)
enemy.configure(arena, camera)
enemy.configure(arena, camera, ui_control)


func turn_handler(delta):
Expand Down
2 changes: 1 addition & 1 deletion src/player_controller_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func is_mouse_hover_button():

func set_visibility_of_actions_menu(v, p):
if !$HBox/Actions.visible: $HBox/Actions/Move.grab_focus()
$HBox/Actions.visible = v
$HBox/Actions.visible = v and p.can_act()
if !p : return
$HBox/Actions/Move.disabled = !p.can_move
$HBox/Actions/Attack.disabled = !p.can_attack

0 comments on commit 2e34a20

Please sign in to comment.