mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-15 17:54:57 +00:00
UI : About dialog (#8803)
* Redesigned the version dialog to serve as a general purpose About dialog. * Credits button removed from title screen * Moved community dialog contents to about dialog as new tab Co-Authored-By: Pentarctagon * Bugfixes to the tab_container widget * Success indication mechanism on copy buttons
This commit is contained in:
parent
8d5ca809f4
commit
92d66554dd
|
@ -7,7 +7,6 @@ test_gui2/modal_dialog_test_addon_license_prompt
|
|||
test_gui2/modal_dialog_test_campaign_difficulty
|
||||
test_gui2/modal_dialog_test_chat_log
|
||||
test_gui2/modal_dialog_test_editor_choose_addon
|
||||
test_gui2/modal_dialog_test_community_dialog
|
||||
test_gui2/modal_dialog_test_core_selection
|
||||
test_gui2/modal_dialog_test_custom_tod
|
||||
test_gui2/modal_dialog_test_depcheck_confirm_change
|
||||
|
|
|
@ -17361,6 +17361,7 @@ Date,File,License,Author - Real Name(other name);Real Name(other name);etc,Notes
|
|||
2019/01/01,images/icons/action/close_25.png,GNU GPL v2+,Emilien Rotival(LordBob),,,0d1ac037312ab9156350f62e6b5fb64c
|
||||
2019/01/01,images/icons/action/copy_25-active.png,GNU GPL v2+,Iris Morelle(Iris),,,5bd2ce4c46c9cd0756a452b94a1863e2
|
||||
2019/01/01,images/icons/action/copy_25-pressed.png,GNU GPL v2+,Iris Morelle(Iris),,,40629fe91598d11e4a23c69e3b6223ab
|
||||
2024/05/11,images/icons/action/copy_25-success.png,GNU GPL v2+,Subhraman Sarkar(babaissarkar),,,06361a3891a718ed1ae10ecc2397fc6f
|
||||
2019/01/01,images/icons/action/copy_25.png,GNU GPL v2+,Iris Morelle(Iris),,,bfe5261f9492119071b9554ec692f019
|
||||
2013/05/26,images/icons/action/delete_25-active.png,GNU GPL v2+,Emilien Rotival(LordBob),,,fa813b7933e4e1d40eba137d7b7898c3
|
||||
2013/05/26,images/icons/action/delete_25-pressed.png,GNU GPL v2+,Emilien Rotival(LordBob),,,2baf7e274266d7d1d5e5736e66b04c3e
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -228,14 +228,6 @@
|
|||
|
||||
# Action icon buttons
|
||||
|
||||
{_GUI_DEFINITION
|
||||
"action_copy"
|
||||
"Right arrow button for copy-to-clipboard."
|
||||
"buttons/button_square/button_square_25"
|
||||
"icons/action/copy_25"
|
||||
()
|
||||
}
|
||||
|
||||
{_GUI_DEFINITION
|
||||
"action_go"
|
||||
"Right arrow button for go/browse actions."
|
||||
|
|
272
data/gui/widget/button_success.cfg
Normal file
272
data/gui/widget/button_success.cfg
Normal file
|
@ -0,0 +1,272 @@
|
|||
#textdomain wesnoth-lib
|
||||
###
|
||||
### buttons with success indication
|
||||
###
|
||||
|
||||
#define _GUI_STATE BACKGROUND_IMAGE BORDER_COLOR BORDER_COLOR_DARK HIGHLIGHT_LINE_COLOR IPF
|
||||
{GUI__BUTTON_NORMAL_FRAME buttons/button_normal/{BACKGROUND_IMAGE}
|
||||
({BORDER_COLOR})
|
||||
({BORDER_COLOR_DARK})
|
||||
({HIGHLIGHT_LINE_COLOR})
|
||||
({IPF})
|
||||
}
|
||||
#enddef
|
||||
|
||||
#define _GUI_RESOLUTION RESOLUTION SIZE IMAGE IMAGE_OVERLAY IPF
|
||||
[resolution]
|
||||
|
||||
{RESOLUTION}
|
||||
|
||||
min_width = {SIZE}
|
||||
min_height = {SIZE}
|
||||
|
||||
default_width = {SIZE}
|
||||
default_height = {SIZE}
|
||||
|
||||
max_width = {SIZE}
|
||||
max_height = {SIZE}
|
||||
|
||||
[state_enabled]
|
||||
|
||||
[draw]
|
||||
|
||||
[image]
|
||||
w = "(width)"
|
||||
h = "(height)"
|
||||
name = {IMAGE} + ".png{IPF}"
|
||||
[/image]
|
||||
|
||||
[image]
|
||||
{GUI_CENTERED_IMAGE}
|
||||
|
||||
name = {IMAGE_OVERLAY} + ".png{IPF}"
|
||||
[/image]
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
|
||||
[draw]
|
||||
|
||||
[image]
|
||||
w = "(width)"
|
||||
h = "(height)"
|
||||
name = {IMAGE} + ".png~GS(){IPF}"
|
||||
[/image]
|
||||
|
||||
[image]
|
||||
{GUI_CENTERED_IMAGE}
|
||||
|
||||
name = {IMAGE_OVERLAY} + ".png~GS(){IPF}"
|
||||
[/image]
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_disabled]
|
||||
|
||||
[state_pressed]
|
||||
|
||||
[draw]
|
||||
|
||||
[image]
|
||||
w = {SIZE}
|
||||
h = {SIZE}
|
||||
name = {IMAGE} + "-pressed.png{IPF}"
|
||||
[/image]
|
||||
|
||||
[image]
|
||||
{GUI_CENTERED_IMAGE}
|
||||
|
||||
name = {IMAGE_OVERLAY} + "-pressed.png{IPF}"
|
||||
[/image]
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_pressed]
|
||||
|
||||
[state_focused]
|
||||
|
||||
[draw]
|
||||
|
||||
[image]
|
||||
w = "(width)"
|
||||
h = "(height)"
|
||||
name = {IMAGE} + "-active.png{IPF}"
|
||||
[/image]
|
||||
|
||||
[image]
|
||||
{GUI_CENTERED_IMAGE}
|
||||
|
||||
name = {IMAGE_OVERLAY} + "-active.png{IPF}"
|
||||
[/image]
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_focused]
|
||||
|
||||
[state_success]
|
||||
|
||||
[draw]
|
||||
|
||||
[image]
|
||||
w = "(width)"
|
||||
h = "(height)"
|
||||
name = {IMAGE} + ".png{IPF}"
|
||||
[/image]
|
||||
|
||||
[image]
|
||||
{GUI_CENTERED_IMAGE}
|
||||
|
||||
name = {IMAGE_OVERLAY} + "-success.png{IPF}"
|
||||
[/image]
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_success]
|
||||
|
||||
[/resolution]
|
||||
#enddef
|
||||
|
||||
#define _GUI_DEFINITION ID DESCRIPTION IMAGE IMAGE_OVERLAY IPF
|
||||
[button_definition]
|
||||
id = {ID}
|
||||
description = {DESCRIPTION}
|
||||
|
||||
{_GUI_RESOLUTION () 25 ({IMAGE}) ({IMAGE_OVERLAY}) ({IPF})}
|
||||
|
||||
[/button_definition]
|
||||
|
||||
#enddef
|
||||
|
||||
{_GUI_DEFINITION
|
||||
"action_copy"
|
||||
"Right arrow button for copy-to-clipboard."
|
||||
"buttons/button_square/button_square_25"
|
||||
"icons/action/copy_25"
|
||||
()
|
||||
}
|
||||
|
||||
# Text only copy button with success indication
|
||||
|
||||
#define _GUI_BUTTON_TEXT TEXT FONT_SIZE FONT_STYLE FONT_COLOR
|
||||
[text]
|
||||
x = {GUI__TEXT_HORIZONTALLY_CENTRED}
|
||||
y = "(max((height - text_height - 2) / 2, 0))"
|
||||
w = "(text_width)"
|
||||
h = "(text_height)"
|
||||
font_size = {FONT_SIZE}
|
||||
font_style = {FONT_STYLE}
|
||||
color = {FONT_COLOR}
|
||||
text = {TEXT}
|
||||
text_markup = "(text_markup)"
|
||||
[/text]
|
||||
#enddef
|
||||
|
||||
#define _GUI_RESOLUTION_COPY RESOLUTION MIN_WIDTH DEFAULT_WIDTH HEIGHT EXTRA_WIDTH EXTRA_HEIGHT FONT_SIZE IPF ALPHA
|
||||
[resolution]
|
||||
|
||||
{RESOLUTION}
|
||||
|
||||
min_width = {MIN_WIDTH}
|
||||
min_height = {HEIGHT}
|
||||
|
||||
default_width = {DEFAULT_WIDTH}
|
||||
default_height = {HEIGHT}
|
||||
|
||||
max_width = 0
|
||||
max_height = {HEIGHT}
|
||||
|
||||
text_extra_width = {EXTRA_WIDTH}
|
||||
text_extra_height = {EXTRA_HEIGHT}
|
||||
text_font_size = {FONT_SIZE}
|
||||
|
||||
[state_enabled]
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_STATE "background"
|
||||
({GUI__BORDER_COLOR ALPHA={ALPHA}})
|
||||
({GUI__BORDER_COLOR_DARK ALPHA={ALPHA}}) ("21, 79, 109, 255") {IPF}}
|
||||
|
||||
{_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_STATE "background"
|
||||
({GUI__FONT_COLOR_DISABLED__DEFAULT ALPHA={ALPHA}})
|
||||
("89, 89, 89, {ALPHA}")
|
||||
("60, 60, 60, 255") "~GS(){IPF}"}
|
||||
|
||||
{_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) () ({GUI__FONT_COLOR_DISABLED__TITLE})}
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_disabled]
|
||||
|
||||
[state_pressed]
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_STATE "background-pressed"
|
||||
({GUI__BORDER_COLOR ALPHA={ALPHA}})
|
||||
({GUI__BORDER_COLOR_DARK ALPHA={ALPHA}}) ("1, 10, 16, 255") {IPF}}
|
||||
|
||||
{_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_pressed]
|
||||
|
||||
[state_focused]
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_STATE "background-active"
|
||||
({GUI__BORDER_COLOR ALPHA={ALPHA}})
|
||||
({GUI__BORDER_COLOR_DARK ALPHA={ALPHA}}) ("12, 108, 157, 255") {IPF}}
|
||||
|
||||
{_GUI_BUTTON_TEXT (_"page^Copy") ({FONT_SIZE}) () ({GUI__FONT_COLOR_ENABLED__TITLE})}
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_focused]
|
||||
|
||||
[state_success]
|
||||
|
||||
[draw]
|
||||
|
||||
{_GUI_STATE "background"
|
||||
({GUI__BORDER_COLOR ALPHA={ALPHA}})
|
||||
({GUI__BORDER_COLOR_DARK ALPHA={ALPHA}}) ("21, 79, 109, 255") {IPF}}
|
||||
|
||||
{_GUI_BUTTON_TEXT (_"page^✔ Copied") ({FONT_SIZE}) () ("0, 255, 0, 255")}
|
||||
|
||||
[/draw]
|
||||
|
||||
[/state_success]
|
||||
|
||||
[/resolution]
|
||||
#enddef
|
||||
|
||||
[button_definition]
|
||||
|
||||
id = "copy"
|
||||
description = "Text only copy button with success indication"
|
||||
|
||||
{_GUI_RESOLUTION_COPY () 40 112 26 13 4 16 () 255}
|
||||
|
||||
[/button_definition]
|
||||
|
||||
#undef _GUI_STATE
|
||||
#undef _GUI_BUTTON_TEXT
|
||||
#undef _GUI_RESOLUTION
|
||||
#undef _GUI_RESOLUTION_COPY
|
||||
#undef _GUI_DEFINITION
|
|
@ -130,6 +130,19 @@
|
|||
|
||||
[/button_definition]
|
||||
|
||||
[button_definition]
|
||||
|
||||
id = "titlescreen_about"
|
||||
description = "General information about Battle for Wesnoth."
|
||||
|
||||
{_GUI_RESOLUTION () 40 80 16 43 14 ({_GUI_BUTTON_FONT_SIZE}) icons/action/about_25 () 255}
|
||||
{_GUI_RESOLUTION ({GUI_BIG_RESOLUTION})
|
||||
50 80 20 46 16
|
||||
({GUI_SCALE_RESOLUTION {_GUI_BUTTON_FONT_SIZE}})
|
||||
icons/action/about_25 () 255}
|
||||
|
||||
[/button_definition]
|
||||
|
||||
#undef _GUI_RESOLUTION
|
||||
#undef _GUI_BUTTON_ICON
|
||||
#undef _GUI_BUTTON_TEXT
|
||||
|
|
|
@ -119,6 +119,8 @@
|
|||
{_GUI_DEFINITION "bad" "regular red label" () DEFAULT () BAD }
|
||||
{_GUI_DEFINITION "bad_small" "small red label" () SMALL () BAD }
|
||||
|
||||
{_GUI_DEFINITION "title_script" "label used for titles, script font" "script" HUGE () TITLE }
|
||||
|
||||
{_GUI_DEFINITION "monospace" "fixed width scroll label" monospace DEFAULT () DEFAULT }
|
||||
|
||||
#undef _GUI_SCALE_RES SIZE
|
||||
|
|
|
@ -148,6 +148,185 @@
|
|||
[/resolution]
|
||||
#enddef
|
||||
|
||||
#define _GUI_RESOLUTION_NO_RIGHT_BORDER RESOLUTION FONT_SIZE FONT_STYLE FONT_COLOR_ENABLED FONT_COLOR_DISABLED
|
||||
[resolution]
|
||||
|
||||
{RESOLUTION}
|
||||
|
||||
min_width = 0
|
||||
min_height = 0
|
||||
|
||||
default_width = 0
|
||||
default_height = 0
|
||||
|
||||
max_width = 0
|
||||
max_height = 0
|
||||
|
||||
text_font_size = {FONT_SIZE}
|
||||
text_font_style = {FONT_STYLE}
|
||||
|
||||
[state_enabled]
|
||||
|
||||
[draw]
|
||||
[rectangle]
|
||||
x = 0
|
||||
y = 0
|
||||
w = "(width)"
|
||||
h = "(height)"
|
||||
|
||||
border_thickness = 0
|
||||
border_color = "16, 22, 35, 255"
|
||||
|
||||
fill_color = "0, 0, 0, 137"
|
||||
[/rectangle]
|
||||
[line]
|
||||
x1 = 1
|
||||
y1 = 1
|
||||
x2 = "(width)"
|
||||
y2 = 1
|
||||
|
||||
color = {GUI__BORDER_COLOR_DARK}
|
||||
thickness = 4
|
||||
[/line]
|
||||
[line]
|
||||
x1 = "(width)"
|
||||
y1 = "(height-2)"
|
||||
x2 = 1
|
||||
y2 = "(height-2)"
|
||||
|
||||
color = {GUI__BORDER_COLOR_DARK}
|
||||
thickness = 4
|
||||
[/line]
|
||||
[line]
|
||||
x1 = 1
|
||||
y1 = 1
|
||||
x2 = 1
|
||||
y2 = "(height-2)"
|
||||
|
||||
color = {GUI__BORDER_COLOR_DARK}
|
||||
thickness = 4
|
||||
[/line]
|
||||
[/draw]
|
||||
|
||||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
[/state_disabled]
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = true
|
||||
vertical_alignment = "top"
|
||||
|
||||
[grid]
|
||||
id = "_header_grid"
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
|
||||
[spacer]
|
||||
[/spacer]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = true # needed ?
|
||||
vertical_grow = true # needed ?
|
||||
|
||||
[grid]
|
||||
id = "_content_grid"
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
horizontal_grow = true
|
||||
vertical_grow = true
|
||||
|
||||
[grid]
|
||||
id = "_list_grid"
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
|
||||
{GUI__VERTICAL_SCROLLBAR_GRID}
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = true
|
||||
vertical_alignment = "bottom"
|
||||
|
||||
[grid]
|
||||
id = "_footer_grid"
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
|
||||
[spacer]
|
||||
[/spacer]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
|
||||
|
||||
{GUI__HORIZONTAL_SCROLLBAR_GRID}
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
|
||||
[spacer]
|
||||
[/spacer]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/resolution]
|
||||
#enddef
|
||||
|
||||
[listbox_definition]
|
||||
id = "default"
|
||||
description = "Default listbox."
|
||||
|
@ -162,6 +341,20 @@
|
|||
|
||||
[/listbox_definition]
|
||||
|
||||
[listbox_definition]
|
||||
id = "box_display_no_right"
|
||||
description = "Default listbox, border on all sides except right. To be used as left side tab."
|
||||
|
||||
{_GUI_RESOLUTION_NO_RIGHT_BORDER
|
||||
()
|
||||
({GUI_FONT_SIZE_DEFAULT})
|
||||
()
|
||||
({GUI__FONT_COLOR_ENABLED__DEFAULT})
|
||||
({GUI__FONT_COLOR_DISABLED__DEFAULT})
|
||||
}
|
||||
|
||||
[/listbox_definition]
|
||||
|
||||
[horizontal_listbox_definition]
|
||||
id = "default"
|
||||
description = "Default horizontal listbox."
|
||||
|
|
130
data/gui/widget/tab_container_bordered.cfg
Normal file
130
data/gui/widget/tab_container_bordered.cfg
Normal file
|
@ -0,0 +1,130 @@
|
|||
#textdomain wesnoth-lib
|
||||
###
|
||||
### Definition of a tabbed container
|
||||
### A widget that has multiple pages and a list of available pages (tabs)
|
||||
### When an item is selected from the list, the corresponding page is shown
|
||||
###
|
||||
|
||||
[tab_container_definition]
|
||||
id = "left_tabs"
|
||||
description = "tab container with tabs on left, bordered contents."
|
||||
|
||||
[resolution]
|
||||
|
||||
min_width = 0
|
||||
min_height = 0
|
||||
|
||||
default_width = 0
|
||||
default_height = 0
|
||||
|
||||
max_width = 0
|
||||
max_height = 0
|
||||
|
||||
[linked_group]
|
||||
id = "page_icon"
|
||||
fixed_width = true
|
||||
fixed_height = true
|
||||
[/linked_group]
|
||||
|
||||
[linked_group]
|
||||
id = "page_label"
|
||||
fixed_width = true
|
||||
[/linked_group]
|
||||
|
||||
[state_enabled]
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
[/state_enabled]
|
||||
|
||||
[state_disabled]
|
||||
|
||||
[draw]
|
||||
[/draw]
|
||||
|
||||
[/state_disabled]
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
horizontal_grow = true
|
||||
vertical_grow = true
|
||||
|
||||
[grid]
|
||||
id = "_content_grid"
|
||||
|
||||
[row]
|
||||
[column]
|
||||
vertical_alignment = "top"
|
||||
|
||||
[listbox]
|
||||
id = "_tab_list"
|
||||
definition = "box_display_no_right"
|
||||
horizontal_scrollbar_mode = "never"
|
||||
[list_definition]
|
||||
[row]
|
||||
[column]
|
||||
vertical_grow = true
|
||||
horizontal_grow = true
|
||||
[toggle_panel]
|
||||
definition = "fancy"
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
grow_factor = 0
|
||||
horizontal_alignment = "left"
|
||||
border = "all"
|
||||
border_size = 5
|
||||
[image]
|
||||
id = "image"
|
||||
definition = "default"
|
||||
linked_group = "page_icon"
|
||||
[/image]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = true
|
||||
border = "all"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "name"
|
||||
definition = "default"
|
||||
linked_group = "page_label"
|
||||
[/label]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
[spacer]
|
||||
width = 15
|
||||
[/spacer]
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
[/toggle_panel]
|
||||
[/column]
|
||||
[/row]
|
||||
[/list_definition]
|
||||
[/listbox]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
[grid]
|
||||
id = "_page"
|
||||
[/grid]
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/resolution]
|
||||
|
||||
[/tab_container_definition]
|
|
@ -1,184 +0,0 @@
|
|||
[window]
|
||||
id = "community_dialog"
|
||||
description = "Dialog for links to different places related to Wesnoth's community"
|
||||
|
||||
[resolution]
|
||||
definition = "default"
|
||||
|
||||
automatic_placement = true
|
||||
vertical_placement = "center"
|
||||
horizontal_placement = "center"
|
||||
|
||||
maximum_width = 800
|
||||
|
||||
[tooltip]
|
||||
id = "tooltip"
|
||||
[/tooltip]
|
||||
|
||||
[helptip]
|
||||
id = "tooltip"
|
||||
[/helptip]
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
[column]
|
||||
horizontal_grow = true
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
[label]
|
||||
definition = "title"
|
||||
|
||||
#po: this is on a button that opens a dialog with links to various Wesnoth community websites
|
||||
label = _ "Community"
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
[/column]
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "forums"
|
||||
definition = "default"
|
||||
|
||||
#po: this is on a button that opens the Wesnoth forums webpage
|
||||
label = _ "Forums"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "discord"
|
||||
definition = "default"
|
||||
|
||||
#po: this is on a button that opens the Wesnoth Discord server webpage
|
||||
label = _ "Discord"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "irc"
|
||||
definition = "default"
|
||||
|
||||
#po: this is on a button that opens the Wesnoth IRC webpage. IRC is an acronym for Internet Relay Chat
|
||||
label = _ "IRC"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "steam"
|
||||
definition = "default"
|
||||
|
||||
#po: this is on a button that opens the Wesnoth Steam forums webpage
|
||||
label = _ "Steam"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "reddit"
|
||||
definition = "default"
|
||||
|
||||
#po: this is on a button that opens the Wesnoth Reddit webpage
|
||||
label = _ "Reddit"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "donate"
|
||||
definition = "default"
|
||||
|
||||
#po: this is on a button that opens the Wesnoth SPI webpage for sending donations
|
||||
label = _ "Donate"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 10
|
||||
|
||||
[button]
|
||||
id = "ok"
|
||||
definition = "default"
|
||||
|
||||
label = _ "Close"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/resolution]
|
||||
|
||||
[/window]
|
File diff suppressed because it is too large
Load Diff
|
@ -256,11 +256,10 @@ where
|
|||
{_GUI_BUTTON "multiplayer" _"Multiplayer" _"Play multiplayer (hotseat, LAN, or Internet), or a single scenario against the AI"}
|
||||
{_GUI_BUTTON "load" _"Load" _"Load a saved game"}
|
||||
{_GUI_BUTTON "addons" _"Add-ons" _"Download usermade campaigns, eras, or map packs"}
|
||||
{_GUI_BUTTON "editor" _"Map Editor" _"Start the map editor"}
|
||||
{_GUI_BUTTON "preferences" _"Preferences" _"Configure the game’s settings"}
|
||||
{_GUI_BUTTON "achievements" _"Achievements" _"View achievements"}
|
||||
{_GUI_BUTTON "editor" _"Map Editor" _"Start the map editor"}
|
||||
{_GUI_BUTTON "community" _"Community" _"Places to talk about Wesnoth"}
|
||||
{_GUI_BUTTON "credits" _"Credits" _"View the credits"}
|
||||
{_GUI_BUTTON "preferences" _"Preferences" _"Configure the game’s settings"}
|
||||
{_GUI_BUTTON "quit" _"Quit" _"Quit the game"}
|
||||
# This debug feature doesn't need to be translated, so put it in the test textdomain.
|
||||
#textdomain wesnoth-test
|
||||
|
@ -467,8 +466,9 @@ where
|
|||
horizontal_alignment = "left"
|
||||
[button]
|
||||
id = "about"
|
||||
definition = "action_about"
|
||||
tooltip = _ "Display the game version and build information"
|
||||
definition = "titlescreen_about"
|
||||
label = _ "About"
|
||||
tooltip = _ "General information about Battle for Wesnoth"
|
||||
[/button]
|
||||
[/column]
|
||||
|
||||
|
|
|
@ -46,6 +46,12 @@
|
|||
max="1"
|
||||
super="$generic/state"
|
||||
[/tag]
|
||||
[tag]
|
||||
name="state_success"
|
||||
min="0"
|
||||
max="1"
|
||||
super="$generic/state"
|
||||
[/tag]
|
||||
[/tag]
|
||||
[/tag]
|
||||
[tag]
|
||||
|
|
BIN
images/icons/action/copy_25-success.png
Normal file
BIN
images/icons/action/copy_25-success.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
|
@ -587,8 +587,6 @@
|
|||
<Unit filename="../../src/gui/dialogs/campaign_selection.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/chat_log.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/chat_log.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/community_dialog.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/community_dialog.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/core_selection.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/core_selection.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/debug_clock.cpp" />
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
000000000000000000000008 /* achievements_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 000000000000000000000003 /* achievements_dialog.cpp */; };
|
||||
000000000000000000000011 /* network_download_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 000000000000000000000009 /* network_download_file.cpp */; };
|
||||
000000000000000000000012 /* network_download_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 000000000000000000000009 /* network_download_file.cpp */; };
|
||||
00324A11ACB0DB64FBD97896 /* community_dialog.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD5045B9A988F034F8D17C85 /* community_dialog.hpp */; };
|
||||
02A44BEAA567595C902031CF /* edit_pbl_translation.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C679447D91FD3623CC852FF8 /* edit_pbl_translation.hpp */; };
|
||||
04C748F7835C62498D27442D /* edit_pbl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6FA542D78393E8FF067775DA /* edit_pbl.cpp */; };
|
||||
0554467DB5FE99D85ABCDCA0 /* edit_pbl_translation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00574699A982AA23F12B39E0 /* edit_pbl_translation.cpp */; };
|
||||
|
@ -624,7 +623,6 @@
|
|||
46F92F272175036700602C1C /* constants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92F0E2174FEC000602C1C /* constants.cpp */; };
|
||||
4944F41B1354FBFF0027E614 /* teleport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4944F41A1354FBFF0027E614 /* teleport.cpp */; };
|
||||
49478714172FF6F8002B7ABA /* tristate_button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49478712172FF6F8002B7ABA /* tristate_button.cpp */; };
|
||||
4B5D4FBB98B2ADF26EC50D9D /* community_dialog.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD5045B9A988F034F8D17C85 /* community_dialog.hpp */; };
|
||||
4E19429E82899A42A73BBE91 /* choose_addon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20E644DC98F26C756364EC2C /* choose_addon.cpp */; };
|
||||
4E4A4DBC9F44444A5867EC2B /* migrate_version_selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7B1444E9B79504502208B82 /* migrate_version_selection.cpp */; };
|
||||
508C40A885166B2E3F4245F4 /* general.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84234C54BB84519421FD4136 /* general.cpp */; };
|
||||
|
@ -1441,9 +1439,7 @@
|
|||
ECFB9FA8193BFAD900146ED0 /* carryover.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECFB9FA7193BFAD900146ED0 /* carryover.cpp */; };
|
||||
ECFB9FAA193BFB4B00146ED0 /* game_board.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECFB9FA9193BFB4B00146ED0 /* game_board.cpp */; };
|
||||
ECFB9FAC193BFB6E00146ED0 /* rect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECFB9FAB193BFB6E00146ED0 /* rect.cpp */; };
|
||||
F0A74F75B197FC7C57528FF8 /* community_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 63B64397BB28593D879A67BE /* community_dialog.cpp */; };
|
||||
F13D4C33BAA4CB9E9AACFCC2 /* spinner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4214F3DA80B54080C4B548F /* spinner.cpp */; };
|
||||
F213406695CCC6ECE7254B38 /* community_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 63B64397BB28593D879A67BE /* community_dialog.cpp */; };
|
||||
F40A13BC1A3A88BA00C4D071 /* apple_notification.mm in Sources */ = {isa = PBXBuildFile; fileRef = F40A13BB1A3A88BA00C4D071 /* apple_notification.mm */; };
|
||||
F419A1F414E21246002F9ADC /* game_end_exceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F419A1F314E21246002F9ADC /* game_end_exceptions.cpp */; };
|
||||
F419A2C314F5BCFE002F9ADC /* info.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F419A2C114F5BCFE002F9ADC /* info.cpp */; };
|
||||
|
@ -2209,7 +2205,6 @@
|
|||
62D24F311519987400350848 /* context_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = context_manager.cpp; sourceTree = "<group>"; };
|
||||
62D24F331519994300350848 /* palette_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = palette_manager.hpp; sourceTree = "<group>"; };
|
||||
62D24F341519995200350848 /* palette_manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = palette_manager.cpp; sourceTree = "<group>"; };
|
||||
63B64397BB28593D879A67BE /* community_dialog.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = community_dialog.cpp; path = community_dialog.cpp; sourceTree = "<group>"; };
|
||||
67044415B63F5888193BD7A6 /* prompt.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = prompt.cpp; sourceTree = "<group>"; };
|
||||
6FA542D78393E8FF067775DA /* edit_pbl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = edit_pbl.cpp; sourceTree = "<group>"; };
|
||||
755D4555A1DEA29125E7F338 /* scroll_text.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = scroll_text.cpp; path = scroll_text.cpp; sourceTree = "<group>"; };
|
||||
|
@ -2740,7 +2735,6 @@
|
|||
BF3B41AF9FEBC9C3A11736A2 /* tab_container.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = tab_container.hpp; path = tab_container.hpp; sourceTree = "<group>"; };
|
||||
C61F473D9AC43768A445E218 /* tod_new_schedule.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tod_new_schedule.cpp; sourceTree = "<group>"; };
|
||||
C679447D91FD3623CC852FF8 /* edit_pbl_translation.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = edit_pbl_translation.hpp; sourceTree = "<group>"; };
|
||||
CD5045B9A988F034F8D17C85 /* community_dialog.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = community_dialog.hpp; path = community_dialog.hpp; sourceTree = "<group>"; };
|
||||
D4594633BF3F8A06D6AE752F /* prompt.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = prompt.hpp; sourceTree = "<group>"; };
|
||||
D911474D925FA88D5B856A0E /* test_sdl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = test_sdl.cpp; path = test_sdl.cpp; sourceTree = "<group>"; };
|
||||
D9A141EAAE90E98B6F6171D6 /* choose_addon.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = choose_addon.hpp; sourceTree = "<group>"; };
|
||||
|
@ -3864,8 +3858,6 @@
|
|||
46F92CF62174F6A300602C1C /* wml_message.hpp */,
|
||||
67044415B63F5888193BD7A6 /* prompt.cpp */,
|
||||
D4594633BF3F8A06D6AE752F /* prompt.hpp */,
|
||||
63B64397BB28593D879A67BE /* community_dialog.cpp */,
|
||||
CD5045B9A988F034F8D17C85 /* community_dialog.hpp */,
|
||||
F7B1444E9B79504502208B82 /* migrate_version_selection.cpp */,
|
||||
B3DE4F95AF72C6F6BC37E695 /* migrate_version_selection.hpp */,
|
||||
);
|
||||
|
@ -5162,7 +5154,6 @@
|
|||
285C4E7A9E891E1DCB215683 /* back_edge_detector.hpp in Headers */,
|
||||
8E1D442FB4DA43385F58F77F /* combobox.hpp in Headers */,
|
||||
B7B34687A61290490C1616D3 /* tab_container.hpp in Headers */,
|
||||
4B5D4FBB98B2ADF26EC50D9D /* community_dialog.hpp in Headers */,
|
||||
365D4F89BD511BC074E639D7 /* migrate_version_selection.hpp in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -5179,7 +5170,6 @@
|
|||
F96A40219A964A8022910D73 /* back_edge_detector.hpp in Headers */,
|
||||
D09A4D40A36568E32D8723F7 /* combobox.hpp in Headers */,
|
||||
3CC6488695A7293C9CFC2CB6 /* tab_container.hpp in Headers */,
|
||||
00324A11ACB0DB64FBD97896 /* community_dialog.hpp in Headers */,
|
||||
7A0347D48BDB52B1430D9E79 /* migrate_version_selection.hpp in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -5937,7 +5927,6 @@
|
|||
AC4242F78B39C571E34AF48F /* edit_unit.cpp in Sources */,
|
||||
1C3D48879EAC414AE3DB122E /* combobox.cpp in Sources */,
|
||||
1BC74FED857215A162E9E0F2 /* tab_container.cpp in Sources */,
|
||||
F213406695CCC6ECE7254B38 /* community_dialog.cpp in Sources */,
|
||||
D2E9440BBCDCE2A75C93F85D /* migrate_version_selection.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -6624,7 +6613,6 @@
|
|||
7A7146D7893AA09891352019 /* test_schema_validator.cpp in Sources */,
|
||||
9C2743DE8100448B66F7E0AF /* combobox.cpp in Sources */,
|
||||
19B14238AD52EC06ED2094F1 /* tab_container.cpp in Sources */,
|
||||
F0A74F75B197FC7C57528FF8 /* community_dialog.cpp in Sources */,
|
||||
4E4A4DBC9F44444A5867EC2B /* migrate_version_selection.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
|
|
@ -179,7 +179,6 @@ gui/dialogs/attack_predictions.cpp
|
|||
gui/dialogs/campaign_difficulty.cpp
|
||||
gui/dialogs/campaign_selection.cpp
|
||||
gui/dialogs/chat_log.cpp
|
||||
gui/dialogs/community_dialog.cpp
|
||||
gui/dialogs/core_selection.cpp
|
||||
gui/dialogs/debug_clock.cpp
|
||||
gui/dialogs/depcheck_confirm_change.cpp
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2003 - 2024
|
||||
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "gui/dialogs/community_dialog.hpp"
|
||||
|
||||
#include "desktop/open.hpp"
|
||||
#include "gui/auxiliary/find_widget.hpp"
|
||||
#include "gui/widgets/button.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
|
||||
namespace gui2::dialogs
|
||||
{
|
||||
|
||||
REGISTER_DIALOG(community_dialog)
|
||||
|
||||
community_dialog::community_dialog()
|
||||
: modal_dialog(window_id())
|
||||
{
|
||||
}
|
||||
|
||||
void community_dialog::pre_show(window& window)
|
||||
{
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "forums", false), std::bind(&desktop::open_object, "https://forums.wesnoth.org/"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "discord", false), std::bind(&desktop::open_object, "https://discord.gg/battleforwesnoth"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "irc", false), std::bind(&desktop::open_object, "https://web.libera.chat/#wesnoth"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "steam", false), std::bind(&desktop::open_object, "https://steamcommunity.com/app/599390/discussions/"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "reddit", false), std::bind(&desktop::open_object, "https://www.reddit.com/r/wesnoth/"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "donate", false), std::bind(&desktop::open_object, "https://www.spi-inc.org/projects/wesnoth/"));
|
||||
}
|
||||
|
||||
void community_dialog::post_show(window&)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace gui2::dialogs
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2003 - 2024
|
||||
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gui/dialogs/modal_dialog.hpp"
|
||||
|
||||
namespace gui2::dialogs
|
||||
{
|
||||
|
||||
class community_dialog : public modal_dialog
|
||||
{
|
||||
public:
|
||||
DEFINE_SIMPLE_EXECUTE_WRAPPER(community_dialog)
|
||||
|
||||
community_dialog();
|
||||
|
||||
private:
|
||||
virtual const std::string& window_id() const override;
|
||||
|
||||
virtual void pre_show(window& window) override;
|
||||
|
||||
virtual void post_show(window& window) override;
|
||||
};
|
||||
|
||||
} // namespace gui2::dialogs
|
|
@ -28,9 +28,13 @@
|
|||
#include "gui/widgets/button.hpp"
|
||||
#include "gui/widgets/styled_widget.hpp"
|
||||
#include "gui/widgets/listbox.hpp"
|
||||
#include "gui/widgets/stacked_widget.hpp"
|
||||
#include "gui/widgets/tab_container.hpp"
|
||||
#include "gui/widgets/text_box_base.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "gui/dialogs/message.hpp"
|
||||
#include "gui/dialogs/end_credits.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "help/help.hpp"
|
||||
|
||||
#include <functional>
|
||||
|
||||
|
@ -47,7 +51,7 @@ namespace gui2::dialogs
|
|||
|
||||
REGISTER_DIALOG(game_version)
|
||||
|
||||
game_version::game_version()
|
||||
game_version::game_version(unsigned start_page)
|
||||
: modal_dialog(window_id())
|
||||
, path_wid_stem_("path_")
|
||||
, copy_wid_stem_("copy_")
|
||||
|
@ -57,6 +61,7 @@ game_version::game_version()
|
|||
, deps_()
|
||||
, opts_(game_config::optional_features_table())
|
||||
, report_()
|
||||
, start_page_(start_page)
|
||||
{
|
||||
// NOTE: these path_map_ entries are referenced by the GUI2 WML
|
||||
// definition of this dialog using preprocessor macros.
|
||||
|
@ -90,24 +95,40 @@ void game_version::pre_show(window& window)
|
|||
{
|
||||
utils::string_map i18n_syms;
|
||||
|
||||
tab_container& tabs = find_widget<tab_container>(&window, "tabs", false);
|
||||
|
||||
//
|
||||
// General information.
|
||||
//
|
||||
tabs.select_tab(0);
|
||||
|
||||
styled_widget& version_label = find_widget<styled_widget>(&window, "version", false);
|
||||
i18n_syms["version"] = game_config::revision + " " + game_config::build_arch();
|
||||
version_label.set_label(VGETTEXT("Version $version", i18n_syms));
|
||||
|
||||
styled_widget& os_label = find_widget<styled_widget>(&window, "os", false);
|
||||
i18n_syms["os"] = desktop::os_version();
|
||||
os_label.set_label(VGETTEXT("Running on $os", i18n_syms));
|
||||
styled_widget& arch_label = find_widget<styled_widget>(&window, "arch", false);
|
||||
|
||||
version_label.set_label(game_config::revision);
|
||||
os_label.set_label("<i>"+desktop::os_version()+"</i>");
|
||||
arch_label.set_label(game_config::build_arch());
|
||||
|
||||
button& copy_all = find_widget<button>(&window, "copy_all", false);
|
||||
connect_signal_mouse_left_click(copy_all, std::bind(&game_version::report_copy_callback, this));
|
||||
|
||||
// Bottom row buttons
|
||||
button& credits_button = find_widget<button>(&window, "credits", false);
|
||||
connect_signal_mouse_left_click(credits_button, std::bind(&game_version::show_credits_dialog, this));
|
||||
|
||||
button& license_button = find_widget<button>(&window, "license", false);
|
||||
connect_signal_mouse_left_click(license_button, std::bind(&game_version::show_license, this));
|
||||
|
||||
button& issue_button = find_widget<button>(&window, "issue", false);
|
||||
connect_signal_mouse_left_click(issue_button, std::bind(&game_version::report_issue, this));
|
||||
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "run_migrator", false), std::bind(&game_version::run_migrator, this));
|
||||
|
||||
//
|
||||
// Game paths tab.
|
||||
//
|
||||
tabs.select_tab(1);
|
||||
|
||||
for(const auto & path_ent : path_map_)
|
||||
{
|
||||
|
@ -119,11 +140,10 @@ void game_version::pre_show(window& window)
|
|||
button& browse_w = find_widget<button>(&window, browse_wid_stem_ + path_id, false);
|
||||
|
||||
path_w.set_value(path_path);
|
||||
path_w.set_active(false);
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
copy_w,
|
||||
std::bind(&game_version::copy_to_clipboard_callback, this, path_path));
|
||||
std::bind(&game_version::copy_to_clipboard_callback, this, path_path, copy_wid_stem_ + path_id));
|
||||
connect_signal_mouse_left_click(
|
||||
browse_w,
|
||||
std::bind(&game_version::browse_directory_callback, this, path_path));
|
||||
|
@ -144,11 +164,10 @@ void game_version::pre_show(window& window)
|
|||
connect_signal_mouse_left_click(stderr_button, std::bind(&game_version::browse_directory_callback, this, log_path_));
|
||||
stderr_button.set_active(!log_path_.empty() && filesystem::file_exists(log_path_));
|
||||
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "run_migrator", false), std::bind(&game_version::run_migrator, this));
|
||||
|
||||
//
|
||||
// Build info tab.
|
||||
//
|
||||
tabs.select_tab(2);
|
||||
|
||||
widget_data list_data;
|
||||
|
||||
|
@ -179,6 +198,7 @@ void game_version::pre_show(window& window)
|
|||
//
|
||||
// Features tab.
|
||||
//
|
||||
tabs.select_tab(3);
|
||||
|
||||
listbox& opts_listbox
|
||||
= find_widget<listbox>(&window, "opts_listbox", false);
|
||||
|
@ -200,34 +220,23 @@ void game_version::pre_show(window& window)
|
|||
opts_listbox.select_row(0);
|
||||
list_data.clear();
|
||||
|
||||
//
|
||||
// Community tab
|
||||
//
|
||||
tabs.select_tab(4);
|
||||
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "forums", false), std::bind(&desktop::open_object, "https://forums.wesnoth.org/"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "discord", false), std::bind(&desktop::open_object, "https://discord.gg/battleforwesnoth"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "irc", false), std::bind(&desktop::open_object, "https://web.libera.chat/#wesnoth"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "steam", false), std::bind(&desktop::open_object, "https://steamcommunity.com/app/599390/discussions/"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "reddit", false), std::bind(&desktop::open_object, "https://www.reddit.com/r/wesnoth/"));
|
||||
connect_signal_mouse_left_click(find_widget<button>(&window, "donate", false), std::bind(&desktop::open_object, "https://www.spi-inc.org/projects/wesnoth/"));
|
||||
|
||||
//
|
||||
// Set-up page stack and auxiliary controls last.
|
||||
//
|
||||
|
||||
stacked_widget& pager
|
||||
= find_widget<stacked_widget>(&window, "tabs_container", false);
|
||||
pager.select_layer(0);
|
||||
|
||||
listbox& tab_bar
|
||||
= find_widget<listbox>(&window, "tab_bar", false);
|
||||
|
||||
window.keyboard_capture(&tab_bar);
|
||||
|
||||
const unsigned tab_count = tab_bar.get_item_count();
|
||||
VALIDATE(tab_count == pager.get_layer_count(), "Tab bar and container size mismatch");
|
||||
|
||||
connect_signal_notify_modified(tab_bar,
|
||||
std::bind(&game_version::tab_switch_callback, this));
|
||||
}
|
||||
|
||||
void game_version::tab_switch_callback()
|
||||
{
|
||||
stacked_widget& pager
|
||||
= find_widget<stacked_widget>(get_window(), "tabs_container", false);
|
||||
listbox& tab_bar
|
||||
= find_widget<listbox>(get_window(), "tab_bar", false);
|
||||
|
||||
pager.select_layer(std::max<int>(0, tab_bar.get_selected_row()));
|
||||
tabs.select_tab(0);
|
||||
}
|
||||
|
||||
void game_version::browse_directory_callback(const std::string& path)
|
||||
|
@ -240,14 +249,20 @@ void game_version::run_migrator()
|
|||
migrate_version_selection::execute();
|
||||
}
|
||||
|
||||
void game_version::copy_to_clipboard_callback(const std::string& path)
|
||||
void game_version::copy_to_clipboard_callback(const std::string& path, const std::string btn_id)
|
||||
{
|
||||
desktop::clipboard::copy_to_clipboard(path, false);
|
||||
|
||||
button& copy_w = find_widget<button>(get_window(), btn_id, false);
|
||||
copy_w.set_success(true);
|
||||
}
|
||||
|
||||
void game_version::report_copy_callback()
|
||||
{
|
||||
desktop::clipboard::copy_to_clipboard(report_, false);
|
||||
|
||||
button& copy_all = find_widget<button>(get_window(), "copy_all", false);
|
||||
copy_all.set_success(true);
|
||||
}
|
||||
|
||||
void game_version::generate_plain_text_report()
|
||||
|
@ -255,4 +270,21 @@ void game_version::generate_plain_text_report()
|
|||
report_ = game_config::full_build_report();
|
||||
}
|
||||
|
||||
void game_version::show_credits_dialog() {
|
||||
gui2::dialogs::end_credits::display();
|
||||
}
|
||||
|
||||
void game_version::show_license() {
|
||||
help::show_help("license");
|
||||
}
|
||||
|
||||
void game_version::report_issue() {
|
||||
if (!desktop::open_object_is_supported()) {
|
||||
show_message("", _("Opening links is not supported, contact your packager"), dialogs::message::auto_close);
|
||||
return;
|
||||
} else {
|
||||
desktop::open_object("https://bugs.wesnoth.org");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dialogs
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "build_info.hpp"
|
||||
|
||||
#include <map>
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace gui2
|
||||
|
@ -35,7 +34,7 @@ public:
|
|||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
game_version();
|
||||
game_version(unsigned start_page = 0);
|
||||
|
||||
/**
|
||||
* The display function.
|
||||
|
@ -61,6 +60,8 @@ private:
|
|||
|
||||
std::string report_;
|
||||
|
||||
unsigned start_page_;
|
||||
|
||||
void generate_plain_text_report();
|
||||
|
||||
virtual const std::string& window_id() const override;
|
||||
|
@ -85,8 +86,9 @@ private:
|
|||
* Callback function for copy-to-clipboard action buttons.
|
||||
*
|
||||
* @param path Filesystem path associated with the widget.
|
||||
* @param btn_id Id of the button that calls this method
|
||||
*/
|
||||
void copy_to_clipboard_callback(const std::string& path);
|
||||
void copy_to_clipboard_callback(const std::string& path, const std::string btn_id);
|
||||
|
||||
/**
|
||||
* Callback function for browse-directory action buttons.
|
||||
|
@ -95,6 +97,20 @@ private:
|
|||
*/
|
||||
void browse_directory_callback(const std::string& path);
|
||||
|
||||
/**
|
||||
* Show credits dialogs
|
||||
*/
|
||||
void show_credits_dialog();
|
||||
/**
|
||||
* Show license
|
||||
*/
|
||||
void show_license();
|
||||
|
||||
/**
|
||||
* Open browser to report issue
|
||||
*/
|
||||
void report_issue();
|
||||
|
||||
/**
|
||||
* Callback function to re-run the version migration dialog.
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "gui/auxiliary/find_widget.hpp"
|
||||
#include "gui/auxiliary/tips.hpp"
|
||||
#include "gui/dialogs/achievements_dialog.hpp"
|
||||
#include "gui/dialogs/community_dialog.hpp"
|
||||
#include "gui/dialogs/core_selection.hpp"
|
||||
#include "gui/dialogs/debug_clock.hpp"
|
||||
#include "gui/dialogs/game_version_dialog.hpp"
|
||||
|
@ -345,11 +344,6 @@ void title_screen::init_callbacks()
|
|||
register_button(*this, "community", hotkey::HOTKEY_NULL,
|
||||
std::bind(&title_screen::show_community, this));
|
||||
|
||||
//
|
||||
// Credits
|
||||
//
|
||||
register_button(*this, "credits", hotkey::TITLE_SCREEN__CREDITS, [this]() { set_retval(SHOW_ABOUT); });
|
||||
|
||||
//
|
||||
// Quit
|
||||
//
|
||||
|
@ -490,8 +484,9 @@ void title_screen::show_achievements()
|
|||
|
||||
void title_screen::show_community()
|
||||
{
|
||||
community_dialog dlg;
|
||||
dlg.show();
|
||||
game_version dlg;
|
||||
// shows the 5th tab, community, when the dialog is shown
|
||||
dlg.display(4);
|
||||
}
|
||||
|
||||
void title_screen::button_callback_multiplayer()
|
||||
|
|
|
@ -57,8 +57,6 @@ public:
|
|||
MP_LOCAL,
|
||||
// Start the map/scenario editor
|
||||
MAP_EDITOR,
|
||||
// Show credits
|
||||
SHOW_ABOUT,
|
||||
// Exit to desktop
|
||||
QUIT_GAME,
|
||||
// Used to reload all game data
|
||||
|
|
|
@ -46,6 +46,7 @@ button::button(const implementation::builder_button& builder)
|
|||
, clickable_item()
|
||||
, state_(ENABLED)
|
||||
, retval_(retval::NONE)
|
||||
, success_(false)
|
||||
{
|
||||
connect_signal<event::MOUSE_ENTER>(
|
||||
std::bind(&button::signal_handler_mouse_enter, this, std::placeholders::_2, std::placeholders::_3));
|
||||
|
@ -85,6 +86,13 @@ void button::set_state(const state_t state)
|
|||
}
|
||||
}
|
||||
|
||||
void button::set_success(bool success) {
|
||||
success_ = success;
|
||||
if (success) {
|
||||
set_state(SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
void button::signal_handler_mouse_enter(const event::ui_event event,
|
||||
bool& handled)
|
||||
{
|
||||
|
@ -99,7 +107,11 @@ void button::signal_handler_mouse_leave(const event::ui_event event,
|
|||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".";
|
||||
|
||||
set_state(ENABLED);
|
||||
if (success_) {
|
||||
set_state(SUCCESS);
|
||||
} else {
|
||||
set_state(ENABLED);
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
|
||||
|
@ -163,6 +175,11 @@ button_definition::resolution::resolution(const config& cfg)
|
|||
state.emplace_back(VALIDATE_WML_CHILD(cfg, "state_disabled", missing_mandatory_wml_tag("button_definition][resolution", "state_disabled")));
|
||||
state.emplace_back(VALIDATE_WML_CHILD(cfg, "state_pressed", missing_mandatory_wml_tag("button_definition][resolution", "state_pressed")));
|
||||
state.emplace_back(VALIDATE_WML_CHILD(cfg, "state_focused", missing_mandatory_wml_tag("button_definition][resolution", "state_focused")));
|
||||
// state_success is optional, so error message not needed.
|
||||
if (cfg.optional_child("state_success")) {
|
||||
state.emplace_back(cfg.mandatory_child("state_success"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// }---------- BUILDER -----------{
|
||||
|
|
|
@ -48,6 +48,8 @@ public:
|
|||
/** See @ref styled_widget::get_state. */
|
||||
virtual unsigned get_state() const override;
|
||||
|
||||
void set_success(bool success);
|
||||
|
||||
/** Inherited from clickable_item. */
|
||||
virtual void connect_click_handler(const event::signal& signal) override
|
||||
{
|
||||
|
@ -78,6 +80,7 @@ private:
|
|||
DISABLED,
|
||||
PRESSED,
|
||||
FOCUSED,
|
||||
SUCCESS
|
||||
};
|
||||
|
||||
void set_state(const state_t state);
|
||||
|
@ -97,6 +100,11 @@ private:
|
|||
*/
|
||||
int retval_;
|
||||
|
||||
/**
|
||||
* Action performed by this button succeeded.
|
||||
*/
|
||||
bool success_;
|
||||
|
||||
public:
|
||||
/** Static type getter that does not rely on the widget being constructed. */
|
||||
static const std::string& type();
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "gui/core/window_builder/helper.hpp"
|
||||
#include "gui/core/register_widget.hpp"
|
||||
#include "gui/widgets/listbox.hpp"
|
||||
//#include "gui/widgets/stacked_widget.hpp"
|
||||
#include "gui/widgets/settings.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "wml_exception.hpp"
|
||||
|
@ -71,7 +70,27 @@ listbox& tab_container::get_internal_list()
|
|||
return find_widget<listbox>(&get_grid(), "_tab_list", false);
|
||||
}
|
||||
|
||||
void tab_container::finalize_setup() {
|
||||
void tab_container::finalize(std::unique_ptr<generator_base> generator)
|
||||
{
|
||||
generator_ = generator.get();
|
||||
assert(generator_);
|
||||
|
||||
widget_item empty_data;
|
||||
for(const auto& builder_entry : builders_) {
|
||||
generator->create_item(-1, *builder_entry, empty_data, nullptr);
|
||||
}
|
||||
|
||||
grid* parent_grid = find_widget<grid>(this, "_content_grid", false, true);
|
||||
if (parent_grid) {
|
||||
parent_grid->swap_child("_page", std::move(generator), false);
|
||||
}
|
||||
|
||||
finalize_listbox();
|
||||
|
||||
select_tab(0);
|
||||
}
|
||||
|
||||
void tab_container::finalize_listbox() {
|
||||
for (const widget_data& row : list_items_) {
|
||||
add_tab_entry(row);
|
||||
}
|
||||
|
@ -86,16 +105,10 @@ void tab_container::add_tab_entry(const widget_data row)
|
|||
|
||||
void tab_container::select_tab(unsigned index)
|
||||
{
|
||||
if (index < list_items_.size()) {
|
||||
unsigned count = get_tab_count();
|
||||
if (index < count) {
|
||||
get_internal_list().select_row(index);
|
||||
|
||||
grid* parent_grid = find_widget<grid>(this, "_content_grid", false, true);
|
||||
|
||||
if (parent_grid) {
|
||||
std::unique_ptr<widget> grid = std::move(builders_[list_items_.at(index)["name"]["label"]]->build());
|
||||
grid.get()->set_id("_page");
|
||||
parent_grid->swap_child("_page", std::move(grid), false);
|
||||
}
|
||||
generator_->select_item(index, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +162,7 @@ builder_tab_container::builder_tab_container(const config& cfg)
|
|||
|
||||
if (tab.has_child("data")) {
|
||||
auto builder = std::make_shared<builder_grid>(tab.mandatory_child("data"));
|
||||
builders[tab["name"]] = builder;
|
||||
builders.push_back(builder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,9 +180,8 @@ std::unique_ptr<widget> builder_tab_container::build() const
|
|||
widget->set_items(list_items);
|
||||
widget->set_builders(builders);
|
||||
|
||||
widget->finalize_setup();
|
||||
|
||||
widget->select_tab(list_items.size()-1);
|
||||
auto generator = generator_base::build(true, true, generator_base::independent, false);
|
||||
widget->finalize(std::move(generator));
|
||||
|
||||
DBG_GUI_G << "Window builder: placed tab_container '" << id
|
||||
<< "' with definition '" << definition << "'.";
|
||||
|
|
|
@ -72,9 +72,21 @@ private:
|
|||
*/
|
||||
state_t state_;
|
||||
|
||||
builder_grid_map builders_;
|
||||
std::vector<std::shared_ptr<builder_grid>> builders_;
|
||||
std::vector<widget_data> list_items_;
|
||||
|
||||
/**
|
||||
* Finishes the building initialization of the widget.
|
||||
*
|
||||
* @param generator Generator for the list
|
||||
*/
|
||||
void finalize(std::unique_ptr<generator_base> generator);
|
||||
|
||||
/**
|
||||
* Contains a pointer to the generator.
|
||||
*/
|
||||
generator_base* generator_;
|
||||
|
||||
/** Get the listbox inside which the tabs are shown */
|
||||
listbox& get_internal_list();
|
||||
|
||||
|
@ -82,14 +94,14 @@ private:
|
|||
|
||||
void change_selection();
|
||||
|
||||
void finalize_setup();
|
||||
void finalize_listbox();
|
||||
|
||||
void set_items(std::vector<widget_data> list_items)
|
||||
{
|
||||
list_items_ = list_items;
|
||||
}
|
||||
|
||||
void set_builders(builder_grid_map builders) {
|
||||
void set_builders(std::vector<std::shared_ptr<builder_grid>> builders) {
|
||||
builders_ = builders;
|
||||
}
|
||||
|
||||
|
@ -132,7 +144,7 @@ struct builder_tab_container : public builder_styled_widget
|
|||
|
||||
virtual std::unique_ptr<widget> build() const override;
|
||||
|
||||
builder_grid_map builders;
|
||||
std::vector<std::shared_ptr<builder_grid>> builders;
|
||||
|
||||
std::vector<widget_data> list_items;
|
||||
};
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "gui/dialogs/attack_predictions.hpp"
|
||||
#include "gui/dialogs/campaign_difficulty.hpp"
|
||||
#include "gui/dialogs/campaign_selection.hpp"
|
||||
#include "gui/dialogs/community_dialog.hpp"
|
||||
#include "gui/dialogs/chat_log.hpp"
|
||||
#include "gui/dialogs/core_selection.hpp"
|
||||
#include "gui/dialogs/debug_clock.hpp"
|
||||
|
@ -625,10 +624,6 @@ BOOST_AUTO_TEST_CASE(modal_dialog_test_achievements_dialog)
|
|||
{
|
||||
test<achievements_dialog>();
|
||||
}
|
||||
BOOST_AUTO_TEST_CASE(modal_dialog_test_community_dialog)
|
||||
{
|
||||
test<community_dialog>();
|
||||
}
|
||||
BOOST_AUTO_TEST_CASE(modal_dialog_test_mp_match_history_dialog)
|
||||
{
|
||||
test<mp_match_history>();
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "game_launcher.hpp" // for game_launcher, etc
|
||||
#include "gettext.hpp"
|
||||
#include "gui/core/event/handler.hpp" // for tmanager
|
||||
#include "gui/dialogs/end_credits.hpp"
|
||||
#include "gui/dialogs/loading_screen.hpp"
|
||||
#include "gui/dialogs/message.hpp" // for show_error_message
|
||||
#include "gui/dialogs/migrate_version_selection.hpp"
|
||||
|
@ -845,9 +844,6 @@ static int do_gameloop(const std::vector<std::string>& args)
|
|||
case gui2::dialogs::title_screen::MAP_EDITOR:
|
||||
game->start_editor();
|
||||
break;
|
||||
case gui2::dialogs::title_screen::SHOW_ABOUT:
|
||||
gui2::dialogs::end_credits::display();
|
||||
break;
|
||||
case gui2::dialogs::title_screen::LAUNCH_GAME:
|
||||
game->launch_game(game_launcher::reload_mode::RELOAD_DATA);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user