Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove __UNUSED__ ifdefs #62

Merged
merged 1 commit into from
May 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _main.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add-ons/A_New_Order#enddef
id=A_New_Order
name=_ "A New Order"
abbrev=_ "ANO"
#ifdef __UNUSED__
#ifdef OLD_STYLE_VERSIONING
version={~{LDR_PATH}/dist/VERSION}
#else
# The version number is also set many other places in the code (e.g. in ano_macros.cfg);
Expand Down
Binary file added images/halo/dark-aura.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions macros/ano-01_06macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,3 @@
[/if]
[/event]
#enddef

#ifdef __UNUSED__
# wmlscope: start ignoring
#define CLEAR_RECALL_NEW
[kill]
side=1 # or whatever is the side of the player
x,y=recall,recall
[/kill]
#enddef
# wmlscope: stop ignoring
#endif
77 changes: 16 additions & 61 deletions macros/ano_macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@
[/allow_recruit]
#enddef

#ifdef ALLOW_DUP_MACRO_DEFS
# wmlscope: start ignoring
#define CONDITION VARIABLE OP VALUE
[variable]
name={VARIABLE}
{OP}={VALUE}
[/variable]
#enddef
# wmlscope: stop ignoring
#endif

#define DISALLOW_RECRUIT SIDE TYPE
[disallow_recruit]
side={SIDE}
Expand Down Expand Up @@ -237,8 +226,10 @@
first_time_only=no
#dejavu start
{IF ANOreload equals true}
#ifdef __DEBUG__
#ifdef DEBUG_MODE
{IF_DEBUG_MODE_IS_ACTUALLY_ON}
{DEBUGMSG1 "reloaded previous turn (${unpleasant}|:${unpleasant}_times|)"}
{END_IF_WITHOUT_ELSE}
#endif
[fire_event]
name=reload previous turn
Expand All @@ -248,8 +239,10 @@
[/fire_event]
{IF {unpleasant} equals false}
{VARIABLE_OP {unpleasant}_times add 1}
#ifdef __DEBUG__
#ifdef DEBUG_MODE
{IF_DEBUG_MODE_IS_ACTUALLY_ON}
{DEBUGMSG1 "generating event"}
{END_IF_WITHOUT_ELSE}
#endif
[fire_event]
name="unpleasant event avoided with reload"
Expand Down Expand Up @@ -348,8 +341,10 @@
[/store_unit]
{SET_GLOBAL_VARIABLE {variable}_lastkilled_id $tmp.id}
{SET_GLOBAL_VARIABLE {variable}_lastkilled_type $tmp.type}
#ifdef __DEBUG__
#ifdef DEBUG_MODE
{IF_DEBUG_MODE_IS_ACTUALLY_ON}
{DEBUGMSG1 "last {variable}_lastkilled_type $tmp.type"}
{END_IF_WITHOUT_ELSE}
#endif
{CLEAR_VARIABLE tmp}
{SET_GLOBAL_VARIABLE {variable}_turn $turn_number}
Expand All @@ -367,8 +362,10 @@
{GET_GLOBAL_VARIABLE {variable}}
{GLOBAL_VARIABLE_TO_LOCAL {variable}_turn tmp}
{GLOBAL_VARIABLE_TO_LOCAL {variable}_count xyz}
#ifdef __DEBUG__
#ifdef DEBUG_MODE
{IF_DEBUG_MODE_IS_ACTUALLY_ON}
{DEBUGMSG1 "reload to avoid deaths : $xyz until now"}
{END_IF_WITHOUT_ELSE}
#endif
# problem: right now, this event is generated both when player reloads
# during his turn, as well as when he hits end turn and then reloads
Expand Down Expand Up @@ -419,10 +416,12 @@
y=$y1
[/filter]
[/store_unit]
#ifdef __DEBUG__
#ifdef DEBUG_MODE
{IF_DEBUG_MODE_IS_ACTUALLY_ON}
# wmllint: validate-off
{MESSAGE Assassin () () _"getunit $x1 : $y1 : $ano_tmp.description"} # wmllint: ignore
# wmllint: validate-on
{END_IF_WITHOUT_ELSE}
#endif
{MESSAGE Assassin () () _"getunit $x1 : $y1 : $ano_tmp.id"}
[set_variable]
Expand Down Expand Up @@ -491,6 +490,7 @@
[/recall]
#enddef

# TODO: maybe move death macros to a separate file?
#define REME_DEATH_N
[event]
name=last breath
Expand Down Expand Up @@ -579,30 +579,6 @@
[/event]
#enddef

#ifdef __UNUSED__
# wmlscope: start ignoring
#define CHANGE_TYPE DESC VALUE
[store_unit]
[filter]
id={DESC}
[/filter]
kill=yes
variable=ano_change_side_tmp
[/store_unit]
[set_variable]
name=ano_change_side_tmp.type
value={VALUE}
[/set_variable]
[unstore_unit]
variable=ano_change_side_tmp
[/unstore_unit]
[clear_variable]
name=ano_change_side_tmp
[/clear_variable]
#enddef
# wmlscope: stop ignoring
#endif

#define CHANGE_SIDE DESC VALUE
[store_unit]
[filter]
Expand Down Expand Up @@ -644,11 +620,6 @@
#enddef

#define VARUNIT ARRAY INDEX UNIT
#ifdef __UNUSED__
# wmllint: validate-off
{VARIABLE ({ARRAY}[{INDEX}].description) (${UNIT}.description)} # wmllint: ignore
# wmllint: validate-on
#endif
{VARIABLE ({ARRAY}[{INDEX}].id) (${UNIT}.id)}
{VARIABLE ({ARRAY}[{INDEX}].experience) (${UNIT}.experience)}
{VARIABLE ({ARRAY}[{INDEX}].gender) (${UNIT}.gender)}
Expand Down Expand Up @@ -991,17 +962,6 @@
[/filter]
#enddef

#ifdef __UNUSED__
# wmlscope: start ignoring
#define DIE DESC
name=die
[filter]
id={DESC}
[/filter]
#enddef
# wmlscope: stop ignoring
#endif

#define KILLEDBY DESC DESC2
name=last breath
[filter]
Expand Down Expand Up @@ -1195,11 +1155,6 @@
{OP}={WHAT}
side=1
[/filter]
#ifdef __UNUSED__
kill=yes
fire_event=no
animate=no
#endif
[/store_unit]
{MSG_narrator _"The unit $ano_loyal[0].name became LOYAL."}
{VARIABLE (ano_loyal[0].traits_description) ("$ano_loyal[0].traits_description" + _"loyal")}
Expand Down
6 changes: 0 additions & 6 deletions macros/debug.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
description=_"set scenario"
id=set_scenario
[show_if]
# FIXME: menu options don't show up if this check is enabled:
#ifdef __UNUSED__
[lua]
code=<<return wesnoth.game_config.debug_mode>>
[/lua]
#endif
[/show_if]
[command]
[message]
Expand Down
3 changes: 0 additions & 3 deletions macros/items.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

{PICKUPPABLE_ITEM {ID} {X} {Y} (
race=akladian,dwarf,elf,human,dunefolk,lizard
#ifdef __UNUSED__
formula="(self.movement_costs.frozen >= 1)"
#endif
[filter_wml]
[not]
[modifications]
Expand Down
31 changes: 0 additions & 31 deletions macros/messages.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -128,37 +128,6 @@
[/command]
[/option]
#enddef
#ifdef __UNUSED__
# wmlscope: start ignoring
#define MSGOPT2 SPEAKER MSG OPTION1 VAL1 OPTION2 VAL2
[message]
speaker={SPEAKER}
message={MSG}
{MSGOPTION ({OPTION1}) ({VAL1})}
{MSGOPTION ({OPTION2}) ({VAL2})}
[/message]
#enddef
#define MSGOPT3 SPEAKER MSG OPTION1 VAL1 OPTION2 VAL2 OPTION3 VAL3
[message]
speaker={SPEAKER}
message={MSG}
{MSGOPTION ({OPTION1}) ({VAL1})}
{MSGOPTION ({OPTION2}) ({VAL2})}
{MSGOPTION ({OPTION3}) ({VAL3})}
[/message]
#enddef
#define MSGOPT4 SPEAKER MSG OPTION1 VAL1 OPTION2 VAL2 OPTION3 VAL3 OPTION4 VAL4
[message]
speaker={SPEAKER}
message={MSG}
{MSGOPTION ({OPTION1}) ({VAL1})}
{MSGOPTION ({OPTION2}) ({VAL2})}
{MSGOPTION ({OPTION3}) ({VAL3})}
{MSGOPTION ({OPTION4}) ({VAL4})}
[/message]
#enddef
# wmlscope: stop ignoring
#endif
#define MSGOPT5 SPEAKER MSG OPTION1 VAL1 OPTION2 VAL2 OPTION3 VAL3 OPTION4 VAL4 OPTION5 VAL5
[message]
speaker={SPEAKER}
Expand Down
4 changes: 1 addition & 3 deletions scenarios/03_Coronation.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
[story]
[part]
story=_"Carrenemoes have loyally served our kings for generations. I am Reme, son of Raul. My ancestors, according to our family legends, were amongst those who led our people in the great revolt and then in our epic escape through the desert. They established large kingdoms in the lands of underlings, for which we paid a steep price in blood. Now... why do I wonder what was that price paid for?"
#ifdef __UNUSED__
background=story_images/reme_alone.png # still exists in ANO_art repo; removed due to quality
#endif
# TODO: come up with a better version of this to use as a background: https://github.com/cooljeanius/ANO_art/blob/main/stare/story_images/reme/reme_alone.png
[/part]
[part]
story=_"Perhaps it is because of Gawen. Before I began serving his father, I never wondered about the differences between us and underlings. It was simple: God himself gave us this world to rule; everyone else was to serve us. Yet, Gawen Hagarthen is half underling. In fact, he looks a lot like one of them. And he was always more brave and honorable than many Akladians I know... "
Expand Down
28 changes: 8 additions & 20 deletions scenarios/04_Battle_of_Barnon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -493,19 +493,6 @@
{ANO4_TRAITORS _"Blah blah blah; if you are seeing this, you should already know what the deal is."}
[/command]
[/option]
#ifdef __UNUSED__
# FIXME: this one doesn't seem to work:
[option]
# po: debug option; completes sentence starting with "Set scenario status to...":
message=_"Hoyre escaping."
[command]
[fire_event]
name=moveto
id=Hoyre_escapes
[/fire_event]
[/command]
[/option]
#endif
[option]
# po: debug option; completes sentence starting with "Set scenario status to...":
message=_"Uri personally attacking Barnon."
Expand Down Expand Up @@ -725,7 +712,14 @@
{IF_HAVE_UNIT (Hoyre O Barnone)}
# This probably shouldn't ever be reached, but just in case:
{MESSAGE (Hoyre O Barnone) (portraits/hoyre.png) (Hoyre O Barnone) _"Wait a second, something odd seems to be happening here..."}
{FOUR_END_IFs}
{ELSE}
# REALLY shouldn't ever be reached:
{MSG_narrator _"At this moment, Gawen remembered what he was trying to do."}
{TWO_END_IFs}
{END_IF}
{ELSE}
[redraw][/redraw]
{END_IF}
#endif
{ELSE}
{IF ano_tr equals 6} # To make it more certain that Gawen cannot win
Expand Down Expand Up @@ -2003,12 +1997,6 @@
{VARIABLE ano_reload true}
[/event]

#ifdef __UNUSED__
[event]
name=reload to the same turn to avoid losses
[/event]
#endif

[event]
name=new turn
first_time_only=false
Expand Down
3 changes: 0 additions & 3 deletions scenarios/05_The_Swamp_Things.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@
##

{FOREACH ano_units i}
#ifdef __UNUSED__
{VARTOUNIT ano_units $i 1 1 1}
#endif
[set_variable]
name=ano_units[$i].hitpoints
value=$ano_units[$i].max_hitpoints
Expand Down
3 changes: 0 additions & 3 deletions scenarios/05_Unexpected_Guests.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@
{END_IF_WITHOUT_ELSE}
##
{FOREACH ano_units i}
#ifdef __UNUSED__
{VARTOUNIT ano_units $i 1 1 1}
#endif
[set_variable]
name=ano_units[$i].hitpoints
value=$ano_units[$i].max_hitpoints
Expand Down
7 changes: 5 additions & 2 deletions scenarios/06_Separation.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
amount=20 # i.e. just enough to refund the price of a recall
side=1
[/gold]
#ifdef __UNUSED__
#ifdef DEBUG_MODE
{IF_DEBUG_MODE_IS_ACTUALLY_ON}
{MSG_Reme _"You have already recruited $ano_tmp| units."}
{END_IF_WITHOUT_ELSE}
#endif
[if]
{CONDITION ano_tmp equals 5}
Expand Down Expand Up @@ -169,12 +171,13 @@
{CLEAR_VARIABLE ano_reme_stored}
{CLEAR_VARIABLE ano_lorin_stored}
{CLEAR_VARIABLE ano_lorin_units}
#ifdef __UNUSED__
#ifdef LET_REME_KEEP_UNITS
# TODO: see if this can be un-ifdef-ed?
{RECALL_AND_STORE_ALL ano_reme_units}
#endif
{CLEAR_VARIABLE ano_tmp}
{ELSE}
# (???)
{END_IF}
[endlevel]
result=victory
Expand Down
Loading