Gamestate Inspector: further design improvements
This commit is contained in:
parent
7cc7e70a83
commit
b672c24ccb
3 changed files with 320 additions and 329 deletions
|
@ -3,29 +3,43 @@
|
|||
### Definition of the window to control gamestate inspector.
|
||||
###
|
||||
|
||||
#define INSPECTOR_NODE ID WML
|
||||
[node]
|
||||
id = {ID}
|
||||
unfolded = true
|
||||
[node_definition]
|
||||
[row]
|
||||
[column]
|
||||
vertical_grow = "true"
|
||||
horizontal_grow = "true"
|
||||
#define _GUI_DOT_COLUMN
|
||||
[column]
|
||||
grow_factor = 0
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[toggle_panel]
|
||||
definition = "default"
|
||||
id = "tree_view_node_label"
|
||||
[grid]
|
||||
{WML}
|
||||
[/grid]
|
||||
[/toggle_panel]
|
||||
[/column]
|
||||
[/row]
|
||||
[/node_definition]
|
||||
[/node]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
[label]
|
||||
definition = "default_tiny"
|
||||
label = "•"
|
||||
[/label]
|
||||
[/column]
|
||||
#enddef
|
||||
|
||||
#define _GUI_INSPECTOR_NODE ID WML
|
||||
[node]
|
||||
id = {ID}
|
||||
unfolded = true
|
||||
[node_definition]
|
||||
[row]
|
||||
[column]
|
||||
vertical_grow = "true"
|
||||
horizontal_grow = "true"
|
||||
|
||||
[toggle_panel]
|
||||
definition = "default"
|
||||
id = "tree_view_node_label"
|
||||
[grid]
|
||||
{WML}
|
||||
[/grid]
|
||||
[/toggle_panel]
|
||||
[/column]
|
||||
[/row]
|
||||
[/node_definition]
|
||||
[/node]
|
||||
#enddef
|
||||
|
||||
[window]
|
||||
id = "gamestate_inspector"
|
||||
|
@ -60,327 +74,250 @@
|
|||
[/helptip]
|
||||
|
||||
[grid]
|
||||
[row] #header
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
horizontal_grow = "true"
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
definition = "title"
|
||||
label = _ "Gamestate Inspector"
|
||||
[/label]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
[label]
|
||||
id = "inspector_name"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[label]
|
||||
definition = "title"
|
||||
label = _ "Gamestate Inspector"
|
||||
[/label]
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row] #menu
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 7
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id="inspector_name"
|
||||
definition = "default"
|
||||
label= ""
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
|
||||
[row] #stack-title
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
vertical_alignment = "top"
|
||||
vertical_grow = "true"
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
vertical_alignment = "top"
|
||||
horizontal_alignment = "left"
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
border = "top,left,right"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_grow = "false"
|
||||
vertical_grow = "true"
|
||||
|
||||
[label]
|
||||
definition = "default"
|
||||
label = _ "Items"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
grow_factor=1
|
||||
[column]
|
||||
grow_factor = 1
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_grow = "false"
|
||||
vertical_grow = "true"
|
||||
# wmlindent: start ignoring
|
||||
{GUI_FORCE_WIDGET_MINIMUM_SIZE 150 "(as_decimal(screen_height) * 0.8)" (
|
||||
# wmlindent: stop ignoring
|
||||
[tree_view]
|
||||
id = "stuff_list"
|
||||
definition = "default"
|
||||
horizontal_scrollbar_mode = "never"
|
||||
vertical_scrollbar_mode = "auto"
|
||||
indentation_step_size = 15
|
||||
{INSPECTOR_NODE "basic" (
|
||||
[row]
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
{GUI_FORCE_WIDGET_MINIMUM_SIZE "(as_decimal(screen_width) / 4)" "(as_decimal(screen_height) * 0.8)" (
|
||||
[tree_view]
|
||||
id = "stuff_list"
|
||||
definition = "default"
|
||||
horizontal_scrollbar_mode = "never"
|
||||
vertical_scrollbar_mode = "always"
|
||||
indentation_step_size = 15
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
{_GUI_INSPECTOR_NODE "basic" (
|
||||
[row]
|
||||
{_GUI_DOT_COLUMN}
|
||||
|
||||
[label]
|
||||
id = "name"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
)}
|
||||
{INSPECTOR_NODE "named_event" (
|
||||
[row]
|
||||
[column]
|
||||
border = "left"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id = "name"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
border = "left"
|
||||
border_size = 15
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id = "id"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
)}
|
||||
{INSPECTOR_NODE "unit" (
|
||||
[row]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
[label]
|
||||
id = "loc"
|
||||
definition = "default"
|
||||
linked_group = "unit_left"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 6
|
||||
[label]
|
||||
id = "side"
|
||||
definition = "default"
|
||||
linked_group = "unit_mid"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 6
|
||||
[label]
|
||||
id = "leader"
|
||||
definition = "default"
|
||||
linked_group = "unit_right"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 10
|
||||
[label]
|
||||
id = "id"
|
||||
definition = "default"
|
||||
linked_group = "unit_left"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 6
|
||||
[label]
|
||||
id = "type"
|
||||
definition = "default"
|
||||
linked_group = "unit_mid"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 6
|
||||
[label]
|
||||
id = "traits"
|
||||
definition = "default"
|
||||
linked_group = "unit_right"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 10
|
||||
[label]
|
||||
id = "level"
|
||||
definition = "default"
|
||||
linked_group = "unit_left"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 6
|
||||
[label]
|
||||
id = "xp"
|
||||
definition = "default"
|
||||
linked_group = "unit_mid"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 6
|
||||
[label]
|
||||
id = "hp"
|
||||
definition = "default"
|
||||
linked_group = "unit_right"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
)}
|
||||
[/tree_view]
|
||||
# wmlindent: start ignoring
|
||||
)}
|
||||
# wmlindent: stop ignoring
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
[label]
|
||||
id = "name"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
)}
|
||||
|
||||
{_GUI_INSPECTOR_NODE "named_event" (
|
||||
[row]
|
||||
{_GUI_DOT_COLUMN}
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
border = "left"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id = "name"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
grow_factor = 0
|
||||
[spacer]
|
||||
definition = "default"
|
||||
[/spacer]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
border = "left,bottom"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id = "id"
|
||||
definition = "default_small"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
)}
|
||||
|
||||
{_GUI_INSPECTOR_NODE "unit" (
|
||||
[row]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left,top"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "loc"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_left"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left,top"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "side"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_mid"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left,top"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "leader"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_right"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "id"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_left"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "type"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_mid"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "traits"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_right"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left,bottom"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "level"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_left"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left,bottom"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "xp"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_mid"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
horizontal_alignment = "left"
|
||||
border = "left,bottom"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "hp"
|
||||
definition = "default_small"
|
||||
linked_group = "unit_right"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
)}
|
||||
[/tree_view]
|
||||
)}
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
vertical_alignment = "top"
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_grow = "true"
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
horizontal_grow = "true"
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
border = "top,left,right"
|
||||
border_size = 5
|
||||
horizontal_grow = true
|
||||
grow_factor = 1
|
||||
vertical_grow = "true"
|
||||
|
||||
[label]
|
||||
id = "content_title"
|
||||
definition = "default"
|
||||
label = _ "Contents"
|
||||
[/label]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "top,left,right"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[label]
|
||||
id = "page_count"
|
||||
definition = "default"
|
||||
[/label]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "top,left,right"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "page_left"
|
||||
definition = "left_arrow"
|
||||
[/button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "top,left,right"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "page_right"
|
||||
definition = "right_arrow"
|
||||
[/button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "top,left,right"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "copy"
|
||||
definition = "action_copy"
|
||||
label = _ "clipboard^Copy"
|
||||
# FIXME: tooltips cause weird interactions with map
|
||||
# labels while running a GUI2 dialog, so let's
|
||||
# not use a tooltip yet.
|
||||
#tooltip = _ "Copy this report to clipboard"
|
||||
[/button]
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
[/column]
|
||||
[/row]
|
||||
[row]
|
||||
[column]
|
||||
border = "left,bottom,right"
|
||||
border_size = 5
|
||||
horizontal_grow = "true"
|
||||
|
||||
[scroll_label]
|
||||
id = "inspect"
|
||||
definition = "verbatim"
|
||||
[/scroll_label]
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
[scroll_label]
|
||||
id = "inspect"
|
||||
definition = "verbatim"
|
||||
[/scroll_label]
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
[/grid]
|
||||
[/column]
|
||||
[/row]
|
||||
[row] #status
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
horizontal_grow = "true"
|
||||
|
||||
[grid]
|
||||
[row]
|
||||
|
@ -390,7 +327,24 @@
|
|||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[button]
|
||||
id = "copy"
|
||||
definition = "action_copy"
|
||||
label = _ "clipboard^Copy"
|
||||
# FIXME: tooltips cause weird interactions with map
|
||||
# labels while running a GUI2 dialog, so let's
|
||||
# not use a tooltip yet.
|
||||
#tooltip = _ "Copy this report to clipboard"
|
||||
[/button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
[button]
|
||||
id = "lua"
|
||||
definition = "default"
|
||||
|
@ -398,6 +352,43 @@
|
|||
[/button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "page_left"
|
||||
definition = "left_arrow"
|
||||
[/button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "page_right"
|
||||
definition = "right_arrow"
|
||||
[/button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_grow = "true"
|
||||
|
||||
[label]
|
||||
id = "page_count"
|
||||
definition = "default"
|
||||
text_alignment = "left"
|
||||
[/label]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
|
@ -416,3 +407,6 @@
|
|||
[/grid]
|
||||
[/resolution]
|
||||
[/window]
|
||||
|
||||
#undef _GUI_INSPECTOR_NODE
|
||||
#undef _GUI_DOT_COLUMN
|
||||
|
|
|
@ -112,12 +112,12 @@ public:
|
|||
}
|
||||
return data.substr(pages[which_page].first, pages[which_page].second);
|
||||
}
|
||||
|
||||
|
||||
void clear_data()
|
||||
{
|
||||
data.clear();
|
||||
}
|
||||
|
||||
|
||||
void set_data(const std::string& new_data)
|
||||
{
|
||||
data = new_data;
|
||||
|
@ -126,7 +126,7 @@ public:
|
|||
|
||||
int count_pages()
|
||||
{
|
||||
return std::max (static_cast<unsigned long> (pages.size()), 1ul);
|
||||
return std::max<int>(pages.size(), 1);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -182,14 +182,13 @@ class tgamestate_inspector::view
|
|||
public:
|
||||
view(twindow& window)
|
||||
: stuff_list_(find_widget<ttree_view>(&window, "stuff_list", false, true))
|
||||
, title_(find_widget<tcontrol>(&window, "content_title", false, true))
|
||||
, inspect_(find_widget<tcontrol>(&window, "inspect", false, true))
|
||||
, pages_(find_widget<tcontrol>(&window, "page_count", false, true))
|
||||
, left_(find_widget<tcontrol>(&window, "page_left", false, true))
|
||||
, right_(find_widget<tcontrol>(&window, "page_right", false, true))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
stuff_list_adder stuff_list_entry(ttree_view_node* parent, const std::string defn)
|
||||
{
|
||||
return stuff_list_adder(parent ? *parent : stuff_list_->get_root_node(), defn);
|
||||
|
@ -199,7 +198,6 @@ public:
|
|||
{
|
||||
int n_pages = m.count_pages();
|
||||
current_page_ = std::min(n_pages - 1, std::max(0, current_page_));
|
||||
title_->set_label(m.name);
|
||||
inspect_->set_label(m.get_data_paged(current_page_));
|
||||
if(n_pages > 1) {
|
||||
std::ostringstream out;
|
||||
|
@ -221,7 +219,7 @@ public:
|
|||
left_->set_visible(twidget::tvisible::invisible);
|
||||
right_->set_visible(twidget::tvisible::invisible);
|
||||
}
|
||||
|
||||
|
||||
void page(int where)
|
||||
{
|
||||
current_page_ += where;
|
||||
|
@ -230,7 +228,6 @@ public:
|
|||
private:
|
||||
int current_page_ = 0;
|
||||
ttree_view* stuff_list_;
|
||||
tcontrol* title_;
|
||||
tcontrol* inspect_;
|
||||
tcontrol* pages_;
|
||||
tcontrol* left_;
|
||||
|
@ -375,7 +372,7 @@ public:
|
|||
view_.page(next ? 1 : -1);
|
||||
view_.update(model_);
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
T& get_controller()
|
||||
{
|
||||
|
@ -388,14 +385,14 @@ public:
|
|||
controllers.push_back(p);
|
||||
return *p;
|
||||
}
|
||||
|
||||
|
||||
template<typename C>
|
||||
void set_node_callback(const std::vector<int>& node_path, void (C::* fcn)(ttree_view_node&))
|
||||
{
|
||||
C& sub_controller = get_controller<C>();
|
||||
callbacks.emplace(node_path, std::bind(fcn, sub_controller, _1));
|
||||
}
|
||||
|
||||
|
||||
template<typename C, typename T>
|
||||
void set_node_callback(const std::vector<int>& node_path, void (C::* fcn)(ttree_view_node&, T), T param)
|
||||
{
|
||||
|
@ -443,7 +440,7 @@ public:
|
|||
|
||||
build_stuff_list(window);
|
||||
}
|
||||
|
||||
|
||||
void build_stuff_list(twindow& window)
|
||||
{
|
||||
set_node_callback(
|
||||
|
@ -495,7 +492,7 @@ private:
|
|||
std::vector<single_mode_controller*> controllers;
|
||||
node_callback_map callbacks;
|
||||
};
|
||||
|
||||
|
||||
tgamestate_inspector::model& single_mode_controller::model() {
|
||||
return c.model_;
|
||||
}
|
||||
|
@ -528,7 +525,7 @@ void variable_mode_controller::show_list(ttree_view_node& node)
|
|||
|
||||
std::ostringstream cur_str;
|
||||
cur_str << "[" << c.key << "][" << wml_array_sizes[c.key] << "]";
|
||||
|
||||
|
||||
this->c.set_node_callback(
|
||||
view().stuff_list_entry(&node, "basic")
|
||||
.widget("name", cur_str.str())
|
||||
|
@ -619,7 +616,7 @@ static stuff_list_adder add_unit_entry(stuff_list_adder& progress, const unit& u
|
|||
s.str("");
|
||||
s << "L" << u.level();
|
||||
progress.widget("level", s.str());
|
||||
|
||||
|
||||
s.str("");
|
||||
s << u.experience() << '/' << u.max_experience() << " xp";
|
||||
progress.widget("xp", s.str());
|
||||
|
@ -629,7 +626,7 @@ static stuff_list_adder add_unit_entry(stuff_list_adder& progress, const unit& u
|
|||
progress.widget("hp", s.str());
|
||||
|
||||
progress.widget("traits", utils::join(u.get_traits_list(), ", "));
|
||||
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
@ -783,8 +780,8 @@ void team_mode_controller::show_units(ttree_view_node&, int side)
|
|||
|
||||
s << "\nid=\"" << i->id() << "\" (" << i->type_id() << ")\n"
|
||||
<< "L" << i->level() << "; " << i->experience() << '/'
|
||||
<< i->max_experience() << " xp; " << i->hitpoints() << '/'
|
||||
<< i->max_hitpoints() << " hp\n";
|
||||
<< i->max_experience() << " XP; " << i->hitpoints() << '/'
|
||||
<< i->max_hitpoints() << " HP\n";
|
||||
for(const auto & str : i->get_traits_list())
|
||||
{
|
||||
s << "\t" << str << std::endl;
|
||||
|
|
|
@ -35,7 +35,7 @@ private:
|
|||
|
||||
/** Inherited from tdialog, implemented by REGISTER_DIALOG. */
|
||||
virtual const std::string& window_id() const;
|
||||
|
||||
|
||||
std::shared_ptr<view> view_;
|
||||
std::shared_ptr<model> model_;
|
||||
std::shared_ptr<controller> controller_;
|
||||
|
|
Loading…
Add table
Reference in a new issue