Compare commits
3 commits
a2bd12c993
...
8a91b47152
| Author | SHA1 | Date | |
|---|---|---|---|
|
8a91b47152 |
|||
|
5cadda6b97 |
|||
|
97d57bae7a |
3 changed files with 32 additions and 9 deletions
|
|
@ -206,6 +206,10 @@ namespace gui_to_app {
|
|||
app_builder
|
||||
};
|
||||
|
||||
damage_label = app_builder->get_widget<Gtk::Label>("label_degat");
|
||||
armor_label = app_builder->get_widget<Gtk::Label>("label_armure");
|
||||
critic_label = app_builder->get_widget<Gtk::Label>("label_critique");
|
||||
|
||||
debug_button->signal_clicked().connect(sigc::mem_fun(*this, &AppWin2Back::debug_button_clicked), false);
|
||||
}
|
||||
|
||||
|
|
@ -225,7 +229,7 @@ namespace gui_to_app {
|
|||
|
||||
static void convert_to_label(std::array<char, 10> &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 +248,13 @@ namespace gui_to_app {
|
|||
const std::string_view short_name,
|
||||
const CaracInterface<Gtk::Label> &labels) noexcept {
|
||||
std::array<char, 10> 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<std::int32_t>(charac.get_base()),
|
||||
labels.base);
|
||||
convert_to_label(convert,
|
||||
std::format("carac {}", short_name),
|
||||
charac.get_carac(),
|
||||
static_cast<std::int32_t>(charac.get_carac()),
|
||||
labels.carac);
|
||||
convert_to_label(convert,
|
||||
std::format("materiel {}", short_name),
|
||||
|
|
@ -264,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<char, 10> convert{ '\0' };
|
||||
convert_to_label(convert, "damage", static_cast<std::int32_t>(sheet.get_damage()), damage_label);
|
||||
convert_to_label(convert, "armor", static_cast<std::int32_t>(sheet.get_armor()), armor_label);
|
||||
convert_to_label(convert, "critic", static_cast<std::int32_t>(sheet.get_critique()), critic_label);
|
||||
}
|
||||
|
||||
bool AppWin2Back::insert_obj(const character::billyEnums &obj) noexcept {
|
||||
|
|
|
|||
|
|
@ -108,6 +108,10 @@ namespace gui_to_app {
|
|||
|
||||
CaracInterface<Gtk::Label> luck_labels;
|
||||
|
||||
Gtk::Label *damage_label{ nullptr };
|
||||
Gtk::Label *armor_label{ nullptr };
|
||||
Gtk::Label *critic_label{ nullptr };
|
||||
|
||||
Gtk::Button *debug_button{ nullptr };
|
||||
|
||||
std::array<SwitchSignalHelper, 12> signal_handlers{
|
||||
|
|
|
|||
19
window_ui.ui
19
window_ui.ui
|
|
@ -536,6 +536,7 @@
|
|||
<object class="GtkGrid">
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
|
|
@ -549,7 +550,8 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="adresse_label_base">
|
||||
<property name="halign">end</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">0</property>
|
||||
|
|
@ -568,7 +570,7 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="adresse_label_carac">
|
||||
<property name="halign">end</property>
|
||||
<property name="halign">center</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">1</property>
|
||||
|
|
@ -587,7 +589,7 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="adresse_label_materiel">
|
||||
<property name="halign">end</property>
|
||||
<property name="halign">center</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">2</property>
|
||||
|
|
@ -611,6 +613,8 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="adresse_label_total">
|
||||
<property name="halign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">0</property>
|
||||
|
|
@ -654,7 +658,8 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="chance_label_base">
|
||||
<property name="halign">end</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">0</property>
|
||||
|
|
@ -673,7 +678,7 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="chance_label_carac">
|
||||
<property name="halign">end</property>
|
||||
<property name="halign">center</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">1</property>
|
||||
|
|
@ -692,7 +697,7 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="chance_label_materiel">
|
||||
<property name="halign">end</property>
|
||||
<property name="halign">center</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">2</property>
|
||||
|
|
@ -716,6 +721,8 @@
|
|||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="chance_label_total">
|
||||
<property name="halign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">0</property>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue