diff --git a/src/dusk/randomizer/game/randomizer_context.cpp b/src/dusk/randomizer/game/randomizer_context.cpp index b488a2f5c5..d164614296 100644 --- a/src/dusk/randomizer/game/randomizer_context.cpp +++ b/src/dusk/randomizer/game/randomizer_context.cpp @@ -1272,7 +1272,7 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) { auto language = randomizer::Text::ENGLISH; std::string text; if (world->GetTextDatabase().contains(name)) { - text = world->GetDynamicTextStr(name); + text = world->GetText(name); } else { text = randomizer::getTextStr(name); } diff --git a/src/dusk/randomizer/generator/data/text/languages/english.yaml b/src/dusk/randomizer/generator/data/text/languages/english.yaml index f200db2e44..f20a51297a 100644 --- a/src/dusk/randomizer/generator/data/text/languages/english.yaml +++ b/src/dusk/randomizer/generator/data/text/languages/english.yaml @@ -1,3 +1,1506 @@ +# This file contains all custom english text for the dusklight randomizer + +# ITEM NAMES +Green Rupee: + Standard: + Text: Green Rupee + Pretty: + Text: a {Green Rupee} + Cryptic: + Text: a {penny} + +Blue Rupee: + Standard: + Text: Blue Rupee + Pretty: + Text: a {Blue Rupee} + Cryptic: + Text: a {fiver} + +Yellow Rupee: + Standard: + Text: Yellow Rupee + Pretty: + Text: a {Yellow Rupee} + Cryptic: + Text: some {change} + +Red Rupee: + Standard: + Text: Red Rupee + Pretty: + Text: a {Red Rupee} + Cryptic: + Text: "{couch cash}" + +Purple Rupee: + Standard: + Text: Purple Rupee + Pretty: + Text: a {Purple Rupee} + Cryptic: + Text: a {good sum} + +Orange Rupee: + Standard: + Text: Orange Rupee + Pretty: + Text: an {Orange Rupee} + Cryptic: + Text: a {payday} + +Silver Rupee: + Standard: + Text: Silver Rupee + Pretty: + Text: a {Silver Rupee} + Cryptic: + Text: "{many riches}" + +Bombs 5: + Standard: + Text: Bombs 5 + Pretty: + Text: "{Bombs (5)}" + Plurality: Plural + Cryptic: + Text: some {regular explosives} + Plurality: Plural + +Bombs 10: + Standard: + Text: Bombs 10 + Pretty: + Text: "{Bombs (10)}" + Plurality: Plural + Cryptic: + Text: some {regular explosives} + Plurality: Plural + +Bombs 20: + Standard: + Text: Bombs 20 + Pretty: + Text: "{Bombs (20)}" + Plurality: Plural + Cryptic: + Text: some {regular explosives} + Plurality: Plural + +Bombs 30: + Standard: + Text: Bombs 30 + Pretty: + Text: "{Bombs (30)}" + Plurality: Plural + Cryptic: + Text: some {regular explosives} + Plurality: Plural + +Arrows 10: + Standard: + Text: Arrows 10 + Pretty: + Text: "{Arrows (10)}" + Plurality: Plural + Cryptic: + Text: some {thin ammo} + +Arrows 20: + Standard: + Text: Arrows 20 + Pretty: + Text: "{Arrows (20)}" + Plurality: Plural + Cryptic: + Text: some {thin ammo} + +Arrows 30: + Standard: + Text: Arrows 30 + Pretty: + Text: "{Arrows (30)}" + Plurality: Plural + Cryptic: + Text: some {thin ammo} + +Seeds 50: + Standard: + Text: Seeds 50 + Pretty: + Text: "{Seeds (50)}" + Plurality: Plural + Cryptic: + Text: some {pellets} + Plurality: Plural + +Foolish Item: + Standard: + Text: Foolish Item + Pretty: + Text: a {Foolish Item} + Plurality: Singular + Cryptic: + Text: a {chilly surprise} + Plurality: Singular + +Ordon Spring Portal: + Standard: + Text: Ordon Spring Portal + Pretty: + Text: the {Ordon Spring Portal} + Cryptic: + Text: a {portal} to {home} + +South Faron Portal: + Standard: + Text: South Faron Portal + Pretty: + Text: the {South Faron Portal} + Cryptic: + Text: a {portal} to a {forest clearing} + +Water Bombs 5: + Standard: + Text: Water Bombs 5 + Pretty: + Text: "{Water Bombs (5)}" + Plurality: Plural + Cryptic: + Text: some {water explosives} + Plurality: Plural + +Water Bombs 10: + Standard: + Text: Water Bombs 10 + Pretty: + Text: "{Water Bombs (10)}" + Plurality: Plural + Cryptic: + Text: some {water explosives} + Plurality: Plural + +Water Bombs 15: + Standard: + Text: Water Bombs 15 + Pretty: + Text: "{Water Bombs (15)}" + Plurality: Plural + Cryptic: + Text: some {water explosives} + Plurality: Plural + +Bomblings 5: + Standard: + Text: Bomblings 5 + Pretty: + Text: "{Bomblings (5)}" + Plurality: Plural + Cryptic: + Text: some {crawling explosives} + Plurality: Plural + +Bomblings 10: + Standard: + Text: Bomblings 10 + Pretty: + Text: "{Bomblings (10)}" + Plurality: Plural + Cryptic: + Text: some {crawling explosives} + Plurality: Plural + +Piece of Heart: + Standard: + Text: Piece of Heart + Pretty: + Text: a {Piece of Heart} + Cryptic: + Text: some {love} + +Heart Container: + Standard: + Text: Heart Container + Pretty: + Text: a {Heart Container} + Cryptic: + Text: a {lot of love} + +Ordon Shield: + Standard: + Text: Ordon Shield + Pretty: + Text: the {Ordon Shield} + Cryptic: + Text: a {sturdy reminder of home} + +Wooden Shield: + Standard: + Text: Wooden Shield + Pretty: + Text: a {Wooden Shield} + Cryptic: + Text: a {wood protector} + +Hylian Shield: + Standard: + Text: Hylian Shield + Pretty: + Text: the {Hylian Shield} + Cryptic: + Text: an {unbreakable shield} + +Magic Armor: + Standard: + Text: Magic Armor + Pretty: + Text: the {Magic Armor} + Cryptic: + Text: "{magical clothing}" + +Zora Armor: + Standard: + Text: Zora Armor + Pretty: + Text: the {Zora Armor} + Cryptic: + Text: the {fish suit} + +Shadow Crystal: + Standard: + Text: Shadow Crystal + Pretty: + Text: the {Shadow Crystal} + Cryptic: + Text: a {crystal of dark power} + +Progressive Wallet: + Standard: + Text: Progressive Wallet + Pretty: + Text: a {Wallet} + Cryptic: + Text: a {money bag} + +Upper Zoras River Portal: + Standard: + Text: Upper Zoras River Portal + Pretty: + Text: the {Upper Zoras River Portal} + Cryptic: + Text: a {portal} to some {raging rapids} + +Castle Town Portal: + Standard: + Text: Castle Town Portal + Pretty: + Text: the {Castle Town Portal} + Cryptic: + Text: a {portal} to the {city} + +Gerudo Desert Portal: + Standard: + Text: Gerudo Desert Portal + Pretty: + Text: the {Gerudo Desert Portal} + Cryptic: + Text: a {portal} to a {challenging cave} + +North Faron Portal: + Standard: + Text: North Faron Portal + Pretty: + Text: the {North Faron Portal} + Cryptic: + Text: a {portal} to a {forest clearing} + +Hawkeye: + Standard: + Text: Hawkeye + Pretty: + Text: the {Hawkeye} + Cryptic: + Text: the {zoom-and-enhance} + +Progressive Sword: + Standard: + Text: Progressive Sword + Pretty: + Text: a {Sword} + Cryptic: + Text: a {sharp weapon} + +Gale Boomerang: + Standard: + Text: Gale Boomerang + Pretty: + Text: the {Gale Boomerang} + Cryptic: + Text: the {fairy of winds} + +Spinner: + Standard: + Text: Spinner + Pretty: + Text: the {Spinner} + Cryptic: + Text: the {gear rotator} + +Ball and Chain: + Standard: + Text: Ball and Chain + Pretty: + Text: the {Ball and Chain} + Cryptic: + Text: the {iron weight} + +Progressive Bow: + Standard: + Text: Progressive Bow + Pretty: + Text: a {Bow} + Cryptic: + Text: an {arrow launcher} + +Progressive Clawshot: + Standard: + Text: Progressive Clawshot + Pretty: + Text: a {Clawshot} + Cryptic: + Text: a {chain launcher} + +Iron Boots: + Standard: + Text: Iron Boots + Pretty: + Text: the {Iron Boots} + Plurality: Plural + Cryptic: + Text: the {heavy shoes} + Plurality: Plural + +Progressive Dominion Rod: + Standard: + Text: Dominion Rod + Pretty: + Text: a {Dominion Rod} + Cryptic: + Text: a {rod of control} + +Lantern: + Standard: + Text: Lantern + Pretty: + Text: the {Lantern} + Cryptic: + Text: the {small light} + +Progressive Fishing Rod: + Standard: + Text: Progressive Fishing Rod + Pretty: + Text: a {Fishing Rod} + Cryptic: + Text: a {rod of patience} + +Slingshot: + Standard: + Text: Slingshot + Pretty: + Text: the {Slingshot} + Cryptic: + Text: the {child's toy} + +Kakariko Gorge Portal: + Standard: + Text: Kakariko Gorge Portal + Pretty: + Text: the {Kakariko Gorge Portal} + Cryptic: + Text: a {portal} to a {big gap} + +Kakariko Village Portal: + Standard: + Text: Kakariko Village Portal + Pretty: + Text: the {Kakariko Village Portal} + Cryptic: + Text: a {portal} to a {village} + +Giant Bomb Bag: + Standard: + Text: Giant Bomb Bag + Pretty: + Text: a {Giant Bomb Bag} + Cryptic: + Text: an {explosive capacity upgrade} + +Bomb Bag: + Standard: + Text: Bomb Bag + Pretty: + Text: a {Bomb Bag} + Cryptic: + Text: a {bag for explosions} + +Death Mountain Portal: + Standard: + Text: Death Mountain Portal + Pretty: + Text: the {Death Mountain Portal} + Cryptic: + Text: a {portal} to a {volcano} + +Zoras Domain Portal: + Standard: + Text: Zoras Domain Portal + Pretty: + Text: the {Zora's Domain Portal} + Cryptic: + Text: a {portal} to {water} + +Empty Bottle: + Standard: + Text: Empty Bottle + Pretty: + Text: an {Empty Bottle} + Cryptic: + Text: + +Red Potion Shop: + Standard: + Text: Red Potion Shop + Pretty: + Text: a {Red Potion} + Cryptic: + Text: a {health refill} + +Blue Potion Shop: + Standard: + Text: Blue Potion Shop + Pretty: + Text: a {Blue Potion} + Cryptic: + Text: a {blue health refill} + +Bottle with Half Milk: + Standard: + Text: Bottle with Half Milk + Pretty: + Text: a {Bottle with Half Milk} + Cryptic: + Text: a {baby bottle} + +Fairy Tears: + Standard: + Text: Fairy Tears + Pretty: + Text: some {Fairy Tears} + Plurality: Plural + Cryptic: + Text: a {refill of great power} + +Bottle with Great Fairies Tears: + Standard: + Text: Bottle with Great Fairies Tears + Pretty: + Text: a {Bottle with Great Fairies Tears} + Cryptic: + Text: a {bottle of great power} + +Renados Letter: + Standard: + Text: Renados Letter + Pretty: + Text: "{Renado's Letter}" + Cryptic: + Text: a {letter} from a {concerned shaman} + +Invoice: + Standard: + Text: Invoice + Pretty: + Text: the {Invoice} + Cryptic: + Text: the {bill for the doctor} + +Wooden Statue: + Standard: + Text: Wooden Statue + Pretty: + Text: the {Wooden Statue} + Cryptic: + Text: "{memories of home}" + Plurality: Plural + +Ilias Charm: + Standard: + Text: Ilias Charm + Pretty: + Text: "{Ilias Charm}" + Cryptic: + Text: a {friend's item} + +Horse Call: + Standard: + Text: Horse Call + Pretty: + Text: the {Horse Call} + Cryptic: + Text: the {horse beckoner} + +Forest Temple Small Key: + Standard: + Text: Forest Temple Small Key + Pretty: + Text: a {Forest Temple Small Key} + Cryptic: + Text: a {key} for a {deep forest} + +Goron Mines Small Key: + Standard: + Text: Goron Mines Small Key + Pretty: + Text: a {Goron Mines Small Key} + Cryptic: + Text: a {key} for a {volcanic mine} + +Lakebed Temple Small Key: + Standard: + Text: Lakebed Temple Small Key + Pretty: + Text: a {Lakebed Temple Small Key} + Cryptic: + Text: a {key} for an {underground lake} + +Arbiters Grounds Small Key: + Standard: + Text: Arbiters Grounds Small Key + Pretty: + Text: an {Arbiters Grounds Small Key} + Cryptic: + Text: a {key} for an {ancient prison} + +Snowpeak Ruins Small Key: + Standard: + Text: Snowpeak Ruins Small Key + Pretty: + Text: a {Snowpeak Ruins Small Key} + Cryptic: + Text: a {key} for a {snowy mansion} + +Temple of Time Small Key: + Standard: + Text: Temple of Time Small Key + Pretty: + Text: a {Temple of Time Small Key} + Cryptic: + Text: a {key} for the {past} + +City in the Sky Small Key: + Standard: + Text: City in the Sky Small Key + Pretty: + Text: the {City in the Sky Small Key} + Cryptic: + Text: a {key} for the {skies above} + +Palace of Twilight Small Key: + Standard: + Text: Palace of Twilight Small Key + Pretty: + Text: a {Palace of Twilight Small Key} + Cryptic: + Text: a {key} for a {another realm} + +Hyrule Castle Small Key: + Standard: + Text: Hyrule Castle Small Key + Pretty: + Text: a {Hyrule Castle Small Key} + Cryptic: + Text: a {key} for a {kingdom's castle} + +Gerudo Desert Bulblin Camp Key: + Standard: + Text: Gerudo Bulblin Camp Small Key + Pretty: + Text: the {Gerudo Desert Bulblin Camp Key} + Cryptic: + Text: the {key} for a {desert tent} + +Lake Hylia Portal: + Standard: + Text: Lake Hylia Portal + Pretty: + Text: the {Lake Hylia Portal} + Cryptic: + Text: a {portal} to a {vast lake} + +Aurus Memo: + Standard: + Text: Aurus Memo + Pretty: + Text: "{Auru's Memo}" + Cryptic: + Text: a {friend's favor} + +Asheis Sketch: + Standard: + Text: Asheis Sketch + Pretty: + Text: "{Ashei's Sketch}" + Cryptic: + Text: a {sketch} of a {horrific beast} + +Forest Temple Big Key: + Standard: + Text: Forest Temple Big Key + Pretty: + Text: the {Forest Temple Big Key} + Cryptic: + Text: the {key} to the {twilit parasite} + +Lakebed Temple Big Key: + Standard: + Text: Lakebed Temple Big Key + Pretty: + Text: the {Lakebed Temple Big Key} + Cryptic: + Text: the {key} to the {twilit aquatic} + +Arbiters Grounds Big Key: + Standard: + Text: Arbiters Grounds Big Key + Pretty: + Text: the {Arbiters Grounds Big Key} + Cryptic: + Text: the {key} to the {twilit fossil} + +Temple of Time Big Key: + Standard: + Text: Temple of Time Big Key + Pretty: + Text: the {Temple of Time Big Key} + Cryptic: + Text: the {key} to the {twilit arachnid} + +City in the Sky Big Key: + Standard: + Text: City in the Sky Big Key + Pretty: + Text: the {City in the Sky Big Key} + Cryptic: + Text: the {key} to the {twilit dragon} + +Palace of Twilight Big Key: + Standard: + Text: Palace of Twilight Big Key + Pretty: + Text: the {Palace of Twilight Big Key} + Cryptic: + Text: the {key} to the {usurper king} + +Hyrule Castle Big Key: + Standard: + Text: Hyrule Castle Big Key + Pretty: + Text: a {Hyrule Castle Big Key} + Cryptic: + Text: the {key} to the {castle throne room} + +Forest Temple Compass: + Standard: + Text: Forest Temple Compass + Pretty: + Text: the {Forest Temple Compass} + Cryptic: + Text: the {pointer} for a {deep forest} + +Goron Mines Compass: + Standard: + Text: Goron Mines Compass + Pretty: + Text: the {Goron Mines Compass} + Cryptic: + Text: the {pointer} for a {volcano} + +Lakebed Temple Compass: + Standard: + Text: Lakebed Temple Compass + Pretty: + Text: the {Lakebed Temple Compass} + Cryptic: + Text: the {pointer} for an {underground lake} + +Bottle with Lantern Oil: + Standard: + Text: Bottle with Lantern Oil + Pretty: + Text: a {Bottle with Lantern Oil} + Cryptic: + Text: a {bottle with lighter fluid} + +Progressive Mirror Shard: + Standard: + Text: Progressive Mirror Shard + Pretty: + Text: a {Mirror Shard} + Cryptic: + Text: a {reflective shard of power} + +Arbiters Grounds Compass: + Standard: + Text: Arbiters Grounds Compass + Pretty: + Text: the {Arbiters Grounds Compass} + Cryptic: + Text: the {pointer} for an {ancient prison} + +Snowpeak Ruins Compass: + Standard: + Text: Snowpeak Ruins Compass + Pretty: + Text: the {Snowpeak Ruins Compass} + Cryptic: + Text: the {pointer} for a {snowy mansion} + +Temple of Time Compass: + Standard: + Text: Temple of Time Compass + Pretty: + Text: the {Temple of Time Compass} + Cryptic: + Text: the {pointer} for the {past} + +City in the Sky Compass: + Standard: + Text: City in the Sky Compass + Pretty: + Text: the {City in the Sky Compass} + Cryptic: + Text: the {pointer} for the {skies above} + +Palace of Twilight Compass: + Standard: + Text: Palace of Twilight Compass + Pretty: + Text: the {Palace of Twilight Compass} + Cryptic: + Text: the {pointer} for {another realm} + +Hyrule Castle Compass: + Standard: + Text: Hyrule Castle Compass + Pretty: + Text: a {Hyrule Castle Compass} + Cryptic: + Text: the {pointer} for the {kingdom's castle} + +Mirror Chamber Portal: + Standard: + Text: Mirror Chamnber Portal + Pretty: + Text: the {Mirror Chamber Portal} + Cryptic: + Text: a {portal} to a {coliseum} + +Snowpeak Portal: + Standard: + Text: Snowpeak Portal + Pretty: + Text: the {Snowpeak Portal} + Cryptic: + Text: a {portal} to a {snowy mountain} + +Forest Temple Dungeon Map: + Standard: + Text: Forest Temple Dungeon Map + Pretty: + Text: the {Forest Temple Dungeon Map} + Cryptic: + Text: the {map} for a {deep forest} + +Goron Mines Dungeon Map: + Standard: + Text: Goron Mines Dungeon Map + Pretty: + Text: the {Goron Mines Dungeon Map} + Cryptic: + Text: the {map} for a {volcano} + +Lakebed Temple Dungeon Map: + Standard: + Text: Lakebed Temple Dungeon Map + Pretty: + Text: the {Lakebed Temple Dungeon Map} + Cryptic: + Text: the {map} for an {underground lake} + +Arbiters Grounds Dungeon Map: + Standard: + Text: Arbiters Grounds Dungeon Map + Pretty: + Text: the {Arbiters Grounds Dungeon Map} + Cryptic: + Text: the {map} for an {ancient prison} + +Snowpeak Ruins Dungeon Map: + Standard: + Text: Snowpeak Ruins Dungeon Map + Pretty: + Text: the {Snowpeak Ruins Dungeon Map} + Cryptic: + Text: the {map} for a {snowy mansion} + +Temple of Time Dungeon Map: + Standard: + Text: Temple of Time Dungeon Map + Pretty: + Text: the {Temple of Time Dungeon Map} + Cryptic: + Text: the {map} for the {past} + +City in the Sky Dungeon Map: + Standard: + Text: City in the Sky Dungeon Map + Pretty: + Text: the {City in the Sky Dungeon Map} + Cryptic: + Text: the {map} for the {skies above} + +Palace of Twilight Dungeon Map: + Standard: + Text: Palace of Twilight Dungeon Map + Pretty: + Text: the {Palace of Twilight Dungeon Map} + Cryptic: + Text: the {map} for {another realm} + +Hyrule Castle Dungeon Map: + Standard: + Text: Hyrule Castle Dungeon Map + Pretty: + Text: a {Hyrule Castle Dungeon Map} + Cryptic: + Text: the {map} for the {kingdom's castle} + +Sacred Grove Portal: + Standard: + Text: Sacred Grove Portal + Pretty: + Text: the {Sacred Grove Portal} + Cryptic: + Text: a {portal} to an {ancient forest} + +Male Beetle: + Standard: + Text: Male Beetle + Pretty: + Text: the {Beetle} + Cryptic: + Text: a {shiny insect} + +Female Beetle: + Standard: + Text: Female Beetle + Pretty: + Text: the {Beetle} + Cryptic: + Text: a {shiny insect} + +Male Butterfly: + Standard: + Text: Male Butterfly + Pretty: + Text: the {Butterfly} + Cryptic: + Text: a {shiny insect} + +Female Butterfly: + Standard: + Text: Female Butterfly + Pretty: + Text: the {Butterfly} + Cryptic: + Text: a {shiny insect} + +Male Stag Beetle: + Standard: + Text: Male Stag Beetle + Pretty: + Text: the {Stag Beetle} + Cryptic: + Text: a {shiny insect} + +Female Stag Beetle: + Standard: + Text: Female Stag Beetle + Pretty: + Text: the {Stag Beetle} + Cryptic: + Text: a {shiny insect} + +Male Grasshopper: + Standard: + Text: Male Grasshopper + Pretty: + Text: the {Grasshopper} + Cryptic: + Text: a {shiny insect} + +Female Grasshopper: + Standard: + Text: Female Grasshopper + Pretty: + Text: the {Grasshopper} + Cryptic: + Text: a {shiny insect} + +Male Phasmid: + Standard: + Text: Male Phasmid + Pretty: + Text: the {Phasmid} + Cryptic: + Text: a {shiny insect} + +Female Phasmid: + Standard: + Text: Female Phasmid + Pretty: + Text: the {Phasmid} + Cryptic: + Text: a {shiny insect} + +Male Pill Bug: + Standard: + Text: Male Pill Bug + Pretty: + Text: the {Pill Bug} + Cryptic: + Text: a {shiny insect} + +Female Pill Bug: + Standard: + Text: Female Pill Bug + Pretty: + Text: the {Pill Bug} + Cryptic: + Text: a {shiny insect} + +Male Mantis: + Standard: + Text: Male Mantis + Pretty: + Text: the {Mantis} + Cryptic: + Text: a {shiny insect} + +Female Mantis: + Standard: + Text: Female Mantis + Pretty: + Text: the {Mantis} + Cryptic: + Text: a {shiny insect} + +Male Ladybug: + Standard: + Text: Male Ladybug + Pretty: + Text: the {Ladybug} + Cryptic: + Text: a {shiny insect} + +Female Ladybug: + Standard: + Text: Female Ladybug + Pretty: + Text: the {Ladybug} + Cryptic: + Text: a {shiny insect} + +Male Snail: + Standard: + Text: Male Snail + Pretty: + Text: the {Snail} + Cryptic: + Text: a {shiny insect} + +Female Snail: + Standard: + Text: Female Snail + Pretty: + Text: the {Snail} + Cryptic: + Text: a {shiny insect} + +Male Dragonfly: + Standard: + Text: Male Dragonfly + Pretty: + Text: the {Dragonfly} + Cryptic: + Text: a {shiny insect} + +Female Dragonfly: + Standard: + Text: Female Dragonfly + Pretty: + Text: the {Dragonfly} + Cryptic: + Text: a {shiny insect} + +Male Ant: + Standard: + Text: Male Ant + Pretty: + Text: the {Ant} + Cryptic: + Text: a {shiny insect} + +Female Ant: + Standard: + Text: Female Ant + Pretty: + Text: the {Ant} + Cryptic: + Text: a {shiny insect} + +Male Dayfly: + Standard: + Text: Male Dayfly + Pretty: + Text: the {Dayfly} + Cryptic: + Text: a {shiny insect} + +Female Dayfly: + Standard: + Text: Female Dayfly + Pretty: + Text: the {Dayfly} + Cryptic: + Text: a {shiny insect} + +Progressive Fused Shadow: + Standard: + Text: Progressive Fused Shadow + Pretty: + Text: a {Fused Shadow} + Cryptic: + Text: a {shadow of ultimate power} + +Poe Soul: + Standard: + Text: Poe Soul + Pretty: + Text: a {Poe Soul} + Cryptic: + Text: a {soul of the dead} + +Progressive Hidden Skill: + Standard: + Text: Progressive Hidden Skill + Pretty: + Text: a {Hidden Skill} + Cryptic: + Text: a {forgotten technique} + + +Bridge of Eldin Portal: + Standard: + Text: Bridge of Eldin Portal + Pretty: + Text: the {Bridge of Eldin Portal} + Cryptic: + Text: a {portal} to a {long bridge} + +Progressive Sky Book: + Standard: + Text: Progressive Sky Book + Pretty: + Text: a {Sky Character} + Cryptic: + Text: a {glyph of the heavens} + +Purple Rupee Links House: + Standard: + Text: Purple Rupee Links House + Pretty: + Text: the {Purple Rupee from your basement} + Cryptic: + Text: "{your savings}" + Plurality: Plural + +North Faron Woods Gate Key: + Standard: + Text: North Faron Woods Gate Key + Pretty: + Text: the {North Faron Woods Gate Key} + Cryptic: + Text: a {key} to a {northern forest} + +Gate Keys: + Standard: + Text: Gate Keys + Pretty: + Text: the {Gate Keys} + Plurality: Plural + Cryptic: + Text: "{King Bulblin's keys}" + Plurality: Plural + +Ordon Pumpkin: + Standard: + Text: Ordon Pumpkin + Pretty: + Text: the {Ordon Pumpkin} + Cryptic: + Text: a {soup ingredient} + +Ordon Cheese: + Standard: + Text: Ordon Cheese + Pretty: + Text: some {Ordon Cheese} + Cryptic: + Text: a {soup ingredient} + +Snowpeak Ruins Bedroom Key: + Standard: + Text: Snowpeak Ruins Bedroom Key + Pretty: + Text: the {Snowpeak Ruins Bedroom Key} + Cryptic: + Text: the {key} to a {snowy bedroom} + +Goron Mines Key Shard: + Standard: + Text: Goron Mines Key Shard + Pretty: + Text: a {Goron Mines Key Shard} + Cryptic: + Text: "{one third} of a {key}" + +Coro Key: + Standard: + Text: Coro Key + Pretty: + Text: "{Coro's Key}" + Cryptic: + Text: a {key} to a {forest cave} + +Game Beatable: + Standard: + Text: Game Beatable + Pretty: + Text: "{Game Beatable}" + Cryptic: + Text: the {game-winning item} + +Hint: + Standard: + Text: Hint + Pretty: + Text: a {Hint} + Cryptic: + Text: a {piece of knowledge} + +Faron Twilight Tear: + Standard: + Text: Faron Twilight Tear + Pretty: + Text: a {Faron Twilight Tear} + Cryptic: + Text: a {tear} of a {forest spirit} + +Eldin Twilight Tear: + Standard: + Text: Eldin Twilight Tear + Pretty: + Text: an {Eldin Twilight Tear} + Cryptic: + Text: a {tear} of a {volcano spirit} + +Lanayru Twilight Tear: + Standard: + Text: Lanayru Twilight Tear + Pretty: + Text: a {Lanayru Twilight Tear} + Cryptic: + Text: a {tear} of a {lake spirit} + + +# HINT REGION NAMES +Ordon: + Standard: + Text: Ordon + Pretty: + Text: "{Ordon}" + Cryptic: + Text: a {quaint village} + +Faron Woods: + Standard: + Text: Faron Woods + Pretty: + Text: "{Faron Woods}" + Cryptic: + Text: a {forest} + +Sacred Grove: + Standard: + Text: Sacred Grove + Pretty: + Text: the {Sacred Grove} + Cryptic: + Text: a {hidden grove} + +Faron Field: + Standard: + Text: Faron Field + Pretty: + Text: "{Faron Field}" + Cryptic: + Text: a {field near the forest} + +Kakariko Gorge: + Standard: + Text: Kakariko Gorge + Pretty: + Text: "{Kakariko Gorge}" + Cryptic: + Text: a {field with a large chasm} + +Kakariko Village: + Standard: + Text: Kakariko Village + Pretty: + Text: "{Kakariko Village}" + Cryptic: + Text: a {charming village} + +Kakariko Graveyard: + Standard: + Text: Kakariko Graveyard + Pretty: + Text: the {Kakariko Graveyard} + Cryptic: + Text: a {yard for the dead} + +Death Mountain: + Standard: + Text: Death Mountain + Pretty: + Text: "{Death Mountain}" + Cryptic: + Text: a {volcano path} + +Eldin Field: + Standard: + Text: Eldin Field + Pretty: + Text: "{Eldin Field}" + Cryptic: + Text: a {field near a volcano} + +North Eldin: + Standard: + Text: North Eldin + Pretty: + Text: "{North Eldin}" + Cryptic: + Text: a {narrow gray field} + +Hidden Village: + Standard: + Text: Hidden Village + Pretty: + Text: the {Hidden Village} + Cryptic: + Text: a {secluded settlement} + +Lanayru Field: + Standard: + Text: Lanayru Field + Pretty: + Text: "{Lanayru Field}" + Cryptic: + Text: a {field with a river} + +Beside Castle Town: + Standard: + Text: Beside Castle Town + Pretty: + Text: "{Beside Castle Town}" + Cryptic: + Text: a {field beside a city} + +Castle Town: + Standard: + Text: Castle Town + Pretty: + Text: "{Castle Town}" + Cryptic: + Text: a {city} + +South of Castle Town: + Standard: + Text: South of Castle Town + Pretty: + Text: "{South of Castle Town}" + Cryptic: + Text: a {field south of a city} + +Great Bridge of Hylia: + Standard: + Text: Great Bridge of Hylia + Pretty: + Text: the {Great Bridge of Hylia} + Cryptic: + Text: a {path along a great bridge} + +Lake Hylia: + Standard: + Text: Lake Hylia + Pretty: + Text: "{Lake Hylia}" + Cryptic: + Text: a {vast lake} + +Lanayru Spring: + Standard: + Text: Lanayru Spring + Pretty: + Text: the {Lanayru Spring} + Cryptic: + Text: a {cavernous spring} + +Upper Zoras River: + Standard: + Text: Upper Zoras River + Pretty: + Text: "{Upper Zoras River}" + Cryptic: + Text: a {fork in the river} + +Zoras Domain: + Standard: + Text: Zoras Domain + Pretty: + Text: "{Zoras Domain}" + Cryptic: + Text: the {home of a grand waterfall} + +South Gerudo Desert: + Standard: + Text: South Gerudo Desert + Pretty: + Text: "{South Gerudo Desert}" + Cryptic: + Text: the {southern desert} + +North Gerudo Desert: + Standard: + Text: North Gerudo Desert + Pretty: + Text: "{North Gerudo Desert}" + Cryptic: + Text: the {northern desert} + +Bublin Camp: + Standard: + Text: Bublin Camp + Pretty: + Text: "{Bublin Camp}" + Cryptic: + Text: a {camp of enemies} + +Mirror Chamber: + Standard: + Text: Mirror Chamber + Pretty: + Text: the {Mirror Chamber} + Cryptic: + Text: a {chamber of chains} + +Forest Temple: + Standard: + Text: Forest Temple + Pretty: + Text: the {Forest Temple} + Cryptic: + Text: a {deep forest} + +Goron Mines: + Standard: + Text: Goron Mines + Pretty: + Text: the {Goron Mines} + Cryptic: + Text: a {volcanic mine} + +Lakebed Temple: + Standard: + Text: Lakebed Temple + Pretty: + Text: the {Lakebed Temple} + Cryptic: + Text: an {underground lake} + +Arbiters Grounds: + Standard: + Text: Arbiters Grounds + Pretty: + Text: the {Arbiters Grounds} + Cryptic: + Text: an {ancient prison} + +Snowpeak Ruins: + Standard: + Text: Snowpeak Ruins + Pretty: + Text: the {Snowpeak Ruins} + Cryptic: + Text: a {snowy mansion} + +Temple of Time: + Standard: + Text: Temple of Time + Pretty: + Text: the {Temple of Time} + Cryptic: + Text: the {past} + +City in the Sky: + Standard: + Text: City in the Sky + Pretty: + Text: the {City in the Sky} + Cryptic: + Text: the {skies above} + +Palace of Twilight: + Standard: + Text: Palace of Twilight + Pretty: + Text: the {Palace of Twilight} + Cryptic: + Text: "{another realm}" + +Hyrule Castle: + Standard: + Text: Hyrule Castle + Pretty: + Text: the {Hyrule Castle} + Cryptic: + Text: the {kingdom's castle} + +# ITEM GET TEXT Foolish Get Item Text: Standard: Text: |- @@ -352,18 +1855,207 @@ Midna Call As Human Three Choice: Text: |- Transform into wolf Warp - Change time + Change time of day Midna Call As Wolf Three Choice: Standard: Text: |- Transform into human Warp - Change time + Change time of day + +Slingshot Shop Text Template: + Standard: + Text: |- + 30 Rupees + I got this in for the kids. It's just a + toy, but it stings something AWFUL + when you get hit by it! + +Slingshot Shop Too Expensive Text Template: + Standard: + Text: |- + is 30 Rupees. + If you want it, bring some money + with you, all right, m'dear? + +Slingshot Shop Purchase Confirmation Text Template: + Standard: + Text: |- + is 30 Rupees. + Do you want to buy it, m'dear? + +Slingshot Shop After Purchase Text Template: + Standard: + Text: |- + What are you doing buying + , you naughty thing? + You're too old for toys! Will you at + least let the kids play with it? + +Barnes Special Offer Text Template: + Standard: + Text: |- + I've got a special offer goin' right + now: , just 120 + Rupees! How 'bout that? + +Kakariko Malo Mart Wooden Shield Purchase Confirmation Text Template: + Standard: + Text: |- + will cost you 50 + Rupees. Want one or not? + +Kakariko Malo Mart Wooden Shield Too Expensive Text Template: + Standard: + Text: |- + will cost you 50 + Rupees, but you can't afford it. + Don't expect a discount just + because we're from the same town. + +Kakariko Malo Mart Hylian Shield Purchase Confirmation Text Template: + Standard: + Text: |- + will cost you 200 + Rupees. Want one or not? + +Kakariko Malo Mart Hylian Shield Too Expensive Text Template: + Standard: + Text: |- + will run you 200 + Rupees...but if you have that much, + I'll eat my hat. And I don't even + HAVE a hat. + +Kakariko Malo Mart Hylian Shield After Purchase Text Template: + Standard: + Text: |- + Well, you bought my last + ... + so you'd better take good + care of it. + +Kakariko Malo Mart Hawkeye Purchase Confirmation Text Template: + Standard: + Text: |- + is 100 Rupees. You + want it or not? + +Kakariko Malo Mart Hawkeye Too Expensive Text Template: + Standard: + Text: |- + costs 100 Rupees... + but there are people with enough + Rupees, and then there's you. + The guy with not enough. + +Kakariko Malo Mart Hawkeye After Purchase Text Template: + Standard: + Text: |- + You bought my last ... + +Kakariko Malo Mart Red Potion Too Expensive Text Template: + Standard: + Text: |- + will cost you 30 + Rupees, but I won't be donating + it to the poor, sorry. + +Kakariko Malo Mart Red Potion Purchase Confirmation Text Template: + Standard: + Text: |- + will cost you 30 + Rupees. Want some or not? + +Kakariko Malo Mart Red Potion Text Template: + Standard: + Text: |- + : 30 Rupees + This potion replenishes your + life energy. Keep it in an empty + bottle. + +Kakariko Malo Mart Hawkeye Coming Soon Text Template: + Standard: + Text: |- + : COMING SOON + +Kakariko Malo Mart Hawkeye Text Template: + Standard: + Text: |- + : 100 Rupees + This eyewear allows you to see + distant objects as if with the eyes + of a hawk. + +Kakariko Malo Mart Sold Out Text: + Standard: + Text: SOLD OUT + +Kakariko Malo Mart Wooden Shield Text Template: + Standard: + Text: |- + : 50 Rupees + This is a simple shield. It's made of + wood, so it will burn away if + touched by fire. + +Kakariko Malo Mart Hylian Shield Text Template: + Standard: + Text: |- + : 200 Rupees + LIMITED SUPPLY! + Don't let them sell out before you + buy one! + +Chudleys Shop Magic Armor Text Template: + Standard: + Text: |- + + Armor for the richest and most + precious customers who value their + lives over their Rupees. + +Castle Town Malo Mart Magic Armor After Purchase Text Template: + Standard: + Text: |- + We have sold out of ! + +Castle Town Malo Mart Magic Armor Text Template: + Standard: + Text: |- + !Special! 598 Rupees + This is quite a bargain when you + think of how valuable your life is. + What's a few Rupees to stay alive? + +Castle Town Malo Mart Magic Armor Sold Out Text Template: + Standard: + Text: |- + + -SOLD OUT- + *This item has been discontinued. Charlo Donation Choice Text: Standard: Text: |- 100 Rupees 50 Rupees - Sorry... \ No newline at end of file + Sorry... + +Charlo Donation Ask Text Template: + Standard: + Text: |- + For ... + Would you please make a donation? + +Fishing Hole Sign Text Template: + Standard: + Text: |- + DON'T LITTER! + Do NOT toss empty bottles or + here! + The fish are CRYING! + + Keep the fishing hole clean! diff --git a/src/dusk/randomizer/generator/data/text/text_overrides.yaml b/src/dusk/randomizer/generator/data/text/text_overrides.yaml index aa00d57043..6528ad11ca 100644 --- a/src/dusk/randomizer/generator/data/text/text_overrides.yaml +++ b/src/dusk/randomizer/generator/data/text/text_overrides.yaml @@ -243,10 +243,118 @@ Group: 0 Message Id: 2041 +- Name: Slingshot Shop Text + Group: 1 + Message Id: 7009 + +- Name: Slingshot Shop Too Expensive Text + Group: 1 + Message Id: 7014 + +- Name: Slingshot Shop Purchase Confirmation Text + Group: 1 + Message Id: 7015 + +- Name: Slingshot Shop After Purchase Text + Group: 1 + Message Id: 7016 + - Name: Links House Sign Group: 1 Message Id: 9005 +- Name: Barnes Special Offer Text + Group: 2 + Message Id: 5155 + +- Name: Kakariko Malo Mart Wooden Shield Purchase Confirmation Text + Group: 2 + Message Id: 5809 + +- Name: Kakariko Malo Mart Wooden Shield Too Expensive Text + Group: 2 + Message Id: 5810 + +- Name: Kakariko Malo Mart Hylian Shield Purchase Confirmation Text + Group: 2 + Message Id: 5813 + +- Name: Kakariko Malo Mart Hylian Shield Too Expensive Text + Group: 2 + Message Id: 5814 + +- Name: Kakariko Malo Mart Hylian Shield After Purchase Text + Group: 2 + Message Id: 5818 + +- Name: Kakariko Malo Mart Hawkeye Purchase Confirmation Text + Group: 2 + Message Id: 5820 + +- Name: Kakariko Malo Mart Hawkeye Too Expensive Text + Group: 2 + Message Id: 5821 + +- Name: Kakariko Malo Mart Hawkeye After Purchase Text + Group: 2 + Message Id: 5822 + +- Name: Kakariko Malo Mart Red Potion Too Expensive Text + Group: 2 + Message Id: 5824 + +- Name: Kakariko Malo Mart Red Potion Purchase Confirmation Text + Group: 2 + Message Id: 5825 + +- Name: Kakariko Malo Mart Red Potion Text + Group: 2 + Message Id: 5990 + +- Name: Kakariko Malo Mart Hawkeye Coming Soon Text + Group: 2 + Message Id: 5991 + +- Name: Kakariko Malo Mart Hawkeye Text + Group: 2 + Message Id: 5992 + +- Name: Kakariko Malo Mart Sold Out Text + Group: 2 + Message Id: 5996 + +- Name: Kakariko Malo Mart Wooden Shield Text + Group: 2 + Message Id: 5998 + +- Name: Kakariko Malo Mart Hylian Shield Text + Group: 2 + Message Id: 5999 + +- Name: Chudleys Shop Magic Armor Text + Group: 4 + Message Id: 5413 + +- Name: Castle Town Malo Mart Magic Armor After Purchase Text + Group: 4 + Message Id: 5433 + +- Name: Castle Town Malo Mart Magic Armor Text + Group: 4 + Message Id: 5440 + +- Name: Castle Town Malo Mart Magic Armor Sold Out Text + Group: 4 + Message Id: 5451 + +- Name: Charlo Donation Ask Text + Group: 4 + Message Id: 6402 + - Name: Charlo Donation Choice Text Group: 4 Message Id: 6403 + +- Name: Fishing Hole Sign Text + Group: 7 + Message Id: 9502 diff --git a/src/dusk/randomizer/generator/logic/hints.cpp b/src/dusk/randomizer/generator/logic/hints.cpp index 726c29d04b..2166162f66 100644 --- a/src/dusk/randomizer/generator/logic/hints.cpp +++ b/src/dusk/randomizer/generator/logic/hints.cpp @@ -20,16 +20,61 @@ namespace randomizer::logic::hints { }; for (const auto& world : worlds) { - auto& requiredDungeonText = world->AddDynamicTextStr("Links House Sign"); - for (const auto& [name, dungeon] : world->GetDungeonTable()) { + auto& requiredDungeonText = world->AddNewText("Links House Sign"); + for (const auto& [dungeonName, dungeon] : world->GetDungeonTable()) { if (dungeon->IsRequired()) { - requiredDungeonText += dungeonColors.at(name) + name + "\n"; + requiredDungeonText += dungeonColors.at(dungeonName) + getTextObject(dungeonName) + "\n"; } } } } + static void doItemTextReplacement(const std::unique_ptr& world, + const std::string& locationName, + const std::list& textNames, + Text::Color color) { + auto itemName = world->GetLocation(locationName)->GetCurrentItem()->GetName(); + auto itemStandardName = addColor(getTextObject(itemName), color, 1, true); + auto itemPrettyName = addColor(getTextObject(itemName, Text::PRETTY), color); + for (const auto& textName : textNames) { + auto& text = world->AddNewText(textName); + text = getTextObject(textName + " Template"); + text.Replace("", itemStandardName); + text.Replace("", itemPrettyName); + } + } + + static void GenerateItemTextReplacements(world::WorldPool& worlds) { + for (const auto& world : worlds) { + doItemTextReplacement(world, "Fishing Hole Bottle", {"Fishing Hole Sign Text"}, Text::GREEN); + doItemTextReplacement(world, "Charlo Donation Blessing", {"Charlo Donation Ask Text"}, Text::GREEN); + doItemTextReplacement(world, "Sera Shop Slingshot", {"Slingshot Shop Text", + "Slingshot Shop Too Expensive Text", "Slingshot Shop Purchase Confirmation Text", + "Slingshot Shop After Purchase Text"}, Text::ORANGE); + + doItemTextReplacement(world, "Barnes Bomb Bag", {"Barnes Special Offer Text"}, Text::ORANGE); + doItemTextReplacement(world, "Kakariko Village Malo Mart Wooden Shield", {"Kakariko Malo Mart Wooden Shield Purchase Confirmation Text", + "Kakariko Malo Mart Wooden Shield Too Expensive Text", "Kakariko Malo Mart Wooden Shield Text"}, Text::ORANGE); + + doItemTextReplacement(world, "Kakariko Village Malo Mart Hylian Shield", {"Kakariko Malo Mart Hylian Shield Purchase Confirmation Text", + "Kakariko Malo Mart Hylian Shield Too Expensive Text", "Kakariko Malo Mart Hylian Shield After Purchase Text", + "Kakariko Malo Mart Hylian Shield Text"}, Text::ORANGE); + + doItemTextReplacement(world, "Kakariko Village Malo Mart Red Potion", {"Kakariko Malo Mart Red Potion Too Expensive Text", + "Kakariko Malo Mart Red Potion Purchase Confirmation Text", "Kakariko Malo Mart Red Potion Text"}, Text::ORANGE); + + doItemTextReplacement(world, "Kakariko Village Malo Mart Hawkeye", {"Kakariko Malo Mart Hawkeye Purchase Confirmation Text", + "Kakariko Malo Mart Hawkeye Too Expensive Text", "Kakariko Malo Mart Hawkeye After Purchase Text", + "Kakariko Malo Mart Hawkeye Coming Soon Text", "Kakariko Malo Mart Hawkeye Text"}, Text::ORANGE); + + doItemTextReplacement(world, "Castle Town Malo Mart Magic Armor", {"Chudleys Shop Magic Armor Text", + "Castle Town Malo Mart Magic Armor After Purchase Text", "Castle Town Malo Mart Magic Armor Text", + "Castle Town Malo Mart Magic Armor Sold Out Text"}, Text::ORANGE); + } + } + void GenerateAllHints(world::WorldPool& worlds) { GenerateRequiredDungeonsHint(worlds); + GenerateItemTextReplacements(worlds); } -} \ No newline at end of file +} diff --git a/src/dusk/randomizer/generator/logic/world.hpp b/src/dusk/randomizer/generator/logic/world.hpp index d0c9fa81dc..9a538c1982 100644 --- a/src/dusk/randomizer/generator/logic/world.hpp +++ b/src/dusk/randomizer/generator/logic/world.hpp @@ -151,12 +151,12 @@ namespace randomizer::logic::world seedgen::settings::Setting& Setting(const std::string& settingName); TextDatabase& GetTextDatabase() { return this->_textDatabase; } - const std::string& GetDynamicTextStr(const std::string& name) { + const std::string& GetText(const std::string& name) { return this->_textDatabase.at(name).at(Text::Type::STANDARD).mText.at(Text::Language::ENGLISH); } - // Make a new custom text entry for this world specifically - std::string& AddDynamicTextStr(const std::string& name, Text::Type type = Text::STANDARD, Text::Language language = Text::ENGLISH) { - return this->_textDatabase[name][type].mText[language]; + // Make a new custom text entry for this world specifically and return a reference to it + Text& AddNewText(const std::string& name, Text::Type type = Text::STANDARD) { + return this->_textDatabase[name][type]; } private: diff --git a/src/dusk/randomizer/generator/utility/text.cpp b/src/dusk/randomizer/generator/utility/text.cpp index 40c871c814..115fb063ba 100644 --- a/src/dusk/randomizer/generator/utility/text.cpp +++ b/src/dusk/randomizer/generator/utility/text.cpp @@ -1,11 +1,9 @@ #include "text.hpp" -#include -#include -#include - #include "yaml.hpp" +#include + namespace randomizer { // std::array supported_languages = {"English", "Spanish", "French"}; @@ -156,6 +154,63 @@ namespace randomizer { // return randomizer::utility::str::erge(lines, u'\n'); // } + Text::Text(const std::string& str) { + for (auto& text : mText) { + text = str; + } + } + + void Text::Replace(const std::string& oldStr, const Text& replacementText, int count/* = 1*/) { + for (size_t i = 0; i < mText.size(); ++i) { + auto& curString = mText[i]; + for (int i = 0; i < count; ++i) { + if (auto startPos = curString.find(oldStr); startPos != std::string::npos) { + curString.replace(startPos, oldStr.length(), replacementText.mText[i]); + } + } + } + } + + void Text::Replace(const std::string& oldStr, const std::string& replacementText, int count/* = 1*/) { + for (size_t i = 0; i < mText.size(); ++i) { + auto& curString = mText[i]; + for (int i = 0; i < count; ++i) { + if (auto startPos = curString.find(oldStr); startPos != std::string::npos) { + curString.replace(startPos, oldStr.length(), replacementText); + } + } + } + } + + Text& Text::operator+=(const Text& rhs) { + for (size_t i = 0; i < mText.size(); ++i) { + mText[i] += rhs.mText[i]; + } + return *this; + } + + Text& Text::operator+=(const std::string& rhs) { + for (auto& text : mText) { + text += rhs; + } + return *this; + } + + Text operator+(Text lhs, const Text& rhs) { + lhs += rhs; + return lhs; + } + + Text operator+(Text lhs, const std::string& rhs) { + for (auto& text : lhs.mText) { + text += rhs; + } + return lhs; + } + + Text operator+(const std::string& lhs, const Text& rhs) { + return Text(lhs) + rhs; + } Text::Type string_to_type(const std::string& str) { std::unordered_map strToType = { @@ -267,25 +322,59 @@ namespace randomizer { return tb.at(name).at(type).mText.at(language); } + Text addColor(const Text& t, Text::Color color, int count /* = 1*/, bool forceAround /* = false*/) { + const static std::unordered_map colorStrings = { + {Text::WHITE, ""}, + {Text::RED, ""}, + {Text::GREEN, ""}, + {Text::LIGHT_BLUE, ""}, + {Text::YELLOW, ""}, + {Text::PURPLE, ""}, + {Text::ORANGE, ""}, + {Text::DARK_GREEN, ""}, + {Text::BLUE, ""}, + {Text::SILVER, ""}, + }; + + if (color == Text::Color::RAW) { + return t; + } + + if (!colorStrings.contains(color)) { + throw std::runtime_error("Color enum value \"" + std::to_string(color) + "\" is not recognized."); + } + + Text text = t; + if (forceAround) { + text = colorStrings.at(color) + text + colorStrings.at(Text::WHITE); + } + text.Replace("{", colorStrings.at(color), count); + text.Replace("}", colorStrings.at(Text::WHITE), count); + return text; + } + void applyMessageCodes(std::string& str) { using namespace std::string_literals; const static std::unordered_map messageCodes = { - {"", "\x1A\x05\x00\x00\x01"s }, - {"", "\x1A\x05\x00\x00\x02"s }, - {"", "\x1A\x06\x00\x00\x09\x01"s}, - {"", "\x1A\x06\x00\x00\x09\x02"s}, - {"", "\x1A\x06\x00\x00\x09\x03"s}, - {"", "\x1A\x06\xFF\x00\x00\x00"s}, - {"", "\x1A\x06\xFF\x00\x00\x01"s}, - {"", "\x1A\x06\xFF\x00\x00\x02"s}, - {"", "\x1A\x06\xFF\x00\x00\x03"s}, - {"", "\x1A\x06\xFF\x00\x00\x04"s}, - {"", "\x1A\x06\xFF\x00\x00\x06"s}, - {"", "\x1A\x06\xFF\x00\x00\x08"s}, + {"", "\x1A\x05\x00\x00\x01"s}, + {"", "\x1A\x05\x00\x00\x02"s}, + {"", "\x1A\x05\x00\x00\x20"s}, + {"", "\x1A\x06\x00\x00\x09\x01"s}, + {"", "\x1A\x06\x00\x00\x09\x02"s}, + {"", "\x1A\x06\x00\x00\x09\x03"s}, + {"", "\x1A\x06\xFF\x00\x00\x00"s}, + {"", "\x1A\x06\xFF\x00\x00\x01"s}, + {"", "\x1A\x06\xFF\x00\x00\x02"s}, + {"", "\x1A\x06\xFF\x00\x00\x03"s}, + {"", "\x1A\x06\xFF\x00\x00\x04"s}, + {"", "\x1A\x06\xFF\x00\x00\x06"s}, + {"", "\x1A\x06\xFF\x00\x00\x08"s}, // custom colors - {"", "\x1A\x06\xFF\x00\x00\x09"s}, - {"", "\x1A\x06\xFF\x00\x00\x0A"s}, - {"", "\x1A\x06\xFF\x00\x00\x0B"s}, + {"", "\x1A\x06\xFF\x00\x00\x09"s}, + {"", "\x1A\x06\xFF\x00\x00\x0A"s}, + {"", "\x1A\x06\xFF\x00\x00\x0B"s}, + {"", "\x1A\x05\x06\x00\x02"s}, + {"", "\x1A\x05\x06\x00\x03"s}, }; for (const auto& [code, replacement] : messageCodes) { diff --git a/src/dusk/randomizer/generator/utility/text.hpp b/src/dusk/randomizer/generator/utility/text.hpp index 060047226d..7fca15322c 100644 --- a/src/dusk/randomizer/generator/utility/text.hpp +++ b/src/dusk/randomizer/generator/utility/text.hpp @@ -23,15 +23,16 @@ namespace randomizer { enum Color { RAW = 0, - NONE, + WHITE, RED, GREEN, - BLUE, + LIGHT_BLUE, YELLOW, - CYAN, - MAGENTA, - GRAY, + PURPLE, ORANGE, + DARK_GREEN, + BLUE, + SILVER, }; enum Gender @@ -49,9 +50,26 @@ namespace randomizer { PLURALITY_MAX, }; + Text() = default; + explicit Text(const std::string& str); + std::array mText{}; std::array mGender{}; std::array mPlurality{}; + + /** + * + * @param oldStr the string to replace + * @param replacementText the Text object to replace the old string + * @param count the number of occurences to replace + */ + void Replace(const std::string& oldStr, const Text& replacementText, int count = 1); + void Replace(const std::string& oldStr, const std::string& replacementText, int count = 1); + Text& operator+=(const Text& rhs); + Text& operator+=(const std::string& rhs); + friend Text operator+(Text lhs, Text& rhs); + friend Text operator+(Text lhs, const std::string& rhs); + friend Text operator+(const std::string& lhs, const Text& rhs); }; inline constexpr std::array supported_languages = { @@ -71,8 +89,11 @@ namespace randomizer { const TextDatabase& getTextDatabase(); + const Text& getTextObject(const std::string& name, Text::Type type = Text::STANDARD); const std::string& getTextStr(const std::string& name, Text::Type type = Text::STANDARD, Text::Language language = Text::ENGLISH); + Text addColor(const Text& text, Text::Color color, int count = 1, bool forceAround = false); + // Replaces the message codes in the string with the ingame hex equivalents void applyMessageCodes(std::string&); }; // namespace Text