mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-13 20:23:01 +00:00
tutorial: UI improvements
uses portraits in the character selection and single click selection on pictures instead of buttons also adds a dark background to hint messages to make them easier to read adds arrow markers in the beginning on the units
This commit is contained in:
parent
7fb0b8cdb3
commit
0302dd8601
|
@ -13,9 +13,9 @@
|
||||||
grow_factor = 1
|
grow_factor = 1
|
||||||
border = "all"
|
border = "all"
|
||||||
border_size = 5
|
border_size = 5
|
||||||
horizontal_alignment = "left"
|
horizontal_alignment = "center"
|
||||||
[label]
|
[label]
|
||||||
definition = "title"
|
definition = "title_script"
|
||||||
label = _"Select Character"
|
label = _"Select Character"
|
||||||
[/label]
|
[/label]
|
||||||
[/column]
|
[/column]
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
grow_factor = 1
|
grow_factor = 1
|
||||||
border = "all"
|
border = "all"
|
||||||
border_size = 5
|
border_size = 5
|
||||||
horizontal_alignment = "left"
|
horizontal_alignment = "center"
|
||||||
[label]
|
[label]
|
||||||
label = _"Who do you want to play as?"
|
label = _"Who do you want to play as?"
|
||||||
[/label]
|
[/label]
|
||||||
|
@ -39,37 +39,88 @@
|
||||||
grow_factor = 1
|
grow_factor = 1
|
||||||
border = "all"
|
border = "all"
|
||||||
border_size = 5
|
border_size = 5
|
||||||
[image]
|
|
||||||
label = "units/konrad-fighter.png"
|
[horizontal_listbox]
|
||||||
[/image]
|
id = "characters"
|
||||||
[/column]
|
has_minimum = false
|
||||||
|
[list_definition]
|
||||||
|
[row]
|
||||||
|
[column]
|
||||||
|
horizontal_grow = true
|
||||||
|
vertical_grow = true
|
||||||
|
|
||||||
|
[toggle_panel]
|
||||||
|
definition = "default"
|
||||||
|
return_value_id = "ok"
|
||||||
|
linked_group = "panel"
|
||||||
|
|
||||||
|
[grid]
|
||||||
|
[row]
|
||||||
|
grow_factor = 0
|
||||||
|
|
||||||
[column]
|
[column]
|
||||||
grow_factor = 1
|
grow_factor = 1
|
||||||
|
horizontal_alignment = "center"
|
||||||
|
|
||||||
border = "all"
|
border = "all"
|
||||||
border_size = 5
|
border_size = 5
|
||||||
|
|
||||||
[image]
|
[image]
|
||||||
label = "units/human-princess.png~TC(1,magenta)"
|
id = "image"
|
||||||
|
definition = "default"
|
||||||
[/image]
|
[/image]
|
||||||
[/column]
|
[/column]
|
||||||
[/row]
|
[/row]
|
||||||
|
|
||||||
|
[row]
|
||||||
|
grow_factor = 1
|
||||||
|
|
||||||
|
[column]
|
||||||
|
grow_factor = 0
|
||||||
|
border = "all"
|
||||||
|
border_size = 10
|
||||||
|
horizontal_grow = true
|
||||||
|
vertical_alignment = "top"
|
||||||
|
|
||||||
|
[label]
|
||||||
|
id = "name"
|
||||||
|
use_markup = true
|
||||||
|
text_alignment = "center"
|
||||||
|
[/label]
|
||||||
|
[/column]
|
||||||
|
[/row]
|
||||||
|
[/grid]
|
||||||
|
[/toggle_panel]
|
||||||
|
[/column]
|
||||||
|
[/row]
|
||||||
|
[/list_definition]
|
||||||
|
[list_data]
|
||||||
|
[row]
|
||||||
|
[column]
|
||||||
|
[widget]
|
||||||
|
id = "image"
|
||||||
|
label = "portraits/konrad.webp~SCALE(200,200)"
|
||||||
|
[/widget]
|
||||||
|
[widget]
|
||||||
|
id = "name"
|
||||||
|
label = "<span size='x-large' face='OldaniaAdfStd'>" + _"Konrad" + "</span>"
|
||||||
|
[/widget]
|
||||||
|
[/column]
|
||||||
|
[/row]
|
||||||
[row]
|
[row]
|
||||||
[column]
|
[column]
|
||||||
grow_factor = 1
|
[widget]
|
||||||
border = "all"
|
id = "image"
|
||||||
border_size = 5
|
label = "portraits/lisar.webp~SCALE(200,200)~FL()"
|
||||||
[button]
|
[/widget]
|
||||||
label = _"Konrad"
|
[widget]
|
||||||
return_value = 1
|
id = "name"
|
||||||
[/button]
|
label = "<span size='x-large' face='OldaniaAdfStd'>" + _"Li’sar" + "</span>"
|
||||||
|
[/widget]
|
||||||
[/column]
|
[/column]
|
||||||
[column]
|
[/row]
|
||||||
grow_factor = 1
|
[/list_data]
|
||||||
border = "all"
|
[/horizontal_listbox]
|
||||||
border_size = 5
|
|
||||||
[button]
|
|
||||||
label = _"Li’sar"
|
|
||||||
return_value = 2
|
|
||||||
[/button]
|
|
||||||
[/column]
|
[/column]
|
||||||
[/row]
|
[/row]
|
||||||
[/grid]
|
[/grid]
|
||||||
|
|
|
@ -7,17 +7,26 @@ local T = wml.tag
|
||||||
local wml_actions = wesnoth.wml_actions
|
local wml_actions = wesnoth.wml_actions
|
||||||
local _ = wesnoth.textdomain "wesnoth-tutorial"
|
local _ = wesnoth.textdomain "wesnoth-tutorial"
|
||||||
|
|
||||||
|
selected = 1
|
||||||
|
|
||||||
|
function pre_show(dialog)
|
||||||
|
local list = dialog:find("characters")
|
||||||
|
list.on_modified = function()
|
||||||
|
selected = list.selected_index
|
||||||
|
dialog:close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function wml_actions.select_character()
|
function wml_actions.select_character()
|
||||||
local character_selection_dialog = wml.load "campaigns/tutorial/gui/character_selection.cfg"
|
local character_selection_dialog = wml.load "campaigns/tutorial/gui/character_selection.cfg"
|
||||||
local dialog_wml = wml.get_child(character_selection_dialog, 'resolution')
|
local dialog_wml = wml.get_child(character_selection_dialog, 'resolution')
|
||||||
|
|
||||||
local result = wesnoth.sync.evaluate_single(function()
|
local result = wesnoth.sync.evaluate_single(function()
|
||||||
return { value = gui.show_dialog(dialog_wml) }
|
return { value = gui.show_dialog(dialog_wml, pre_show, function() end) }
|
||||||
end)
|
end)
|
||||||
local character = result.value
|
|
||||||
local unit = wml.variables.student_store
|
local unit = wml.variables.student_store
|
||||||
|
|
||||||
if character == 2 then
|
if selected == 2 then
|
||||||
wesnoth.units.to_map({
|
wesnoth.units.to_map({
|
||||||
type = "Fighteress",
|
type = "Fighteress",
|
||||||
side = 1,
|
side = 1,
|
||||||
|
|
|
@ -14,6 +14,8 @@ function wesnoth.wml_actions.hint_message(cfg)
|
||||||
size = 18,
|
size = 18,
|
||||||
location = {5,5},
|
location = {5,5},
|
||||||
color = {255, 255, 255},
|
color = {255, 255, 255},
|
||||||
|
bgcolor = {0, 0, 0},
|
||||||
|
bgalpha = 85,
|
||||||
duration = "unlimited",
|
duration = "unlimited",
|
||||||
max_width = "40%",
|
max_width = "40%",
|
||||||
valign = "top",
|
valign = "top",
|
||||||
|
|
|
@ -151,6 +151,7 @@
|
||||||
|
|
||||||
[select_character][/select_character]
|
[select_character][/select_character]
|
||||||
|
|
||||||
|
{HIGHLIGHT_IMAGE $student_store.x $student_store.y "misc/unit-marker.png" ()}
|
||||||
{CLEAR_VARIABLE student_store}
|
{CLEAR_VARIABLE student_store}
|
||||||
|
|
||||||
{GENDER (
|
{GENDER (
|
||||||
|
@ -376,6 +377,17 @@
|
||||||
) (
|
) (
|
||||||
{PRINT ( _ "Move Li’sar next to Delfador")}
|
{PRINT ( _ "Move Li’sar next to Delfador")}
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
[store_unit]
|
||||||
|
[filter]
|
||||||
|
id=Delfador
|
||||||
|
[/filter]
|
||||||
|
variable=mentor
|
||||||
|
kill=no
|
||||||
|
[/store_unit]
|
||||||
|
|
||||||
|
{HIGHLIGHT_IMAGE $mentor.x $mentor.y "misc/unit-marker.png" ()}
|
||||||
|
{CLEAR_VARIABLE mentor}
|
||||||
[/event]
|
[/event]
|
||||||
|
|
||||||
[event]
|
[event]
|
||||||
|
|
BIN
images/misc/unit-marker.png
Normal file
BIN
images/misc/unit-marker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue
Block a user