diff options
author | hop311 <hop3114@gmail.com> | 2023-12-19 00:38:54 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2023-12-25 19:06:13 +0100 |
commit | 4e9764ee29fb7b453862835d5aa3a081b0f9a269 (patch) | |
tree | a59c5b960a706a383b8ebd1dbcfb704067a5b51b /game/src/Game/GameSession/MapControlPanel | |
parent | d26c990d9a5596a3ef3b32ba1cb0f99950cd6d34 (diff) |
Back to UI Work
- UIAdapter -> UITools with cleaner API
- GUIOverlappingElementsBox (for core and modifier icons)
- Improved GUINode API
- Province building slots
- TypeHints for files in the GameSession folder
- Incorporate SIM strong colour types
Diffstat (limited to 'game/src/Game/GameSession/MapControlPanel')
-rw-r--r-- | game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd | 4 | ||||
-rw-r--r-- | game/src/Game/GameSession/MapControlPanel/Minimap.gd | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd b/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd index 6cdbf28..eb4dd9f 100644 --- a/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd +++ b/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd @@ -24,10 +24,10 @@ func _add_mapmode_button(identifier : String) -> void: if _mapmode_button_group.get_pressed_button() == null: button.button_pressed = true -func _ready(): +func _ready() -> void: _mapmode_button_group = ButtonGroup.new() _mapmode_button_group.pressed.connect(_mapmode_pressed) - for index in GameSingleton.get_mapmode_count(): + for index : int in GameSingleton.get_mapmode_count(): _add_mapmode_button(GameSingleton.get_mapmode_identifier(index)) # REQUIREMENTS: diff --git a/game/src/Game/GameSession/MapControlPanel/Minimap.gd b/game/src/Game/GameSession/MapControlPanel/Minimap.gd index 5564821..ce27302 100644 --- a/game/src/Game/GameSession/MapControlPanel/Minimap.gd +++ b/game/src/Game/GameSession/MapControlPanel/Minimap.gd @@ -9,7 +9,7 @@ var _minimap_shader : ShaderMaterial var _viewport_points : PackedVector2Array -func _ready(): +func _ready() -> void: _minimap_texture.custom_minimum_size = Vector2(GameSingleton.get_map_aspect_ratio(), 1.0) * 150 var minimap_material := _minimap_texture.get_material() if GameLoader.ShaderManager.set_up_shader(minimap_material, false) != OK: @@ -32,7 +32,7 @@ func _draw() -> void: # REQUIREMENTS # * SS-81 # * UIFUN-127 -func _unhandled_input(event : InputEvent): +func _unhandled_input(event : InputEvent) -> void: if event is InputEventMouse and Input.is_action_pressed(_action_click): var pos_clicked := get_local_mouse_position() / size - Vector2(0.5, 0.5) if abs(pos_clicked.x) < 0.5 and abs(pos_clicked.y) < 0.5: @@ -100,6 +100,6 @@ func _on_map_view_camera_changed(near_left : Vector2, far_left : Vector2, far_ri _add_line_looped_over_x(far_left, near_left) _add_line_looped_over_x(near_right, far_right) - for i in _viewport_points.size(): + for i : int in _viewport_points.size(): _viewport_points[i] *= size queue_redraw() |