Implement no-icon directive,
telling the cross-reference generator not to look for an attack icon.
This commit is contained in:
parent
a735324f4d
commit
396c227db6
4 changed files with 11 additions and 6 deletions
|
@ -118,7 +118,7 @@
|
|||
unit_description= _ "The evil queen mother Asheviere has terrorized Wesnoth for many years. Her knowledge of magic makes her a worthy foe in combat, although her power is mostly derived from those she commands."
|
||||
die_sound={SOUND_LIST:HUMAN_FEMALE_DIE}
|
||||
[attack]
|
||||
name=dummy
|
||||
name=dummy # wmllint: no-icon
|
||||
description= _"dummy"
|
||||
type=impact
|
||||
range=melee
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
usage=null
|
||||
unit_description= _ "Elves choose their leaders for their power and wisdom; foresight is what has protected them in times of uncertainty. Their just reign is rewarded by the unflagging fealty of their people, which is the greatest gift any ruler could ask for."
|
||||
[attack]
|
||||
name=dummy
|
||||
name=dummy # wmllint: no-icon
|
||||
description= _"dummy"
|
||||
type=impact
|
||||
range=melee
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
usage=null
|
||||
hide_help=true
|
||||
[attack]
|
||||
name=dummy
|
||||
name=dummy # wmllint: no-icon
|
||||
description= _"dummy"
|
||||
type=impact
|
||||
range=melee
|
||||
|
|
|
@ -214,8 +214,12 @@ class CrossRef:
|
|||
formals = line.split()[2:]
|
||||
elif line.startswith("#enddef"):
|
||||
formals = []
|
||||
comment = ""
|
||||
if '#' in line:
|
||||
line = line.split('#')[0]
|
||||
fields = line.split('#')
|
||||
line = fields[0]
|
||||
if len(fields) > 1:
|
||||
comment = fields[1]
|
||||
if not line:
|
||||
continue
|
||||
# Find references to macros
|
||||
|
@ -262,13 +266,14 @@ class CrossRef:
|
|||
if len(candidates) > 1:
|
||||
print "%s: more than one definition of %s is visible here (%s)." % (Reference(fn, n), name, ", ".join(candidates))
|
||||
if not key:
|
||||
self.missing.append((name, Reference(fn,n+1))) # Notice implicit references through attacks
|
||||
self.missing.append((name, Reference(fn,n+1)))
|
||||
# Notice implicit references through attacks
|
||||
if state == "outside":
|
||||
if "[attack]" in line:
|
||||
beneath = 0
|
||||
attack_name = default_icon = None
|
||||
have_icon = False
|
||||
elif "name=" in line:
|
||||
elif "name=" in line and not "no-icon" in comment:
|
||||
attack_name = line[line.find("name=")+5:].strip()
|
||||
default_icon = os.path.join("attacks", attack_name + ".png")
|
||||
elif "icon=" in line and beneath == 0:
|
||||
|
|
Loading…
Add table
Reference in a new issue