aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------extension/deps/openvic2-simulation0
-rw-r--r--extension/src/GameSingleton.cpp14
-rw-r--r--game/art/terrain/desert_rocky.png.import33
-rw-r--r--game/art/terrain/desert_smooth.png.import33
-rw-r--r--game/art/terrain/farmlands.png.import33
-rw-r--r--game/art/terrain/mountains.png.import33
-rw-r--r--game/art/terrain/ocean.png.import33
-rw-r--r--game/localisation/en_GB/menus.csv4
-rw-r--r--game/localisation/en_US/menus.csv2
-rw-r--r--game/localisation/fr_FR/menus.csv2
-rw-r--r--game/src/GameSession/GameSession.tscn4
-rw-r--r--game/src/GameSession/MapControlPanel/MapControlPanel.gd (renamed from game/src/GameSession/MapControlPanel.gd)0
-rw-r--r--game/src/GameSession/MapControlPanel/MapControlPanel.tscn (renamed from game/src/GameSession/MapControlPanel.tscn)6
-rw-r--r--game/src/GameSession/MapControlPanel/Minimap.gd (renamed from game/src/GameSession/Minimap.gd)0
-rw-r--r--game/src/GameSession/MapControlPanel/Minimap.gdshader (renamed from game/src/GameSession/Minimap.gdshader)2
-rw-r--r--game/src/GameSession/ProvinceOverviewPanel.gd96
-rw-r--r--game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd121
-rw-r--r--game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn (renamed from game/src/GameSession/ProvinceOverviewPanel.tscn)2
-rw-r--r--game/src/GameSession/TerrainMap.gdshader2
-rw-r--r--game/src/MainMenu/ReleaseInfoBox.gd2
20 files changed, 147 insertions, 275 deletions
diff --git a/extension/deps/openvic2-simulation b/extension/deps/openvic2-simulation
-Subproject 3550c455526eb6f8935f488810e73fe01a1177a
+Subproject 339e0278a2064f7eeb152fe8c5778840b609e9f
diff --git a/extension/src/GameSingleton.cpp b/extension/src/GameSingleton.cpp
index 44bf874..882bfcf 100644
--- a/extension/src/GameSingleton.cpp
+++ b/extension/src/GameSingleton.cpp
@@ -313,12 +313,15 @@ Error GameSingleton::_parse_terrain_entry(String const& identifier, Variant cons
}
Error GameSingleton::load_terrain_variant_file(String const& file_path) {
- Error parse_err = _parse_json_dictionary_file("terrain variants", file_path, "",
+ const Error err = _parse_json_dictionary_file("terrain variants", file_path, "",
[this](String const& identifier, Variant const& entry) -> Error {
return _parse_terrain_entry(identifier, entry);
});
terrain_variants.lock();
- if (terrain_variants.get_item_count() == 0) parse_err = FAILED;
+ if (err != OK || terrain_variants.get_item_count() == 0) {
+ UtilityFunctions::push_error("Failed to load terrain textures!");
+ return FAILED;
+ }
Array terrain_images;
for (TerrainVariant const& var : terrain_variants.get_items()) {
@@ -327,12 +330,11 @@ Error GameSingleton::load_terrain_variant_file(String const& file_path) {
}
terrain_texture.instantiate();
- const Error texturearray_err = terrain_texture->create_from_images(terrain_images);
- if (texturearray_err != OK) {
+ if (terrain_texture->create_from_images(terrain_images) != OK) {
UtilityFunctions::push_error("Failed to create terrain texture array!");
- return texturearray_err;
+ return FAILED;
}
- return parse_err;
+ return OK;
}
Error GameSingleton::load_map_images(String const& province_image_path, String const& terrain_image_path) {
diff --git a/game/art/terrain/desert_rocky.png.import b/game/art/terrain/desert_rocky.png.import
index b8104eb..8dd0c09 100644
--- a/game/art/terrain/desert_rocky.png.import
+++ b/game/art/terrain/desert_rocky.png.import
@@ -1,34 +1,3 @@
[remap]
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://do6rtj6cejxo7"
-path="res://.godot/imported/desert_rocky.png-2c26845e144e1e8b9c55419654df6654.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://art/terrain/desert_rocky.png"
-dest_files=["res://.godot/imported/desert_rocky.png-2c26845e144e1e8b9c55419654df6654.ctex"]
-
-[params]
-
-compress/mode=3
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=2
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=false
-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=0
+importer="keep"
diff --git a/game/art/terrain/desert_smooth.png.import b/game/art/terrain/desert_smooth.png.import
index bc0513d..8dd0c09 100644
--- a/game/art/terrain/desert_smooth.png.import
+++ b/game/art/terrain/desert_smooth.png.import
@@ -1,34 +1,3 @@
[remap]
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://beo5i11jfu3al"
-path="res://.godot/imported/desert_smooth.png-58a5349b112e9e97cf3426b380f022ef.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://art/terrain/desert_smooth.png"
-dest_files=["res://.godot/imported/desert_smooth.png-58a5349b112e9e97cf3426b380f022ef.ctex"]
-
-[params]
-
-compress/mode=3
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=2
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=false
-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=0
+importer="keep"
diff --git a/game/art/terrain/farmlands.png.import b/game/art/terrain/farmlands.png.import
index 4a06b1f..8dd0c09 100644
--- a/game/art/terrain/farmlands.png.import
+++ b/game/art/terrain/farmlands.png.import
@@ -1,34 +1,3 @@
[remap]
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://ckf222w5usrsu"
-path="res://.godot/imported/farmlands.png-821213ab9dba19cea6f6c966b3a3760b.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://art/terrain/farmlands.png"
-dest_files=["res://.godot/imported/farmlands.png-821213ab9dba19cea6f6c966b3a3760b.ctex"]
-
-[params]
-
-compress/mode=3
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=2
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=false
-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=0
+importer="keep"
diff --git a/game/art/terrain/mountains.png.import b/game/art/terrain/mountains.png.import
index 47a00fd..8dd0c09 100644
--- a/game/art/terrain/mountains.png.import
+++ b/game/art/terrain/mountains.png.import
@@ -1,34 +1,3 @@
[remap]
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://c20q2sqf38eq8"
-path="res://.godot/imported/mountains.png-f1ab7d9b0a0deb485923c40b1cfb258e.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://art/terrain/mountains.png"
-dest_files=["res://.godot/imported/mountains.png-f1ab7d9b0a0deb485923c40b1cfb258e.ctex"]
-
-[params]
-
-compress/mode=3
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=2
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=false
-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=0
+importer="keep"
diff --git a/game/art/terrain/ocean.png.import b/game/art/terrain/ocean.png.import
index 644f7e7..8dd0c09 100644
--- a/game/art/terrain/ocean.png.import
+++ b/game/art/terrain/ocean.png.import
@@ -1,34 +1,3 @@
[remap]
-importer="texture"
-type="CompressedTexture2D"
-uid="uid://dlvvim3j7dbnn"
-path="res://.godot/imported/ocean.png-3d7e213c3fca805d033e0d3bf567fc01.ctex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://art/terrain/ocean.png"
-dest_files=["res://.godot/imported/ocean.png-3d7e213c3fca805d033e0d3bf567fc01.ctex"]
-
-[params]
-
-compress/mode=3
-compress/high_quality=false
-compress/lossy_quality=0.7
-compress/hdr_compression=1
-compress/normal_map=2
-compress/channel_pack=0
-mipmaps/generate=false
-mipmaps/limit=-1
-roughness/mode=0
-roughness/src_normal=""
-process/fix_alpha_border=false
-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=0
+importer="keep"
diff --git a/game/localisation/en_GB/menus.csv b/game/localisation/en_GB/menus.csv
index 6351b59..999483f 100644
--- a/game/localisation/en_GB/menus.csv
+++ b/game/localisation/en_GB/menus.csv
@@ -7,7 +7,7 @@ MAINMENU_MULTIPLAYER,Multiplayer
MAINMENU_OPTIONS,Options
MAINMENU_CREDITS,Credits
MAINMENU_EXIT,Exit
-MAINMENU_CHECKSUM,Checksum %s
+MAINMENU_CHECKSUM,Checksum {checksum}
,, Options
OPTIONS_RESET,R
@@ -70,7 +70,7 @@ DIALOG_SAVE_AND_QUIT,Save and Quit
,, Province Overview Panel
province_MISSING,No Province
region_MISSING,No Region
-LIFE_RATING_TOOLTIP,Liferating: %d
+LIFE_RATING_TOOLTIP,Liferating: {life_rating}
rgo_MISSING,No RGO
building_MISSING,No Building
building_fort,Fort
diff --git a/game/localisation/en_US/menus.csv b/game/localisation/en_US/menus.csv
index 88cf12c..c69d36b 100644
--- a/game/localisation/en_US/menus.csv
+++ b/game/localisation/en_US/menus.csv
@@ -7,7 +7,7 @@ MAINMENU_MULTIPLAYER,Multiplayer
MAINMENU_OPTIONS,Options
MAINMENU_CREDITS,Credits
MAINMENU_EXIT,Exit
-MAINMENU_CHECKSUM,Checksum %s
+MAINMENU_CHECKSUM,Checksum {checksum}
,, Options
OPTIONS_RESET,R
diff --git a/game/localisation/fr_FR/menus.csv b/game/localisation/fr_FR/menus.csv
index 3794695..2e395f7 100644
--- a/game/localisation/fr_FR/menus.csv
+++ b/game/localisation/fr_FR/menus.csv
@@ -7,7 +7,7 @@ MAINMENU_MULTIPLAYER,Multijouer
MAINMENU_OPTIONS,Options
MAINMENU_CREDITS,Credits
MAINMENU_EXIT,Quitter
-MAINMENU_CHECKSUM,Somme de contrĂ´le %s
+MAINMENU_CHECKSUM,Somme de contrĂ´le {checksum}
,, Options
OPTIONS_RESET,R
diff --git a/game/src/GameSession/GameSession.tscn b/game/src/GameSession/GameSession.tscn
index 411a829..ce3471f 100644
--- a/game/src/GameSession/GameSession.tscn
+++ b/game/src/GameSession/GameSession.tscn
@@ -2,10 +2,10 @@
[ext_resource type="Script" path="res://src/GameSession/GameSession.gd" id="1_eklvp"]
[ext_resource type="PackedScene" uid="uid://cvl76duuym1wq" path="res://src/MusicConductor/MusicPlayer.tscn" id="2_kt6aa"]
-[ext_resource type="PackedScene" uid="uid://g524p8lr574w" path="res://src/GameSession/MapControlPanel.tscn" id="3_afh6d"]
+[ext_resource type="PackedScene" uid="uid://g524p8lr574w" path="res://src/GameSession/MapControlPanel/MapControlPanel.tscn" id="3_afh6d"]
[ext_resource type="PackedScene" uid="uid://dvdynl6eir40o" path="res://src/GameSession/GameSessionMenu.tscn" id="3_bvmqh"]
[ext_resource type="PackedScene" uid="uid://dkehmdnuxih2r" path="res://src/GameSession/MapView.tscn" id="4_xkg5j"]
-[ext_resource type="PackedScene" uid="uid://byq323jbel48u" path="res://src/GameSession/ProvinceOverviewPanel.tscn" id="5_osjnn"]
+[ext_resource type="PackedScene" uid="uid://byq323jbel48u" path="res://src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn" id="5_osjnn"]
[ext_resource type="PackedScene" uid="uid://cnbfxjy1m6wja" path="res://src/OptionMenu/OptionsMenu.tscn" id="6_p5mnx"]
[ext_resource type="PackedScene" uid="uid://dd8k3p7r3huwc" path="res://src/GameSession/GameSpeedPanel.tscn" id="7_myy4q"]
diff --git a/game/src/GameSession/MapControlPanel.gd b/game/src/GameSession/MapControlPanel/MapControlPanel.gd
index 0cef057..0cef057 100644
--- a/game/src/GameSession/MapControlPanel.gd
+++ b/game/src/GameSession/MapControlPanel/MapControlPanel.gd
diff --git a/game/src/GameSession/MapControlPanel.tscn b/game/src/GameSession/MapControlPanel/MapControlPanel.tscn
index 0da2d5a..91e2e7e 100644
--- a/game/src/GameSession/MapControlPanel.tscn
+++ b/game/src/GameSession/MapControlPanel/MapControlPanel.tscn
@@ -1,8 +1,8 @@
[gd_scene load_steps=7 format=3 uid="uid://g524p8lr574w"]
-[ext_resource type="Script" path="res://src/GameSession/MapControlPanel.gd" id="1_ign64"]
-[ext_resource type="Shader" path="res://src/GameSession/Minimap.gdshader" id="2_rinsg"]
-[ext_resource type="Script" path="res://src/GameSession/Minimap.gd" id="3_s4dml"]
+[ext_resource type="Script" path="res://src/GameSession/MapControlPanel/MapControlPanel.gd" id="1_ign64"]
+[ext_resource type="Shader" path="res://src/GameSession/MapControlPanel/Minimap.gdshader" id="2_rinsg"]
+[ext_resource type="Script" path="res://src/GameSession/MapControlPanel/Minimap.gd" id="3_s4dml"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bhuqb"]
shader = ExtResource("2_rinsg")
diff --git a/game/src/GameSession/Minimap.gd b/game/src/GameSession/MapControlPanel/Minimap.gd
index 1f9b75e..1f9b75e 100644
--- a/game/src/GameSession/Minimap.gd
+++ b/game/src/GameSession/MapControlPanel/Minimap.gd
diff --git a/game/src/GameSession/Minimap.gdshader b/game/src/GameSession/MapControlPanel/Minimap.gdshader
index 8b68108..608abe2 100644
--- a/game/src/GameSession/Minimap.gdshader
+++ b/game/src/GameSession/MapControlPanel/Minimap.gdshader
@@ -1,6 +1,6 @@
shader_type canvas_item;
-#include "ProvinceIndexSampler.gdshaderinc"
+#include "res://src/GameSession/ProvinceIndexSampler.gdshaderinc"
// Index of the currently selected province
uniform uint selected_index;
diff --git a/game/src/GameSession/ProvinceOverviewPanel.gd b/game/src/GameSession/ProvinceOverviewPanel.gd
deleted file mode 100644
index 4172860..0000000
--- a/game/src/GameSession/ProvinceOverviewPanel.gd
+++ /dev/null
@@ -1,96 +0,0 @@
-extends PanelContainer
-
-@export var _province_name_label : Label
-@export var _region_name_label : Label
-@export var _life_rating_bar : ProgressBar
-@export var _rgo_icon_texture_rect : TextureRect
-@export var _rgo_name_label : Label
-@export var _buildings_container : Container
-
-const _missing_suffix : String = "_MISSING"
-
-var _selected_index : int:
- get: return _selected_index
- set(v):
- _selected_index = v
- update_info()
-var _province_info : Dictionary
-
-func _ready():
- GameSingleton.province_selected.connect(_on_province_selected)
- GameSingleton.state_updated.connect(update_info)
- update_info()
-
-enum { CANNOT_EXPAND, CAN_EXPAND, PREPARING, EXPANDING }
-
-func _expand_building(building_identifier : String) -> void:
- if GameSingleton.expand_building(_selected_index, building_identifier) != OK:
- push_error("Failed to expand ", building_identifier, " in province #", _selected_index);
-
-# REQUIREMENTS:
-# * UI-183, UI-185, UI-186, UI-765, UI-187, UI-188, UI-189
-# * UI-191, UI-193, UI-194, UI-766, UI-195, UI-196, UI-197
-# * UI-199, UI-201, UI-202, UI-767, UI-203, UI-204, UI-205
-func _add_building(building : Dictionary) -> void:
- const _expand_province_building : String = "EXPAND_PROVINCE_BUILDING"
-
- var level_label := Label.new()
- level_label.text = str(building.get(GameSingleton.get_building_info_level_key(), 0))
- _buildings_container.add_child(level_label)
-
- var building_label := Label.new()
- building_label.text = building.get(GameSingleton.get_building_info_building_key(),
- GameSingleton.get_building_info_building_key() + _missing_suffix)
- _buildings_container.add_child(building_label)
-
- var expansion_state : int = building.get(GameSingleton.get_building_info_expansion_state_key(),
- CANNOT_EXPAND)
- if expansion_state == PREPARING or expansion_state == EXPANDING:
- var progress_bar := ProgressBar.new()
- progress_bar.max_value = 1
- progress_bar.value = building.get(GameSingleton.get_building_info_expansion_progress_key(), 0)
- progress_bar.size_flags_horizontal = Control.SIZE_EXPAND_FILL
- progress_bar.mouse_filter = Control.MOUSE_FILTER_PASS
- _buildings_container.add_child(progress_bar)
- else:
- var expand_button := Button.new()
- expand_button.text = _expand_province_building
- expand_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
- expand_button.mouse_filter = Control.MOUSE_FILTER_PASS
- expand_button.disabled = expansion_state != CAN_EXPAND
- expand_button.pressed.connect(func(): _expand_building(building_label.text))
- _buildings_container.add_child(expand_button)
-
-func update_info() -> void:
- const _life_rating_tooltip : String = "LIFE_RATING_TOOLTIP"
-
- _province_info = GameSingleton.get_province_info_from_index(_selected_index)
- if _province_info:
- _province_name_label.text = _province_info.get(GameSingleton.get_province_info_province_key(),
- GameSingleton.get_province_info_province_key() + _missing_suffix)
- _region_name_label.text = _province_info.get(GameSingleton.get_province_info_region_key(),
- GameSingleton.get_province_info_region_key() + _missing_suffix)
-
- _life_rating_bar.value = _province_info.get(GameSingleton.get_province_info_life_rating_key(), 0)
- _life_rating_bar.tooltip_text = tr(_life_rating_tooltip) % _life_rating_bar.value
-
- _rgo_name_label.text = _province_info.get(GameSingleton.get_province_info_rgo_key(),
- GameSingleton.get_province_info_rgo_key() + _missing_suffix)
- _rgo_icon_texture_rect.texture = GameSingleton.get_good_icon_texture(_rgo_name_label.text)
-
- for child in _buildings_container.get_children():
- _buildings_container.remove_child(child)
- child.queue_free()
- var buildings : Array = _province_info.get(GameSingleton.get_province_info_buildings_key(), [])
- for building in buildings:
- _add_building(building)
-
- show()
- else:
- hide()
-
-func _on_province_selected(index : int) -> void:
- _selected_index = index
-
-func _on_close_button_pressed() -> void:
- GameSingleton.set_selected_province(0)
diff --git a/game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd b/game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
new file mode 100644
index 0000000..0d8d8b7
--- /dev/null
+++ b/game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
@@ -0,0 +1,121 @@
+extends PanelContainer
+
+@export var _province_name_label : Label
+@export var _region_name_label : Label
+@export var _life_rating_bar : ProgressBar
+@export var _rgo_icon_texture_rect : TextureRect
+@export var _rgo_name_label : Label
+@export var _buildings_container : Container
+
+const _missing_suffix : String = "_MISSING"
+
+var _selected_index : int:
+ get: return _selected_index
+ set(v):
+ _selected_index = v
+ update_info()
+var _province_info : Dictionary
+
+func _ready():
+ GameSingleton.province_selected.connect(_on_province_selected)
+ GameSingleton.state_updated.connect(update_info)
+ update_info()
+
+enum { CANNOT_EXPAND, CAN_EXPAND, PREPARING, EXPANDING }
+
+func _expand_building(building_identifier : String) -> void:
+ if GameSingleton.expand_building(_selected_index, building_identifier) != OK:
+ push_error("Failed to expand ", building_identifier, " in province #", _selected_index);
+
+# Each building row contains:
+# level - Level Label
+# name - Name Label
+# button - Expansion Button
+# progress_bar - Expansion ProgressBar
+var _building_rows : Array[Dictionary]
+
+# REQUIREMENTS:
+# * UI-183, UI-185, UI-186, UI-765, UI-187, UI-188, UI-189
+# * UI-191, UI-193, UI-194, UI-766, UI-195, UI-196, UI-197
+# * UI-199, UI-201, UI-202, UI-767, UI-203, UI-204, UI-205
+func _add_building_row() -> void:
+ var row : Dictionary
+
+ row.level = Label.new()
+ row.level.text = "X"
+ _buildings_container.add_child(row.level)
+
+ row.name = Label.new()
+ row.name.text = GameSingleton.get_building_info_building_key() + _missing_suffix
+ _buildings_container.add_child(row.name)
+
+ row.button = Button.new()
+ row.button.text = "EXPAND_PROVINCE_BUILDING"
+ row.button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
+ row.button.mouse_filter = Control.MOUSE_FILTER_PASS
+ row.button.pressed.connect(func(): _expand_building(row.name.text))
+ _buildings_container.add_child(row.button)
+
+ row.progress_bar = ProgressBar.new()
+ row.progress_bar.max_value = 1
+ row.progress_bar.size_flags_horizontal = Control.SIZE_EXPAND_FILL
+ row.progress_bar.mouse_filter = Control.MOUSE_FILTER_PASS
+ _buildings_container.add_child(row.progress_bar)
+
+ _building_rows.append(row)
+ _set_building_row(_building_rows.size() - 1, {})
+
+func _set_building_row(index : int, building : Dictionary) -> void:
+ if index < 0 or index > _building_rows.size():
+ push_error("Invalid building row index: ", index, " (max ", _building_rows.size(), ")")
+ return
+ if index == _building_rows.size(): _add_building_row()
+ var row := _building_rows[index]
+ if building.is_empty():
+ row.level.visible = false
+ row.name.visible = false
+ row.progress_bar.visible = false
+ row.button.visible = false
+ return
+ row.level.text = str(building.get(GameSingleton.get_building_info_level_key(), 0))
+ row.level.visible = true
+ row.name.text = building.get(GameSingleton.get_building_info_building_key(),
+ GameSingleton.get_building_info_building_key() + _missing_suffix)
+ row.name.visible = true
+
+ var expansion_state : int = building.get(GameSingleton.get_building_info_expansion_state_key(),
+ CANNOT_EXPAND)
+ var show_progress_bar := expansion_state == PREPARING or expansion_state == EXPANDING
+ row.progress_bar.value = building.get(GameSingleton.get_building_info_expansion_progress_key(), 0)
+ row.progress_bar.visible = show_progress_bar
+ row.button.disabled = expansion_state != CAN_EXPAND
+ row.button.visible = not show_progress_bar
+
+func update_info() -> void:
+ _province_info = GameSingleton.get_province_info_from_index(_selected_index)
+ if _province_info:
+ _province_name_label.text = _province_info.get(GameSingleton.get_province_info_province_key(),
+ GameSingleton.get_province_info_province_key() + _missing_suffix)
+ _region_name_label.text = _province_info.get(GameSingleton.get_province_info_region_key(),
+ GameSingleton.get_province_info_region_key() + _missing_suffix)
+
+ _life_rating_bar.value = _province_info.get(GameSingleton.get_province_info_life_rating_key(), 0)
+ _life_rating_bar.tooltip_text = tr("LIFE_RATING_TOOLTIP").format({ "life_rating": _life_rating_bar.value })
+
+ _rgo_name_label.text = _province_info.get(GameSingleton.get_province_info_rgo_key(),
+ GameSingleton.get_province_info_rgo_key() + _missing_suffix)
+ _rgo_icon_texture_rect.texture = GameSingleton.get_good_icon_texture(_rgo_name_label.text)
+
+ var buildings : Array = _province_info.get(GameSingleton.get_province_info_buildings_key(), [])
+ for i in max(buildings.size(), _building_rows.size()):
+ _set_building_row(i, buildings[i] if i < buildings.size() else {})
+
+ show()
+ else:
+ hide()
+
+func _on_province_selected(index : int) -> void:
+ _selected_index = index
+
+func _on_close_button_pressed() -> void:
+ GameSingleton.set_selected_province(0)
diff --git a/game/src/GameSession/ProvinceOverviewPanel.tscn b/game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn
index 722299b..a233db0 100644
--- a/game/src/GameSession/ProvinceOverviewPanel.tscn
+++ b/game/src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://byq323jbel48u"]
-[ext_resource type="Script" path="res://src/GameSession/ProvinceOverviewPanel.gd" id="1_3n8k5"]
+[ext_resource type="Script" path="res://src/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd" id="1_3n8k5"]
[node name="ProvinceOverviewPanel" type="PanelContainer" node_paths=PackedStringArray("_province_name_label", "_region_name_label", "_life_rating_bar", "_rgo_icon_texture_rect", "_rgo_name_label", "_buildings_container")]
editor_description = "UI-56"
diff --git a/game/src/GameSession/TerrainMap.gdshader b/game/src/GameSession/TerrainMap.gdshader
index 7d160f0..88e7019 100644
--- a/game/src/GameSession/TerrainMap.gdshader
+++ b/game/src/GameSession/TerrainMap.gdshader
@@ -2,7 +2,7 @@ shader_type spatial;
render_mode unshaded;
-#include "ProvinceIndexSampler.gdshaderinc"
+#include "res://src/GameSession/ProvinceIndexSampler.gdshaderinc"
// Province colour texture
uniform sampler2D province_colour_tex: source_color, repeat_enable, filter_nearest;
diff --git a/game/src/MainMenu/ReleaseInfoBox.gd b/game/src/MainMenu/ReleaseInfoBox.gd
index ca03af3..e363162 100644
--- a/game/src/MainMenu/ReleaseInfoBox.gd
+++ b/game/src/MainMenu/ReleaseInfoBox.gd
@@ -28,7 +28,7 @@ func _notification(what : int):
_update_checksum_label_text()
func _update_checksum_label_text() -> void:
- _checksum_label.tooltip_text = tr("MAINMENU_CHECKSUM") % _checksum
+ _checksum_label.tooltip_text = tr("MAINMENU_CHECKSUM").format({ "checksum": _checksum })
_checksum_label.text = "(%s)" % _checksum.substr(0, 4)
func _on_version_label_pressed():