Moved chatbox code to its own file and updates schema

This commit is contained in:
Charles Dang 2016-09-09 07:47:02 +11:00
parent 8e8cbfb5d2
commit 765f0bfc6a
3 changed files with 210 additions and 171 deletions

View file

@ -837,6 +837,21 @@
super="generic/state"
[/tag]
[/tag]
[/tag]
[tag]
name="mp_chatbox_definition"
min="0"
max="-1"
super="generic/widget_definition"
[tag]
name="resolution"
min="0"
max="-1"
super="gui/panel_definition/resolution"
[link]
name="gui/window/resolution/grid"
[/link]
[/tag]
[/tag]
[tag]
name="multi_page_definition"
@ -1728,6 +1743,18 @@
max="-1"
super="generic/widget_instance"
[/tag]
[tag]
name="mp_chatbox"
min="0"
max="-1"
super="generic/widget_instance"
[tag]
name="definition"
min="0"
max="1"
super="gui/window/resolution/grid"
[/tag]
[/tag]
[tag]
name="multi_page"
min="0"

183
data/gui/widget/chatbox.cfg Normal file
View file

@ -0,0 +1,183 @@
#textdomain wesnoth-lib
###
### Definition of a chat area.
###
#define _GUI_ROOM_TAB_BAR
[horizontal_listbox]
id = "room_list"
definition = "default"
horizontal_scrollbar_mode = "never"
[header]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "room"
definition = "default"
label = _ "Rooms"
[/label]
[/column]
[/row]
[/header]
[list_definition]
[row]
[column]
horizontal_grow = "true"
[toggle_panel]
definition = "default"
[grid]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "room"
definition = "default_small"
[/label]
[/column]
[column]
grow_factor = 0
border = "left"
border_size = 5
[image]
definition = "default"
id = "pending_messages"
label = "lobby/sort-friend.png"
tooltip = _"Messages waiting"
[/image]
[/column]
[column]
grow_factor = 0
horizontal_alignment = "right"
border = "right"
border_size = 5
[button]
id = "close_window"
definition = "close"
label = _ "Close"
[/button]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/horizontal_listbox]
#enddef
#define _GUI_CHATLOG
[multi_page]
id = "chat_log_container"
definition = "default"
horizontal_scrollbar_mode = "never"
[page_definition]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
border = "left,right"
border_size = 5
[scroll_label]
id = "log_text"
definition = "description"
vertical_scrollbar_mode = "always"
horizontal_scrollbar_mode = "never"
[/scroll_label]
[/column]
[/row]
[/page_definition]
[/multi_page]
#enddef
[mp_chatbox_definition]
id = "default"
description = "Mp chatbox"
[resolution]
min_width = 0
min_height = 0
default_width = 0
default_height = 0
max_width = 0
max_height = 0
[background]
[draw]
[/draw]
[/background]
[foreground]
[draw]
[/draw]
[/foreground]
[grid]
[row]
grow_factor = 0
[column]
horizontal_alignment = "left"
border = "left,top,right"
border_size = 5
{_GUI_ROOM_TAB_BAR}
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
{_GUI_CHATLOG}
[/column]
[/row]
[row]
grow_factor = 0
[column]
horizontal_grow = "true"
vertical_alignment = "bottom"
border = "left,right,bottom"
border_size = 5
[text_box]
id = "chat_input"
definition = "default"
history = "mp_chat_input_history"
[/text_box]
[/column]
[/row]
[/grid]
[/resolution]
[/mp_chatbox_definition]
#undef _GUI_ROOM_TAB_BAR
#undef _GUI_CHATLOG

View file

@ -452,102 +452,6 @@
[/grid]
#enddef
#define ROOMLISTBOX
[horizontal_listbox]
id = "room_list"
definition = "default"
horizontal_scrollbar_mode = "never"
[header]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "room"
definition = "default"
label = _ "Rooms"
[/label]
[/column]
[/row]
[/header]
[list_definition]
[row]
[column]
horizontal_grow = "true"
[toggle_panel]
definition = "default"
[grid]
[row]
[column]
grow_factor = 1
horizontal_grow = "true"
border = "all"
border_size = 5
[label]
id = "room"
definition = "default_small"
[/label]
[/column]
[column]
grow_factor = 0
border = "left"
border_size = 5
[image]
definition = "default"
id = "pending_messages"
label = "lobby/sort-friend.png"
tooltip = _"Messages waiting"
[/image]
[/column]
[column]
grow_factor = 0
horizontal_alignment = "right"
border = "right"
border_size = 5
[button]
id = "close_window"
definition = "close"
label = _ "Close"
[/button]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[/horizontal_listbox]
#enddef
#define CHATLOG
[multi_page]
id = "chat_log_container"
definition = "default"
horizontal_scrollbar_mode = "never"
[page_definition]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
border = "left,right"
border_size = 5
[scroll_label]
id = "log_text"
definition = "description"
vertical_scrollbar_mode = "always"
horizontal_scrollbar_mode = "never"
[/scroll_label]
[/column]
[/row]
[/page_definition]
[/multi_page]
#enddef
#define _GUI_FILTER_AREA
[grid]
[row]
@ -614,42 +518,6 @@
[/grid]
#enddef
#define _GUI_CHAT_AREA
[grid]
[row]
grow_factor = 0
[column]
horizontal_alignment = "left"
border = "left,top,right"
border_size = 5
{ROOMLISTBOX}
[/column]
[/row]
[row]
grow_factor = 1
[column]
horizontal_grow = "true"
vertical_grow = "true"
{CHATLOG}
[/column]
[/row]
[row]
grow_factor = 0
[column]
horizontal_grow = "true"
vertical_alignment = "bottom"
border = "left,right,bottom"
border_size = 5
[text_box]
id = "chat_input"
definition = "default"
history = "mp_chat_input_history"
[/text_box]
[/column]
[/row]
[/grid]
#enddef
#define _GUI_CONTROL_AREA
[grid]
[row]
@ -1064,46 +932,7 @@
[/resolution]
[/window]
[mp_chatbox_definition]
id = "default"
description = "Mp chatbox"
[resolution]
min_width = 0
min_height = 0
default_width = 0
default_height = 0
max_width = 0
max_height = 0
[background]
[draw]
[/draw]
[/background]
[foreground]
[draw]
[/draw]
[/foreground]
{_GUI_CHAT_AREA}
[/resolution]
[/mp_chatbox_definition]
#undef _GUI_CONTROL_AREA
#undef _GUI_CHAT_AREA
#undef _GUI_FILTER_AREA
#undef CHATLOG
#undef GAMELISTBOX
#undef PLAYERLISTBOX
#undef ROOMLISTBOX