Redesign gamestate inspector window

This commit is contained in:
Celtic Minstrel 2016-08-20 02:49:57 -04:00
parent cef1674ce4
commit d5a78dfcd0
6 changed files with 822 additions and 805 deletions

View file

@ -17,6 +17,7 @@ Version 1.13.5+dev:
traits show up in the help as well.)
* Fix game map sometimes showing and buttons sometimes not rendered properly in story screen (bug #24553)
* Improved font rendering on Windows.
* Redesigned gamestate inspector window.
* WML Engine:
* Added {HAS_NO_TURN_LIMIT} macro for objectives
* New attributes for [message] with [option]

View file

@ -3,6 +3,30 @@
### 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"
[toggle_panel]
definition = "default"
id = "tree_view_node_label"
[grid]
{WML}
[/grid]
[/toggle_panel]
[/column]
[/row]
[/node_definition]
[/node]
#enddef
[window]
id = "gamestate_inspector"
description = "Gamestate inspector dialog."
@ -13,12 +37,17 @@
{GUI_WINDOW_FULLSCREEN}
[linked_group]
id = "name"
id = "unit_left"
fixed_width = "true"
[/linked_group]
[linked_group]
id = "typename"
id = "unit_mid"
fixed_width = "true"
[/linked_group]
[linked_group]
id = "unit_right"
fixed_width = "true"
[/linked_group]
@ -77,75 +106,17 @@
horizontal_alignment = "left"
[grid]
[row]
grow_factor=1
[column]
grow_factor = 1
border = "all"
border = "top,left,right"
border_size = 5
horizontal_grow = "true"
# wmlindent: start ignoring
{GUI_FORCE_WIDGET_MINIMUM_SIZE 150 "(as_decimal(screen_height) / 3)" (
# wmlindent: stop ignoring
[listbox]
id = "stuff_types_list"
horizontal_alignment = "left"
[label]
definition = "default"
horizontal_scrollbar_mode = "never"
vertical_scrollbar_mode = "auto"
[header]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "typename"
definition = "default"
linked_group = "typename"
label = _ "Type"
[/label]
[/column]
[/row]
[/header]
[list_definition]
[row]
[column]
vertical_grow = "true"
horizontal_grow = "true"
[toggle_panel]
definition = "default"
[grid]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "typename"
definition = "default"
linked_group = "typename"
[/label]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/listbox]
# wmlindent: start ignoring
)}
# wmlindent: stop ignoring
label = _ "Items"
[/label]
[/column]
[/row]
[row]
grow_factor=1
[column]
@ -153,63 +124,155 @@
border = "all"
border_size = 5
horizontal_grow = "false"
vertical_grow = "true"
# wmlindent: start ignoring
{GUI_FORCE_WIDGET_MINIMUM_SIZE 150 "(as_decimal(screen_height) * 2 / 3 - 200)" (
{GUI_FORCE_WIDGET_MINIMUM_SIZE 150 "(as_decimal(screen_height) * 0.8)" (
# wmlindent: stop ignoring
[listbox]
[tree_view]
id = "stuff_list"
definition = "default"
horizontal_scrollbar_mode = "never"
vertical_scrollbar_mode = "auto"
[header]
indentation_step_size = 15
{INSPECTOR_NODE "basic" (
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "name"
definition = "default"
linked_group = "name"
label = _ "Items"
[/label]
[/column]
[/row]
[/header]
[list_definition]
)}
{INSPECTOR_NODE "named_event" (
[row]
[column]
vertical_grow = "true"
horizontal_grow = "true"
[toggle_panel]
border = "left"
border_size = 5
horizontal_alignment = "left"
[label]
id = "name"
definition = "default"
[grid]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "name"
definition = "default"
linked_group = "name"
[/label]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/label]
[/column]
[/row]
[/list_definition]
[/listbox]
[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
@ -229,19 +292,50 @@
[grid]
[row]
[column]
#
# Emulate the listbox headers' top/bottom padding
# here relative to the scroll_label below.
#
border = "top,left,right"
border_size = 5
horizontal_alignment = "left"
horizontal_grow = true
grow_factor = 1
[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"

File diff suppressed because it is too large Load diff

View file

@ -27,9 +27,7 @@ public:
class model;
class view;
class controller;
explicit tgamestate_inspector(const vconfig& cfg);
std::shared_ptr<view> get_view();
tgamestate_inspector(const std::string& title = "");
private:
/** Inherited from tdialog. */
@ -37,8 +35,11 @@ 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_;
std::string title_;
};
}

View file

@ -1786,7 +1786,7 @@ void console_handler::do_show_var() {
void console_handler::do_inspect() {
vconfig cfg = vconfig::empty_vconfig();
gui2::tgamestate_inspector inspect_dialog(cfg);
gui2::tgamestate_inspector inspect_dialog;
inspect_dialog.show(menu_handler_.gui_->video());
}

View file

@ -742,7 +742,7 @@ int show_lua_console(lua_State * /*L*/, CVideo & video, lua_kernel_base * lk)
int show_gamestate_inspector(CVideo & video, const vconfig & cfg)
{
gui2::tgamestate_inspector inspect_dialog(cfg);
gui2::tgamestate_inspector inspect_dialog(cfg["name"]);
inspect_dialog.show(video);
return 0;
}