diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-14 09:52:25 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-14 09:52:25 +0200 |
commit | 70c040d042cb536e5ce16b0cfff0e0afa39e8ed7 (patch) | |
tree | 559681d5a2569adc307409d818311760edc12654 | |
parent | 9dc8c3c89a86b8be2084890f3207adc6c9cda496 (diff) |
Logger::warning, format cleanup + req comments
18 files changed, 41 insertions, 27 deletions
diff --git a/.clang-format b/.clang-format index bfa989e..e94fe0a 100644 --- a/.clang-format +++ b/.clang-format @@ -24,7 +24,7 @@ SpaceBeforeAssignmentOperators: true SpaceAfterTemplateKeyword: false SpaceAfterLogicalNot: false PointerAlignment: Left -PackConstructorInitializers: CurrentLine +PackConstructorInitializers: BinPack NamespaceIndentation: All LambdaBodyIndentation: Signature IndentExternBlock: Indent @@ -43,8 +43,11 @@ AllowShortIfStatementsOnASingleLine: AllIfsAndElse AllowShortEnumsOnASingleLine: true AllowShortCaseLabelsOnASingleLine: true AlignTrailingComments: true -AlignEscapedNewlines: Left -AlignAfterOpenBracket: DontAlign +AlignEscapedNewlines: DontAlign +AlignAfterOpenBracket: BlockIndent +BinPackArguments: true +BinPackParameters: true +IndentRequiresClause: false AccessModifierOffset: -4 IncludeCategories: - Regex: <[[:alnum:]_]+> @@ -53,7 +56,11 @@ IncludeCategories: Priority: 2 - Regex: ^<godot_cpp/ Priority: 3 - - Regex: ^"openvic/ + - Regex: ^<openvic-dataloader/ Priority: 4 - - Regex: .* + - Regex: ^<openvic-simulation/ Priority: 5 + - Regex: ^"openvic-extension/ + Priority: 6 + - Regex: .* + Priority: 7 diff --git a/extension/deps/openvic-simulation b/extension/deps/openvic-simulation -Subproject 7772f8871348b7b52cb0a478bb76df68d8799a0 +Subproject 6278a35f4704574933464700026d8deb997da5c diff --git a/extension/src/Checksum.hpp b/extension/src/openvic-extension/Checksum.hpp index b12a9cd..b12a9cd 100644 --- a/extension/src/Checksum.hpp +++ b/extension/src/openvic-extension/Checksum.hpp diff --git a/extension/src/GameSingleton.cpp b/extension/src/openvic-extension/GameSingleton.cpp index b435f05..a164b23 100644 --- a/extension/src/GameSingleton.cpp +++ b/extension/src/openvic-extension/GameSingleton.cpp @@ -2,9 +2,9 @@ #include <godot_cpp/variant/utility_functions.hpp> -#include "openvic-simulation/utility/Logger.hpp" +#include <openvic-simulation/utility/Logger.hpp> -#include "Utilities.hpp" +#include "openvic-extension/Utilities.hpp" using namespace godot; using namespace OpenVic; @@ -105,7 +105,7 @@ void GameSingleton::_on_state_updated() { } /* REQUIREMENTS: - * MAP-21, MAP-23, MAP-25, MAP-32, MAP-33 + * MAP-21, MAP-23, MAP-25, MAP-32, MAP-33, MAP-34 */ GameSingleton::GameSingleton() : game_manager { [this]() { _on_state_updated(); } }, terrain_variants { "terrain variants" } { @@ -115,6 +115,7 @@ GameSingleton::GameSingleton() : game_manager { [this]() { _on_state_updated(); void GameSingleton::setup_logger() { Logger::set_info_func([](std::string&& str) { UtilityFunctions::print(std_to_godot_string(str)); }); + Logger::set_warning_func([](std::string&& str) { UtilityFunctions::push_warning(std_to_godot_string(str)); }); Logger::set_error_func([](std::string&& str) { UtilityFunctions::push_error(std_to_godot_string(str)); }); } diff --git a/extension/src/GameSingleton.hpp b/extension/src/openvic-extension/GameSingleton.hpp index ac9d160..bd6b73c 100644 --- a/extension/src/GameSingleton.hpp +++ b/extension/src/openvic-extension/GameSingleton.hpp @@ -3,8 +3,8 @@ #include <godot_cpp/classes/image_texture.hpp> #include <godot_cpp/classes/texture2d_array.hpp> -#include "openvic-simulation/GameManager.hpp" -#include "openvic-simulation/dataloader/Dataloader.hpp" +#include <openvic-simulation/GameManager.hpp> +#include <openvic-simulation/dataloader/Dataloader.hpp> namespace OpenVic { diff --git a/extension/src/LoadGameCompatibility.cpp b/extension/src/openvic-extension/LoadGameCompatibility.cpp index bed7442..e8e3314 100644 --- a/extension/src/LoadGameCompatibility.cpp +++ b/extension/src/openvic-extension/LoadGameCompatibility.cpp @@ -3,9 +3,9 @@ #include <godot_cpp/classes/file_access.hpp> #include <godot_cpp/variant/utility_functions.hpp> -#include "openvic-simulation/utility/BMP.hpp" +#include <openvic-simulation/utility/BMP.hpp> -#include "Utilities.hpp" +#include "openvic-extension/Utilities.hpp" using namespace godot; using namespace OpenVic; @@ -62,11 +62,11 @@ Error GameSingleton::_load_terrain_variants_compatibility_mode(String const& ter } Error GameSingleton::load_defines_compatibility_mode(PackedStringArray const& file_paths) { - static const std::filesystem::path province_image_file = "map/provinces.bmp"; - static const std::filesystem::path terrain_image_file = "map/terrain.bmp"; - static const std::filesystem::path terrain_texture_file = "map/terrain/texturesheet.tga"; + static const fs::path province_image_file = "map/provinces.bmp"; + static const fs::path terrain_image_file = "map/terrain.bmp"; + static const fs::path terrain_texture_file = "map/terrain/texturesheet.tga"; - std::vector<std::filesystem::path> roots; + Dataloader::path_vector_t roots; for (String const& path : file_paths) { roots.push_back(godot_to_std_string(path)); } diff --git a/extension/src/LoadGameOpenVic.cpp b/extension/src/openvic-extension/LoadGameOpenVic.cpp index fafc864..87c66da 100644 --- a/extension/src/LoadGameOpenVic.cpp +++ b/extension/src/openvic-extension/LoadGameOpenVic.cpp @@ -4,7 +4,7 @@ #include <godot_cpp/classes/json.hpp> #include <godot_cpp/variant/utility_functions.hpp> -#include "Utilities.hpp" +#include "openvic-extension/Utilities.hpp" using namespace godot; using namespace OpenVic; @@ -86,8 +86,10 @@ Error GameSingleton::_load_map_images(String const& province_image_path, String if (err != OK) return err; // Generate interleaved province and terrain ID image - if (!game_manager.map.generate_province_shape_image(province_dims.x, province_dims.y, province_image->get_data().ptr(), - terrain_image->get_data().ptr(), terrain_variant_map, false)) err = FAILED; + if (!game_manager.map.generate_province_shape_image(province_dims.x, province_dims.y, + province_image->get_data().ptr(), terrain_image->get_data().ptr(), terrain_variant_map, + false /* <-- whether to print detailed map errors or not (specific missing/unrecognised colours) */ + )) err = FAILED; static constexpr int32_t GPU_DIM_LIMIT = 0x3FFF; // For each dimension of the image, this finds the small number of equal subdivisions required get the individual texture dims under GPU_DIM_LIMIT diff --git a/extension/src/LoadLocalisation.cpp b/extension/src/openvic-extension/LoadLocalisation.cpp index dc7702c..dc7702c 100644 --- a/extension/src/LoadLocalisation.cpp +++ b/extension/src/openvic-extension/LoadLocalisation.cpp diff --git a/extension/src/LoadLocalisation.hpp b/extension/src/openvic-extension/LoadLocalisation.hpp index 04ec5c7..04ec5c7 100644 --- a/extension/src/LoadLocalisation.hpp +++ b/extension/src/openvic-extension/LoadLocalisation.hpp diff --git a/extension/src/MapMesh.cpp b/extension/src/openvic-extension/MapMesh.cpp index 269360a..269360a 100644 --- a/extension/src/MapMesh.cpp +++ b/extension/src/openvic-extension/MapMesh.cpp diff --git a/extension/src/MapMesh.hpp b/extension/src/openvic-extension/MapMesh.hpp index 38b208c..38b208c 100644 --- a/extension/src/MapMesh.hpp +++ b/extension/src/openvic-extension/MapMesh.hpp diff --git a/extension/src/Utilities.cpp b/extension/src/openvic-extension/Utilities.cpp index 4ca6855..4ca6855 100644 --- a/extension/src/Utilities.cpp +++ b/extension/src/openvic-extension/Utilities.cpp diff --git a/extension/src/Utilities.hpp b/extension/src/openvic-extension/Utilities.hpp index afd65c0..32e7cb5 100644 --- a/extension/src/Utilities.hpp +++ b/extension/src/openvic-extension/Utilities.hpp @@ -2,7 +2,7 @@ #include <godot_cpp/classes/image.hpp> -#include "openvic-simulation/types/Colour.hpp" +#include <openvic-simulation/types/Colour.hpp> #define ERR(x) ((x) ? OK : FAILED) diff --git a/extension/src/register_types.cpp b/extension/src/openvic-extension/register_types.cpp index 92c25a4..273bb85 100644 --- a/extension/src/register_types.cpp +++ b/extension/src/openvic-extension/register_types.cpp @@ -1,11 +1,11 @@ -#include "register_types.h" +#include "register_types.hpp" #include <godot_cpp/classes/engine.hpp> -#include "Checksum.hpp" -#include "GameSingleton.hpp" -#include "LoadLocalisation.hpp" -#include "MapMesh.hpp" +#include "openvic-extension/Checksum.hpp" +#include "openvic-extension/GameSingleton.hpp" +#include "openvic-extension/LoadLocalisation.hpp" +#include "openvic-extension/MapMesh.hpp" using namespace godot; using namespace OpenVic; diff --git a/extension/src/register_types.h b/extension/src/openvic-extension/register_types.hpp index dd24689..dd24689 100644 --- a/extension/src/register_types.h +++ b/extension/src/openvic-extension/register_types.hpp diff --git a/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd b/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd index 350c1a8..6cdbf28 100644 --- a/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd +++ b/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd @@ -11,7 +11,7 @@ signal zoom_out_button_pressed var _mapmode_button_group : ButtonGroup # REQUIREMENTS: -# * UI-550, UI-552, UI-554, UI-561, UI-562 +# * UI-550, UI-552, UI-554, UI-561, UI-562, UI-563 func _add_mapmode_button(identifier : String) -> void: var button := Button.new() button.text = identifier @@ -37,7 +37,7 @@ func _on_game_session_menu_button_pressed() -> void: # REQUIREMENTS: # * SS-76 -# * UIFUN-129, UIFUN-131, UIFUN-133, UIFUN-140, UIFUN-141 +# * UIFUN-129, UIFUN-131, UIFUN-133, UIFUN-140, UIFUN-141, UIFUN-142 func _mapmode_pressed(button : BaseButton) -> void: GameSingleton.set_mapmode(button.tooltip_text) diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn index 7e49ac8..7a982e9 100644 --- a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn +++ b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.tscn @@ -93,15 +93,18 @@ layout_mode = 2 mouse_filter = 1 [node name="PopStats" type="HBoxContainer" parent="PanelList/InteractList"] +editor_description = "UI-124" layout_mode = 2 [node name="PopTypeChart" parent="PanelList/InteractList/PopStats" instance=ExtResource("2_3oytt")] +editor_description = "UI-125" layout_mode = 2 [node name="PopIdeologyChart" parent="PanelList/InteractList/PopStats" instance=ExtResource("2_3oytt")] layout_mode = 2 [node name="PopCultureChart" parent="PanelList/InteractList/PopStats" instance=ExtResource("2_3oytt")] +editor_description = "UI-127" layout_mode = 2 [node name="HSeparator3" type="HSeparator" parent="PanelList/InteractList"] diff --git a/game/src/Game/LoadingScreen.tscn b/game/src/Game/LoadingScreen.tscn index 5ae1cb9..01b6856 100644 --- a/game/src/Game/LoadingScreen.tscn +++ b/game/src/Game/LoadingScreen.tscn @@ -59,6 +59,7 @@ _data = { } [node name="LoadingScreen" type="Control" node_paths=PackedStringArray("progress_bar", "quote_label", "animation_player")] +editor_description = "UI-24" layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 |