-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathutils.cfg
111 lines (103 loc) · 2.07 KB
/
utils.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#textdomain wesnoth-Wesnoth_Lua_Pack
# The convenience macros in this file can be used like this:
# #ifhave ~add-ons/Wesnoth_Lua_Pack/_main.cfg
# {~add-ons/Wesnoth_Lua_Pack/utils.cfg}
# #endif
# ...
# [scenario]
# #ifdef WLP_UNIT_DEBUG
# {WLP_UNIT_DEBUG}
# #endif
# #ifdef WLP_SIDE_DEBUG
# {WLP_SIDE_DEBUG}
# #endif
# [/scenario]
#define WLP_LOAD_GUI_TAGS
[event]
name=preload
first_time_only=no
[lua]
code=<< pcall(wesnoth.require, "~add-ons/Wesnoth_Lua_Pack/gui-tags.lua") >>
[/lua]
[/event]
#enddef
#define WLP_UNSET_MENU_ITEM ID
[event]
name=victory
[clear_menu_item]
id={ID}
[/clear_menu_item]
[/event]
#enddef
#define WLP_MENU_CREATION_HELPER ID DESCRIPTION TAG
#ifdef DEBUG_MODE
{WLP_LOAD_GUI_TAGS}
[event]
name=turn 1
[set_menu_item]
id={ID}
description={DESCRIPTION}
[show_if]
[have_unit]
x=$x1
y=$y1
[/have_unit]
[/show_if]
[command]
[{TAG}]
[/{TAG}]
[/command]
[/set_menu_item]
[/event]
{WLP_UNSET_MENU_ITEM ({ID})}
#endif
#enddef
#define WLP_UNIT_DEBUG
{WLP_MENU_CREATION_HELPER quick_unit_debug _"Quick Unit Debug" show_quick_debug}
#enddef
#define WLP_SIDE_DEBUG
{WLP_MENU_CREATION_HELPER quick_side_debug _"Quick Side Debug" show_side_debug}
#enddef
# In case we already have some menu items we need a submenu due to the hardcoded limit of 7.
#define WLP_QUICK_DEBUG
#ifdef DEBUG_MODE
{WLP_LOAD_GUI_TAGS}
[event]
name=turn 1
[set_menu_item]
id=quick_debug
description=_"Quick Debug"
[show_if]
[have_unit]
x=$x1
y=$y1
[/have_unit]
[/show_if]
[command]
[message]
speaker=narrator
image=wesnoth-icon.png
[option]
message=_"Quick Unit Debug"
[command]
[show_quick_debug]
[/show_quick_debug]
[/command]
[/option]
[option]
message=_"Quick Side Debug"
[command]
[show_side_debug]
[/show_side_debug]
[/command]
[/option]
[option]
message=_"Cancel"
[/option]
[/message]
[/command]
[/set_menu_item]
[/event]
{WLP_UNSET_MENU_ITEM quick_debug}
#endif
#enddef