From 97d57bae7a7d5ecb012fb9a23246f61abc549566 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Wed, 18 Mar 2026 14:32:55 +0100 Subject: [PATCH 1/3] Adapting to the new library version --- app_win_2_back.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app_win_2_back.cpp b/app_win_2_back.cpp index cc65a5d..6628d46 100644 --- a/app_win_2_back.cpp +++ b/app_win_2_back.cpp @@ -225,7 +225,7 @@ namespace gui_to_app { static void convert_to_label(std::array &convert, const std::string_view &err_msg, - const uint32_t data, + const std::int32_t data, Gtk::Label *const __restrict label) noexcept { if (const auto [ptr, ec] = std::to_chars(convert.data(), convert.data() + convert.size(), data); ec != std::errc()) { @@ -244,10 +244,13 @@ namespace gui_to_app { const std::string_view short_name, const CaracInterface &labels) noexcept { std::array convert{}; - convert_to_label(convert, std::format("base {}", short_name), charac.get_base(), labels.base); + convert_to_label(convert, + std::format("base {}", short_name), + static_cast(charac.get_base()), + labels.base); convert_to_label(convert, std::format("carac {}", short_name), - charac.get_carac(), + static_cast(charac.get_carac()), labels.carac); convert_to_label(convert, std::format("materiel {}", short_name), From 5cadda6b978da44213d7eb2a290adff6bcab45bc Mon Sep 17 00:00:00 2001 From: Pcornat Date: Wed, 18 Mar 2026 14:47:02 +0100 Subject: [PATCH 2/3] Adding damage, armor and critic labels. --- app_win_2_back.cpp | 9 +++++++++ app_win_2_back.hpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/app_win_2_back.cpp b/app_win_2_back.cpp index 6628d46..b51ea15 100644 --- a/app_win_2_back.cpp +++ b/app_win_2_back.cpp @@ -206,6 +206,10 @@ namespace gui_to_app { app_builder }; + damage_label = app_builder->get_widget("label_degat"); + armor_label = app_builder->get_widget("label_armure"); + critic_label = app_builder->get_widget("label_critique"); + debug_button->signal_clicked().connect(sigc::mem_fun(*this, &AppWin2Back::debug_button_clicked), false); } @@ -267,6 +271,11 @@ namespace gui_to_app { update_in_labels(sheet.get_endurance(), "endu", endu_labels); update_in_labels(sheet.get_adresse(), "adresse", addr_labels); update_in_labels(sheet.get_chance(), "chance", luck_labels); + + std::array convert{ '\0' }; + convert_to_label(convert, "damage", static_cast(sheet.get_damage()), damage_label); + convert_to_label(convert, "armor", static_cast(sheet.get_armor()), armor_label); + convert_to_label(convert, "critic", static_cast(sheet.get_critique()), critic_label); } bool AppWin2Back::insert_obj(const character::billyEnums &obj) noexcept { diff --git a/app_win_2_back.hpp b/app_win_2_back.hpp index 0475a9d..2865b72 100644 --- a/app_win_2_back.hpp +++ b/app_win_2_back.hpp @@ -108,6 +108,10 @@ namespace gui_to_app { CaracInterface luck_labels; + Gtk::Label *damage_label{ nullptr }; + Gtk::Label *armor_label{ nullptr }; + Gtk::Label *critic_label{ nullptr }; + Gtk::Button *debug_button{ nullptr }; std::array signal_handlers{ From 8a91b471528339c447150a6128ce2a39cf57d427 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Wed, 18 Mar 2026 14:47:08 +0100 Subject: [PATCH 3/3] Better looking --- window_ui.ui | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/window_ui.ui b/window_ui.ui index a9d7e38..b0627e8 100644 --- a/window_ui.ui +++ b/window_ui.ui @@ -536,6 +536,7 @@ + True start @@ -549,7 +550,8 @@ - end + center + True 1 0 @@ -568,7 +570,7 @@ - end + center 1 1 @@ -587,7 +589,7 @@ - end + center 1 2 @@ -611,6 +613,8 @@ + center + True 2 0 @@ -654,7 +658,8 @@ - end + center + True 1 0 @@ -673,7 +678,7 @@ - end + center 1 1 @@ -692,7 +697,7 @@ - end + center 1 2 @@ -716,6 +721,8 @@ + center + True 2 0