Skip to content

Commit 78127ee

Browse files
committed
Add texts from scripts to texts.csv
All scripts except for tower/item scripts Remove unused f-n get_creep_info()
1 parent 7604655 commit 78127ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+369
-329
lines changed

assets/texts/texts_history.csv

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
"23.03.2025","kevl","MESSAGE_WELCOME_1-COMMAND_RANGE_CHECK_DISABLE","Added untranslated texts for messages, error messages and chat command texts."
99
"23.03.2025","kevl","YQK4-OEII","Added untranslated texts for multiboard labels."
1010
"24.03.2025","lichcay","START_BUTTON - GAME_STATUS_BUILDER"."Changed cn->zh to match with locale string. Added translations for texts in scene files."
11+
"26.03.2025","kevl","TOWER_ATTACK_ABILITY_TITLE - UPGRADE_TOWER_BUTTON_CANNOT_UPGRADE"."Add untranslated texts from all script files, except for tower/item scripts."

src/buffs/modification.gd

+58-58
Original file line numberDiff line numberDiff line change
@@ -448,64 +448,64 @@ func _format_percentage(value: float) -> String:
448448

449449
func _get_type_name() -> String:
450450
match type:
451-
Type.MOD_ARMOR: return "armor"
452-
Type.MOD_ARMOR_PERC: return "armor"
453-
Type.MOD_EXP_GRANTED: return "experience granted"
454-
Type.MOD_EXP_RECEIVED: return "experience received"
455-
Type.MOD_SPELL_DAMAGE_RECEIVED: return "spell damage received"
456-
Type.MOD_SPELL_DAMAGE_DEALT: return "spell damage dealt"
457-
Type.MOD_SPELL_CRIT_DAMAGE: return "spell crit damage"
458-
Type.MOD_SPELL_CRIT_CHANCE: return "spell crit chance"
459-
Type.MOD_BOUNTY_GRANTED: return "bounty granted"
460-
Type.MOD_BOUNTY_RECEIVED: return "bounty received"
461-
Type.MOD_ATK_CRIT_CHANCE: return "crit chance"
462-
Type.MOD_ATK_CRIT_DAMAGE: return "crit damage"
463-
Type.MOD_ATK_DAMAGE_RECEIVED: return "attack damage received"
464-
Type.MOD_ATTACKSPEED: return "attack speed"
465-
Type.MOD_MULTICRIT_COUNT: return "multicrit"
466-
Type.MOD_ITEM_CHANCE_ON_KILL: return "item chance"
467-
Type.MOD_ITEM_QUALITY_ON_KILL: return "item quality"
468-
Type.MOD_ITEM_CHANCE_ON_DEATH: return "item chance"
469-
Type.MOD_ITEM_QUALITY_ON_DEATH: return "item quality"
470-
Type.MOD_BUFF_DURATION: return "buff duration"
471-
Type.MOD_DEBUFF_DURATION: return "debuff duration"
472-
Type.MOD_TRIGGER_CHANCES: return "trigger chances"
473-
Type.MOD_MOVESPEED: return "movement speed"
474-
Type.MOD_MOVESPEED_ABSOLUTE: return "movement speed"
475-
Type.MOD_DAMAGE_BASE: return "base damage"
476-
Type.MOD_DAMAGE_BASE_PERC: return "base damage"
477-
Type.MOD_DAMAGE_ADD: return "attack damage"
478-
Type.MOD_DAMAGE_ADD_PERC: return "attack damage"
479-
Type.MOD_DPS_ADD: return "DPS"
480-
Type.MOD_HP: return "health"
481-
Type.MOD_HP_PERC: return "health"
482-
Type.MOD_HP_REGEN: return "health regen"
483-
Type.MOD_HP_REGEN_PERC: return "health regen"
484-
Type.MOD_MANA: return "mana"
485-
Type.MOD_MANA_PERC: return "mana"
486-
Type.MOD_MANA_REGEN: return "mana regen"
487-
Type.MOD_MANA_REGEN_PERC: return "mana regen"
488-
489-
Type.MOD_DMG_TO_MASS: return "damage to masses"
490-
Type.MOD_DMG_TO_NORMAL: return "damage to normals"
491-
Type.MOD_DMG_TO_CHAMPION: return "damage to champions"
492-
Type.MOD_DMG_TO_BOSS: return "damage to bosses"
493-
Type.MOD_DMG_TO_AIR: return "damage to air"
494-
495-
Type.MOD_DMG_TO_UNDEAD: return "damage to undead"
496-
Type.MOD_DMG_TO_MAGIC: return "damage to magic"
497-
Type.MOD_DMG_TO_NATURE: return "damage to nature"
498-
Type.MOD_DMG_TO_ORC: return "damage to orcs"
499-
Type.MOD_DMG_TO_HUMANOID: return "damage to humanoids"
500-
Type.MOD_DMG_TO_CHALLENGE: return "damage to challenge"
501-
502-
Type.MOD_DMG_FROM_ASTRAL: return "damage from astral"
503-
Type.MOD_DMG_FROM_DARKNESS: return "damage from darkness"
504-
Type.MOD_DMG_FROM_NATURE: return "damage from nature"
505-
Type.MOD_DMG_FROM_FIRE: return "damage from fire"
506-
Type.MOD_DMG_FROM_ICE: return "damage from ice"
507-
Type.MOD_DMG_FROM_STORM: return "damage from storm"
508-
Type.MOD_DMG_FROM_IRON: return "damage from iron"
451+
Type.MOD_ARMOR: return tr("MOD_ARMOR_TEXT")
452+
Type.MOD_ARMOR_PERC: return tr("MOD_ARMOR_PERC_TEXT")
453+
Type.MOD_EXP_GRANTED: return tr("MOD_EXP_GRANTED_TEXT")
454+
Type.MOD_EXP_RECEIVED: return tr("MOD_EXP_RECEIVED_TEXT")
455+
Type.MOD_SPELL_DAMAGE_RECEIVED: return tr("MOD_SPELL_DAMAGE_RECEIVED_TEXT")
456+
Type.MOD_SPELL_DAMAGE_DEALT: return tr("MOD_SPELL_DAMAGE_DEALT_TEXT")
457+
Type.MOD_SPELL_CRIT_DAMAGE: return tr("MOD_SPELL_CRIT_DAMAGE_TEXT")
458+
Type.MOD_SPELL_CRIT_CHANCE: return tr("MOD_SPELL_CRIT_CHANCE_TEXT")
459+
Type.MOD_BOUNTY_GRANTED: return tr("MOD_BOUNTY_GRANTED_TEXT")
460+
Type.MOD_BOUNTY_RECEIVED: return tr("MOD_BOUNTY_RECEIVED_TEXT")
461+
Type.MOD_ATK_CRIT_CHANCE: return tr("MOD_ATK_CRIT_CHANCE_TEXT")
462+
Type.MOD_ATK_CRIT_DAMAGE: return tr("MOD_ATK_CRIT_DAMAGE_TEXT")
463+
Type.MOD_ATK_DAMAGE_RECEIVED: return tr("MOD_ATK_DAMAGE_RECEIVED_TEXT")
464+
Type.MOD_ATTACKSPEED: return tr("MOD_ATTACKSPEED_TEXT")
465+
Type.MOD_MULTICRIT_COUNT: return tr("MOD_MULTICRIT_COUNT_TEXT")
466+
Type.MOD_ITEM_CHANCE_ON_KILL: return tr("MOD_ITEM_CHANCE_ON_KILL_TEXT")
467+
Type.MOD_ITEM_QUALITY_ON_KILL: return tr("MOD_ITEM_QUALITY_ON_KILL_TEXT")
468+
Type.MOD_ITEM_CHANCE_ON_DEATH: return tr("MOD_ITEM_CHANCE_ON_DEATH_TEXT")
469+
Type.MOD_ITEM_QUALITY_ON_DEATH: return tr("MOD_ITEM_QUALITY_ON_DEATH_TEXT")
470+
Type.MOD_BUFF_DURATION: return tr("MOD_BUFF_DURATION_TEXT")
471+
Type.MOD_DEBUFF_DURATION: return tr("MOD_DEBUFF_DURATION_TEXT")
472+
Type.MOD_TRIGGER_CHANCES: return tr("MOD_TRIGGER_CHANCES_TEXT")
473+
Type.MOD_MOVESPEED: return tr("MOD_MOVESPEED_TEXT")
474+
Type.MOD_MOVESPEED_ABSOLUTE: return tr("MOD_MOVESPEED_ABSOLUTE_TEXT")
475+
Type.MOD_DAMAGE_BASE: return tr("MOD_DAMAGE_BASE_TEXT")
476+
Type.MOD_DAMAGE_BASE_PERC: return tr("MOD_DAMAGE_BASE_PERC_TEXT")
477+
Type.MOD_DAMAGE_ADD: return tr("MOD_DAMAGE_ADD_TEXT")
478+
Type.MOD_DAMAGE_ADD_PERC: return tr("MOD_DAMAGE_ADD_PERC_TEXT")
479+
Type.MOD_DPS_ADD: return tr("MOD_DPS_ADD_TEXT")
480+
Type.MOD_HP: return tr("MOD_HP_TEXT")
481+
Type.MOD_HP_PERC: return tr("MOD_HP_PERC_TEXT")
482+
Type.MOD_HP_REGEN: return tr("MOD_HP_REGEN_TEXT")
483+
Type.MOD_HP_REGEN_PERC: return tr("MOD_HP_REGEN_PERC_TEXT")
484+
Type.MOD_MANA: return tr("MOD_MANA_TEXT")
485+
Type.MOD_MANA_PERC: return tr("MOD_MANA_PERC_TEXT")
486+
Type.MOD_MANA_REGEN: return tr("MOD_MANA_REGEN_TEXT")
487+
Type.MOD_MANA_REGEN_PERC: return tr("MOD_MANA_REGEN_PERC_TEXT")
488+
489+
Type.MOD_DMG_TO_MASS: return tr("MOD_DMG_TO_MASS_TEXT")
490+
Type.MOD_DMG_TO_NORMAL: return tr("MOD_DMG_TO_NORMAL_TEXT")
491+
Type.MOD_DMG_TO_CHAMPION: return tr("MOD_DMG_TO_CHAMPION_TEXT")
492+
Type.MOD_DMG_TO_BOSS: return tr("MOD_DMG_TO_BOSS_TEXT")
493+
Type.MOD_DMG_TO_AIR: return tr("MOD_DMG_TO_AIR_TEXT")
494+
495+
Type.MOD_DMG_TO_UNDEAD: return tr("MOD_DMG_TO_UNDEAD_TEXT")
496+
Type.MOD_DMG_TO_MAGIC: return tr("MOD_DMG_TO_MAGIC_TEXT")
497+
Type.MOD_DMG_TO_NATURE: return tr("MOD_DMG_TO_NATURE_TEXT")
498+
Type.MOD_DMG_TO_ORC: return tr("MOD_DMG_TO_ORC_TEXT")
499+
Type.MOD_DMG_TO_HUMANOID: return tr("MOD_DMG_TO_HUMANOID_TEXT")
500+
Type.MOD_DMG_TO_CHALLENGE: return tr("MOD_DMG_TO_CHALLENGE_TEXT")
501+
502+
Type.MOD_DMG_FROM_ASTRAL: return tr("MOD_DMG_FROM_ASTRAL_TEXT")
503+
Type.MOD_DMG_FROM_DARKNESS: return tr("MOD_DMG_FROM_DARKNESS_TEXT")
504+
Type.MOD_DMG_FROM_NATURE: return tr("MOD_DMG_FROM_NATURE_TEXT")
505+
Type.MOD_DMG_FROM_FIRE: return tr("MOD_DMG_FROM_FIRE_TEXT")
506+
Type.MOD_DMG_FROM_ICE: return tr("MOD_DMG_FROM_ICE_TEXT")
507+
Type.MOD_DMG_FROM_STORM: return tr("MOD_DMG_FROM_STORM_TEXT")
508+
Type.MOD_DMG_FROM_IRON: return tr("MOD_DMG_FROM_IRON_TEXT")
509509

510510
push_error("Unhandled type: ", type)
511511

src/builders/instances/builder_backpacker.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ func backpacker_bt_periodic(event: Event):
3939
dropped_items = true
4040

4141
if dropped_items:
42-
tower.get_player().display_floating_text("Backpacker: Item must have same rarity as tower!", tower, Color.RED)
42+
tower.get_player().display_floating_text(tr("BUILDER_BACKPACKER_ERROR_TEXT"), tower, Color.RED)

src/creeps/creep.gd

+6-10
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func _deal_damage_to_portal():
345345
var damage_done: float = get_damage_done()
346346
var damage_done_string: String = Utils.format_percent(damage_done, 2)
347347
var creep_size: CreepSize.enm = get_size_including_challenge_sizes()
348-
var creep_size_string: String = CreepSize.convert_to_string(creep_size)
348+
var creep_size_string: String = CreepSize.get_display_string(creep_size)
349349
var creep_score: float = get_score(Globals.get_difficulty(), Globals.get_wave_count(), Globals.get_game_mode())
350350

351351
var player: Player = get_player()
@@ -494,7 +494,7 @@ func get_base_bounty_value() -> float:
494494

495495

496496
func get_log_name() -> String:
497-
var size_name: String = CreepSize.convert_to_string(_size)
497+
var size_name: String = CreepSize.get_display_string(_size)
498498
var log_name: String = "%s-%d" % [size_name, get_uid()]
499499

500500
return log_name
@@ -560,7 +560,7 @@ func get_armor_type() -> ArmorType.enm:
560560
return _armor_type
561561

562562
func get_display_name() -> String:
563-
return "Generic Creep"
563+
return tr("CREEP_GENERIC_NAME")
564564

565565

566566
func get_move_path() -> Path2D:
@@ -583,16 +583,12 @@ func get_ability_button_data_list() -> Array[AbilityButton.Data]:
583583
var list: Array[AbilityButton.Data] = []
584584

585585
var armor_type: ArmorType.enm = get_armor_type()
586-
var armor_type_name: String = ArmorType.convert_to_string(armor_type).capitalize()
586+
var armor_type_name: String = ArmorType.get_display_string(armor_type)
587587
var armor_type_name_colored: String = ArmorType.convert_to_colored_string(armor_type)
588588
var armor_type_damage_taken: String = ArmorType.get_rich_text_for_damage_taken(armor_type)
589-
var armor_type_description: String = "Armor type: %s\n" % armor_type_name_colored \
590-
+ " \n" \
591-
+ "Damage from:\n" \
592-
+ " \n" \
593-
+ "%s\n" % armor_type_damage_taken
589+
var armor_type_description: String = tr("CREEP_ARMOR_ABILITY_DESCRIPTION").format({ARMOR_TYPE = armor_type_name_colored, DAMAGE_FROM_TEXT = armor_type_damage_taken})
594590
var armor_type_ability: AbilityButton.Data = AbilityButton.Data.new()
595-
armor_type_ability.ability_name = "%s armor" % armor_type_name
591+
armor_type_ability.ability_name = tr("CREEP_ARMOR_ABILITY_TITLE").format({ARMOR_TYPE = armor_type_name})
596592
armor_type_ability.icon = "res://resources/icons/shields/shield_green.tres"
597593
armor_type_ability.description_long = armor_type_description
598594
list.append(armor_type_ability)

src/creeps/special_buffs/creep_evasion.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ static func evasion_effect(event: Event, chance: float):
1818

1919
if evade_success && !event.is_spell_damage():
2020
event.damage = 0
21-
tower.get_player().display_floating_text_x("Miss", tower, Color.RED, 0.05, 0.0, 2.0)
21+
tower.get_player().display_floating_text_x(Utils.tr("FLOATING_TEXT_MISS"), tower, Color.RED, 0.05, 0.0, 2.0)

src/creeps/special_buffs/creep_second_chance.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func on_damaged(event: Event):
2121
creep.set_health_over_max(life_after_heal)
2222
var mana_to_subtract: float = creep.get_overall_mana() / 3
2323
creep.subtract_mana(mana_to_subtract, false)
24-
creep.get_player().display_floating_text("Second chance!", creep, Color.RED)
24+
creep.get_player().display_floating_text(tr("CREEP_SPECIAL_SECOND_CHANCE"), creep, Color.RED)
2525

2626
# NOTE: this is how it works in original game. Need to
2727
# modify lowest health so that the creep deals less

src/creeps/wave.gd

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func get_creep_count() -> int:
133133
func get_creep_combination_string() -> String:
134134
var is_final_boss: bool = _level == Utils.get_max_level()
135135
if is_final_boss:
136-
return "[color=GOLD]Final Boss[/color]"
136+
return "[color=GOLD]%S[/color]" % tr("FINAL_BOSS_TEXT")
137137

138138
var size_count_map: Dictionary = {}
139139

@@ -458,6 +458,9 @@ static func get_scene_name_for_creep_type(creep_size: CreepSize.enm, creep_race:
458458
elif creep_size == CreepSize.enm.CHALLENGE_MASS:
459459
return "ChallengeMass"
460460

461+
# NOTE: must use convert_to_string() which is non-display
462+
# string here because this is for filename, so no
463+
# translation needed!
461464
var creep_size_string: String = CreepSize.convert_to_string(creep_size)
462465
var creep_race_string: String = CreepCategory.convert_to_string(creep_race)
463466
# NOTE: currently, all creep races use orc scenes. Loading

src/creeps/wave_spawner.gd

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ func _print_wave_info():
101101
else:
102102
specials_string = "none"
103103

104-
print("Wave [%s] will have creeps [%s] of race [%s] and armor type [%s]" % [wave_level, creep_combination_string, CreepCategory.convert_to_string(wave.get_race()), ArmorType.convert_to_string(wave.get_armor_type())])
104+
print("Wave [%s] will have creeps [%s] of race [%s] and armor type [%s]" % [wave_level, creep_combination_string, CreepCategory.get_display_string(wave.get_race()), ArmorType.get_display_string(wave.get_armor_type())])
105105
print(" Specials: %s" % specials_string)
106106

107107
var creep_size_list: Array = wave.get_creep_sizes()
108108

109109
for creep_size in creep_size_list:
110110
var creep_health: float = CreepSpawner.get_creep_health(wave, creep_size)
111-
var creep_size_string: String = CreepSize.convert_to_string(creep_size)
111+
var creep_size_string: String = CreepSize.get_display_string(creep_size)
112112
print("%s's HP: %s" % [creep_size_string, creep_health])
113113

114114
# NOTE: need to add delay between prints to avoid

src/enums/armor_type.gd

+18-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,22 @@ static func convert_to_string(type: ArmorType.enm) -> String:
5252
return _string_map[type]
5353

5454

55+
static func get_display_string(type: ArmorType.enm) -> String:
56+
var string: String
57+
match type:
58+
ArmorType.enm.HEL: string = Utils.tr("ARMOR_TYPE_HEL")
59+
ArmorType.enm.MYT: string = Utils.tr("ARMOR_TYPE_MYT")
60+
ArmorType.enm.LUA: string = Utils.tr("ARMOR_TYPE_LUA")
61+
ArmorType.enm.SOL: string = Utils.tr("ARMOR_TYPE_SOL")
62+
ArmorType.enm.SIF: string = Utils.tr("ARMOR_TYPE_SIF")
63+
ArmorType.enm.ZOD: string = Utils.tr("ARMOR_TYPE_ZOD")
64+
65+
return string
66+
67+
68+
# TODO: rename to "get_colored_display_string()"
5569
static func convert_to_colored_string(type: ArmorType.enm) -> String:
56-
var string: String = convert_to_string(type).capitalize()
70+
var string: String = get_display_string(type)
5771
var color: Color = _color_map[type]
5872
var out: String = Utils.get_colored_string(string, color)
5973

@@ -72,15 +86,15 @@ static func get_text_for_damage_taken(armor_type: ArmorType.enm) -> String:
7286
var attack_type_list: Array[AttackType.enm] = AttackType.get_list()
7387

7488
for attack_type in attack_type_list:
75-
var attack_type_name: String = AttackType.convert_to_string(attack_type).capitalize()
89+
var attack_type_name: String = AttackType.get_display_string(attack_type)
7690
var damage_taken: float = AttackType.get_damage_against(attack_type, armor_type)
7791
var damage_taken_string: String = Utils.format_percent(damage_taken, 2)
7892

7993
text += "%s:\t %s\n" % [attack_type_name, damage_taken_string]
8094

8195
var spell_damage_taken: float = ArmorType.get_spell_damage_taken(armor_type)
8296
var spell_damage_taken_string: String = Utils.format_percent(spell_damage_taken, 2)
83-
text += "Spell Damage:\t %s\n" % [spell_damage_taken_string]
97+
text += Utils.tr("ARMOR_SPELL_DAMAGE_TAKEN") + "\t %s\n" % [spell_damage_taken_string]
8498

8599
return text
86100

@@ -99,7 +113,7 @@ static func get_rich_text_for_damage_taken(armor_type: ArmorType.enm) -> String:
99113

100114
var spell_damage_taken: float = ArmorType.get_spell_damage_taken(armor_type)
101115
var spell_damage_taken_string: String = Utils.format_percent(spell_damage_taken, 2)
102-
text += "Spell Damage:\t %s\n" % [spell_damage_taken_string]
116+
text += Utils.tr("ARMOR_SPELL_DAMAGE_TAKEN") + "\t %s\n" % [spell_damage_taken_string]
103117

104118
text = RichTexts.add_color_to_numbers(text)
105119

src/enums/attack_type.gd

+16-2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,19 @@ static func from_string(string: String) -> AttackType.enm:
118118
return AttackType.enm.PHYSICAL
119119

120120

121+
static func get_display_string(type: AttackType.enm) -> String:
122+
var string: String
123+
match type:
124+
AttackType.enm.PHYSICAL: string = Utils.tr("ATTACK_TYPE_PHYSICAL")
125+
AttackType.enm.DECAY: string = Utils.tr("ATTACK_TYPE_DECAY")
126+
AttackType.enm.ENERGY: string = Utils.tr("ATTACK_TYPE_ENERGY")
127+
AttackType.enm.ESSENCE: string = Utils.tr("ATTACK_TYPE_ESSENCE")
128+
AttackType.enm.ELEMENTAL: string = Utils.tr("ATTACK_TYPE_ELEMENTAL")
129+
AttackType.enm.ARCANE: string = Utils.tr("ATTACK_TYPE_ARCANE")
130+
131+
return string
132+
133+
121134
# NOTE: AttackType.PHYSICAL.getDamageAgainst() in JASS
122135
static func get_damage_against(attack_type: AttackType.enm, armor_type: ArmorType.enm) -> float:
123136
var damage: float = _damage_to_armor_map[attack_type][armor_type]
@@ -129,8 +142,9 @@ static func deals_no_damage_to_immune(attack_type: AttackType.enm) -> bool:
129142
return _no_damage_to_immune_map[attack_type]
130143

131144

145+
# TODO: rename to "get_colored_display_string()"
132146
static func convert_to_colored_string(type: AttackType.enm) -> String:
133-
var string: String = convert_to_string(type).capitalize()
147+
var string: String = get_display_string(type)
134148
var color: Color = _color_map[type]
135149
var out: String = Utils.get_colored_string(string, color)
136150

@@ -157,7 +171,7 @@ static func get_rich_text_for_damage_dealt(attack_type: AttackType.enm) -> Strin
157171
text += "%s:\t %s\n" % [armor_type_name, damage_dealt_string]
158172

159173
if attack_type == AttackType.enm.ARCANE:
160-
text += "[color=RED]Cannot hit Immune creeps![/color]\n"
174+
text += "[color=RED]%s[/color]\n" % Utils.tr("ATTACK_TYPE_CANNOT_HIT_IMMUNE")
161175

162176
text = RichTexts.add_color_to_numbers(text)
163177

src/enums/creep_category.gd

+14-1
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,27 @@ static func convert_to_string(type: CreepCategory.enm) -> String:
5757
return _string_map[type]
5858

5959

60+
static func get_display_string(type: CreepCategory.enm) -> String:
61+
var string: String
62+
match type:
63+
CreepCategory.enm.UNDEAD: string = Utils.tr("CREEP_CATEGORY_UNDEAD")
64+
CreepCategory.enm.MAGIC: string = Utils.tr("CREEP_CATEGORY_MAGIC")
65+
CreepCategory.enm.NATURE: string = Utils.tr("CREEP_CATEGORY_NATURE")
66+
CreepCategory.enm.ORC: string = Utils.tr("CREEP_CATEGORY_ORC")
67+
CreepCategory.enm.HUMANOID: string = Utils.tr("CREEP_CATEGORY_HUMANOID")
68+
CreepCategory.enm.CHALLENGE: string = Utils.tr("CREEP_CATEGORY_CHALLENGE")
69+
70+
return string
71+
72+
6073
static func get_color(type: CreepCategory.enm) -> Color:
6174
var color: Color = _color_map[type]
6275

6376
return color
6477

6578

6679
static func convert_to_colored_string(type: CreepCategory.enm) -> String:
67-
var string: String = convert_to_string(type).capitalize()
80+
var string: String = get_display_string(type)
6881
var color: Color = _color_map[type]
6982
var out: String = Utils.get_colored_string(string, color)
7083

src/enums/creep_size.gd

+15-1
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,22 @@ static func convert_to_string(type: CreepSize.enm) -> String:
155155
return _string_map[type]
156156

157157

158+
static func get_display_string(type: CreepSize.enm) -> String:
159+
var string: String
160+
match type:
161+
CreepSize.enm.MASS: string = Utils.tr("CREEP_SIZE_MASS")
162+
CreepSize.enm.NORMAL: string = Utils.tr("CREEP_SIZE_NORMAL")
163+
CreepSize.enm.AIR: string = Utils.tr("CREEP_SIZE_AIR")
164+
CreepSize.enm.CHAMPION: string = Utils.tr("CREEP_SIZE_CHAMPION")
165+
CreepSize.enm.BOSS: string = Utils.tr("CREEP_SIZE_BOSS")
166+
CreepSize.enm.CHALLENGE_MASS: string = Utils.tr("CREEP_SIZE_CHALLENGE_MASS")
167+
CreepSize.enm.CHALLENGE_BOSS: string = Utils.tr("CREEP_SIZE_CHALLENGE_BOSS")
168+
169+
return string
170+
171+
158172
static func convert_to_colored_string(type: CreepSize.enm) -> String:
159-
var string: String = convert_to_string(type).capitalize()
173+
var string: String = get_display_string(type)
160174
var color: Color = _color_map[type]
161175
var out: String = Utils.get_colored_string(string, color)
162176

0 commit comments

Comments
 (0)