@@ -2,6 +2,12 @@ extends Control
22
33const TAU := PI * 2.0
44
5+ const COLOR_PRIMARY := Color ("#2e6fce" ) # main action blue
6+ const COLOR_PRIMARY_LIGHT := Color ("#3e84f5" )
7+ const COLOR_PRIMARY_DARK := Color ("#2459a8" )
8+ const COLOR_ACCENT := Color ("#54a3ff" )
9+ const COLOR_ACCENT_LIGHT := Color ("#6bb2ff" )
10+
511@export var joystick_radius := 140.0
612@export var joystick_handle_radius := 52.0
713@export var joystick_deadzone := 0.12
@@ -62,16 +68,16 @@ func _should_show_controls() -> bool:
6268
6369func _initialize_buttons () -> void :
6470 buttons .clear ()
65- buttons ["harpoon" ] = _make_button ("throw" , "action" , "Harpoon" , action_button_size , Color ( 0.18 , 0.54 , 0.95 , 0.85 ) )
66- buttons ["shoot" ] = _make_button ("shoot" , "action" , "Gun" , action_button_size * 0.9 , Color ( 0.95 , 0.32 , 0.32 , 0.85 ) , GameState .Upgrade .AK47 )
67- buttons ["pickaxe" ] = _make_button ("swing_pickaxe" , "action" , "Pick" , action_button_size * 0.85 , Color ( 0.50 , 0.78 , 0.44 , 0.85 ) , GameState .Upgrade .PICKAXE_UNLOCKED , 0.0 , true )
71+ buttons ["harpoon" ] = _make_button ("throw" , "action" , "Harpoon" , action_button_size , COLOR_PRIMARY_LIGHT )
72+ buttons ["shoot" ] = _make_button ("shoot" , "action" , "Gun" , action_button_size * 0.9 , COLOR_PRIMARY , GameState .Upgrade .AK47 )
73+ buttons ["pickaxe" ] = _make_button ("swing_pickaxe" , "action" , "Pick" , action_button_size * 0.85 , COLOR_PRIMARY_DARK , GameState .Upgrade .PICKAXE_UNLOCKED , 0.0 , true )
6874
69- buttons ["buoy" ] = _make_button ("upgrade_surface_buoy" , "ability" , "Buoy" , ability_button_size , Color ( 0.96 , 0.77 , 0.31 , 0.85 ) , GameState .Upgrade .SURFACE_BUOY , 0.0 , true )
70- buttons ["drone" ] = _make_button ("upgrade_drone_selling" , "ability" , "Drone" , ability_button_size , Color ( 0.88 , 0.52 , 0.78 , 0.85 ) , GameState .Upgrade .DRONE_SELLING , hold_threshold_default , true )
71- buttons ["save" ] = _make_button ("inventory_save" , "ability" , "Save" , ability_button_size , Color ( 0.43 , 0.72 , 0.89 , 0.85 ) , GameState .Upgrade .INVENTORY_SAVE , hold_threshold_default , true )
75+ buttons ["buoy" ] = _make_button ("upgrade_surface_buoy" , "ability" , "Buoy" , ability_button_size , COLOR_ACCENT , GameState .Upgrade .SURFACE_BUOY , 0.0 , true )
76+ buttons ["drone" ] = _make_button ("upgrade_drone_selling" , "ability" , "Drone" , ability_button_size , COLOR_ACCENT_LIGHT , GameState .Upgrade .DRONE_SELLING , hold_threshold_default , true )
77+ buttons ["save" ] = _make_button ("inventory_save" , "ability" , "Save" , ability_button_size , COLOR_PRIMARY_LIGHT , GameState .Upgrade .INVENTORY_SAVE , hold_threshold_default , true )
7278
73- buttons ["inventory" ] = _make_button ("inv_toggle" , "utility" , "Inventory" , utility_button_size , Color ( 0.29 , 0.82 , 0.74 , 0.85 ) , - 1 , 0.0 , true )
74- buttons ["pause" ] = _make_button ("esc" , "utility" , "Pause" , utility_button_size * Vector2 (0.85 , 0.85 ), Color ( 0.78 , 0.78 , 0.82 , 0.85 ) , - 1 , 0.0 , true )
79+ buttons ["inventory" ] = _make_button ("inv_toggle" , "utility" , "Inventory" , utility_button_size , COLOR_PRIMARY , - 1 , 0.0 , true )
80+ buttons ["pause" ] = _make_button ("esc" , "utility" , "Pause" , utility_button_size * Vector2 (0.85 , 0.85 ), COLOR_PRIMARY_DARK , - 1 , 0.0 , true )
7581
7682func _make_button (action : String , group : String , label : String , size : Vector2 , color : Color , requires_upgrade : int = - 1 , hold_threshold : float = 0.0 , auto_release : bool = false ) -> Dictionary :
7783 return {
@@ -277,6 +283,8 @@ func _is_button_available(name: String) -> bool:
277283 if not buttons .has (name ):
278284 return false
279285 var data : Dictionary = buttons [name ]
286+ if name == "drone" and GameState .is_intro ():
287+ return false
280288 if data .requires_upgrade != - 1 :
281289 if not GameState .upgrades .has (data .requires_upgrade ):
282290 return false
@@ -380,11 +388,7 @@ func _draw():
380388 if data .pressed :
381389 fill_color = fill_color .lightened (0.12 )
382390 draw_circle (center , radius , fill_color )
383- draw_arc (center , radius , 0.0 , TAU , 48 , fill_color .darkened (0.35 ), 4.5 )
384- if data .hold_threshold > 0.0 and data .pressed :
385- var ratio : float = clamp (data .hold_elapsed / data .hold_threshold , 0.0 , 1.0 )
386- if ratio > 0.0 :
387- draw_arc (center , radius + 6.0 , - PI / 2.0 , - PI / 2.0 + TAU * ratio , 64 , fill_color .lightened (0.25 ), 6.0 )
391+ draw_arc (center , radius , 0.0 , TAU , 48 , fill_color .darkened (0.25 ), 4.5 )
388392 if font :
389393 var text : String = data .label
390394 var text_size : Vector2 = font .get_string_size (text , HORIZONTAL_ALIGNMENT_LEFT , - 1 , font_size )
0 commit comments