diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-02-21 08:49:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 08:49:46 +0100 |
commit | fb9e316a18139ea6b6ffe3b237796b42d7114738 (patch) | |
tree | 7eb315989e19d1e8eabea955330e3a2e5469c876 /game/src/SampleGame.gd | |
parent | 0b3f9cb21cfa86e98649066ff7d260b4f9022023 (diff) |
Add stylized theme to MainMenu (#12)
* Add stylized theme to MainMenu
Increase message queue memory size by 4
Add default_theme.theme
Refactor SampleGame.gd to better account for refactoring via @export nodes
Properly aligne SampleGame scene
Reorganize MainMenu into its own directory
Add main_menu_border_paper.png
Add main_menu_button.png
* Add background image to theme
Implement StyleBoxCombinedTexture
Allows drawing an array of textures all at once
Make MainMenu Panel a PanelContainer for consistency
* Implement MainMenu button press, hover, and focus styles
Improve MainMenu button disabled style
* Add Godot's latest documentation to the README.md
Diffstat (limited to 'game/src/SampleGame.gd')
-rw-r--r-- | game/src/SampleGame.gd | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/game/src/SampleGame.gd b/game/src/SampleGame.gd index 0e3a61d..589fed2 100644 --- a/game/src/SampleGame.gd +++ b/game/src/SampleGame.gd @@ -2,6 +2,15 @@ extends Control var selectedId = 0 +@export +var _province_num_display : Label + +@export +var _province_size_display : Label + +@export +var _main_menu_scene : PackedScene + # Called when the node enters the scene tree for the first time. func _ready(): updateVisibleInfo() @@ -14,8 +23,8 @@ func _ready(): func updateVisibleInfo(): - $CenterContainer/VBoxContainer2/GridContainer/ProvinceNumDisplay.text = str(selectedId) - $CenterContainer/VBoxContainer2/GridContainer/ProvinceSizeDisplay.text = str(Simulation.queryProvinceSize(selectedId)) + _province_num_display.text = str(selectedId) + _province_size_display.text = str(Simulation.queryProvinceSize(selectedId)) func _on_pass_time_button_pressed(): @@ -37,4 +46,4 @@ func _on_prev_prov_button_pressed(): func _on_to_main_menu_pressed(): - get_tree().change_scene_to_file("res://src/MainMenu.tscn") + get_tree().change_scene_to_packed(_main_menu_scene) |