From 830b560933e767b2fbb5140f5c89f11f1ec94485 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Thu, 25 Jun 2026 03:15:14 -0700 Subject: [PATCH 1/6] text changes to account for long item names --- src/dusk/randomizer/generator/data/items.yaml | 6 +- .../data/text/languages/english.yaml | 117 +++---- .../generator/data/text/languages/french.yaml | 118 +++---- .../generator/data/text/languages/german.yaml | 118 +++---- .../data/text/languages/italian.yaml | 118 +++---- .../data/text/languages/spanish.yaml | 118 +++---- src/dusk/randomizer/generator/logic/hints.cpp | 2 + .../randomizer/generator/utility/text.cpp | 287 +++++++----------- .../randomizer/generator/utility/text.hpp | 9 +- 9 files changed, 337 insertions(+), 556 deletions(-) diff --git a/src/dusk/randomizer/generator/data/items.yaml b/src/dusk/randomizer/generator/data/items.yaml index 5b34d4ee79..28fc7c08b8 100644 --- a/src/dusk/randomizer/generator/data/items.yaml +++ b/src/dusk/randomizer/generator/data/items.yaml @@ -1,10 +1,8 @@ -# TODO: Add relevant item data - -# Item Importance: +# Item Importance: # 1. Major - Item can potentially unlock locations. Will be placed in a non-excluded location # 2. Minor - Item does not unlock locations, but has gameplay utility. Will be placed # in a non-excluded location if any are empty. -# 3. Junk - Item is expendible. Will be placed completely randomly. +# 3. Junk - Item is expendable. Will be placed completely randomly. #- Name: Recovery Heart # Importance: Junk diff --git a/src/dusk/randomizer/generator/data/text/languages/english.yaml b/src/dusk/randomizer/generator/data/text/languages/english.yaml index df186835f5..a8f2b091ad 100644 --- a/src/dusk/randomizer/generator/data/text/languages/english.yaml +++ b/src/dusk/randomizer/generator/data/text/languages/english.yaml @@ -806,7 +806,7 @@ Hyrule Castle Compass: Mirror Chamber Portal: Standard: - Text: Mirror Chamnber Portal + Text: Mirror Chamber Portal Pretty: Text: the {Mirror Chamber Portal} Cryptic: @@ -1970,88 +1970,65 @@ Midna Call As Wolf Three Choice: 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! + : 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? + 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? + 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? + 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? + 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? + 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. + 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? + 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. + 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. + 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? + 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. + 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: @@ -2061,23 +2038,20 @@ Kakariko Malo Mart Hawkeye After Purchase Text Template: 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. + 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? + 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. +# This potion replenishes your +# life energy. Keep it in an empty +# bottle. Kakariko Malo Mart Hawkeye Coming Soon Text Template: Standard: @@ -2088,9 +2062,9 @@ 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. +# This eyewear allows you to see +# distant objects as if with the eyes +# of a hawk. Kakariko Malo Mart Sold Out Text: Standard: @@ -2099,24 +2073,24 @@ Kakariko Malo Mart Sold Out Text: 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. + : 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! + : 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 + Only for the richest and most precious customers who value their lives over their Rupees. @@ -2129,9 +2103,9 @@ 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? +# 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: @@ -2157,38 +2131,31 @@ Coro Bottle Offer 1 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Coro Bottle Offer 2 Text Template: Standard: Text: |- I have a special, one-time offer of - for only - 100 Rupees. How 'bout it, guy? + for only 100 Rupees. How 'bout it, guy? Coro Bottle Offer 3 Text Template: Standard: Text: |- - Right now we have a 100-Rupee - and 20-Rupee - refills to choose from! + Right now we have a 100-Rupee + and 20-Rupee refills to choose from! Coro Bottle Offer 4 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Fishing Hole Sign Text Template: Standard: Text: |- DON'T LITTER! Do NOT toss empty bottles or - here! - The fish are CRYING! + here! The fish are CRYING! Keep the fishing hole clean! diff --git a/src/dusk/randomizer/generator/data/text/languages/french.yaml b/src/dusk/randomizer/generator/data/text/languages/french.yaml index 4d0e30a146..9cb17c52e5 100644 --- a/src/dusk/randomizer/generator/data/text/languages/french.yaml +++ b/src/dusk/randomizer/generator/data/text/languages/french.yaml @@ -806,7 +806,7 @@ Hyrule Castle Compass: Mirror Chamber Portal: Standard: - Text: Mirror Chamnber Portal + Text: Mirror Chamber Portal Pretty: Text: the {Mirror Chamber Portal} Cryptic: @@ -1970,88 +1970,65 @@ Midna Call As Wolf Three Choice: 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! + : 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? + 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? + 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? + 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? + 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? + 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. + 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? + 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. + 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. + 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? + 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. + 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: @@ -2061,23 +2038,20 @@ Kakariko Malo Mart Hawkeye After Purchase Text Template: 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. + 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? + 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. +# This potion replenishes your +# life energy. Keep it in an empty +# bottle. Kakariko Malo Mart Hawkeye Coming Soon Text Template: Standard: @@ -2088,9 +2062,9 @@ 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. +# This eyewear allows you to see +# distant objects as if with the eyes +# of a hawk. Kakariko Malo Mart Sold Out Text: Standard: @@ -2099,24 +2073,24 @@ Kakariko Malo Mart Sold Out Text: 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. + : 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! + : 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 + Only for the richest and most precious customers who value their lives over their Rupees. @@ -2129,9 +2103,9 @@ 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? +# 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: @@ -2153,43 +2127,35 @@ Charlo Donation Ask Text Template: For ... Would you please make a donation? - Coro Bottle Offer 1 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Coro Bottle Offer 2 Text Template: Standard: Text: |- I have a special, one-time offer of - for only - 100 Rupees. How 'bout it, guy? + for only 100 Rupees. How 'bout it, guy? Coro Bottle Offer 3 Text Template: Standard: Text: |- - Right now we have a 100-Rupee - and 20-Rupee - refills to choose from! + Right now we have a 100-Rupee + and 20-Rupee refills to choose from! Coro Bottle Offer 4 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Fishing Hole Sign Text Template: Standard: Text: |- DON'T LITTER! Do NOT toss empty bottles or - here! - The fish are CRYING! + here! The fish are CRYING! Keep the fishing hole clean! diff --git a/src/dusk/randomizer/generator/data/text/languages/german.yaml b/src/dusk/randomizer/generator/data/text/languages/german.yaml index c3310a286c..f6a2292d80 100644 --- a/src/dusk/randomizer/generator/data/text/languages/german.yaml +++ b/src/dusk/randomizer/generator/data/text/languages/german.yaml @@ -806,7 +806,7 @@ Hyrule Castle Compass: Mirror Chamber Portal: Standard: - Text: Mirror Chamnber Portal + Text: Mirror Chamber Portal Pretty: Text: the {Mirror Chamber Portal} Cryptic: @@ -1970,88 +1970,65 @@ Midna Call As Wolf Three Choice: 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! + : 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? + 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? + 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? + 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? + 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? + 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. + 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? + 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. + 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. + 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? + 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. + 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: @@ -2061,23 +2038,20 @@ Kakariko Malo Mart Hawkeye After Purchase Text Template: 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. + 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? + 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. +# This potion replenishes your +# life energy. Keep it in an empty +# bottle. Kakariko Malo Mart Hawkeye Coming Soon Text Template: Standard: @@ -2088,9 +2062,9 @@ 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. +# This eyewear allows you to see +# distant objects as if with the eyes +# of a hawk. Kakariko Malo Mart Sold Out Text: Standard: @@ -2099,24 +2073,24 @@ Kakariko Malo Mart Sold Out Text: 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. + : 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! + : 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 + Only for the richest and most precious customers who value their lives over their Rupees. @@ -2129,9 +2103,9 @@ 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? +# 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: @@ -2153,43 +2127,35 @@ Charlo Donation Ask Text Template: For ... Would you please make a donation? - Coro Bottle Offer 1 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Coro Bottle Offer 2 Text Template: Standard: Text: |- I have a special, one-time offer of - for only - 100 Rupees. How 'bout it, guy? + for only 100 Rupees. How 'bout it, guy? Coro Bottle Offer 3 Text Template: Standard: Text: |- - Right now we have a 100-Rupee - and 20-Rupee - refills to choose from! + Right now we have a 100-Rupee + and 20-Rupee refills to choose from! Coro Bottle Offer 4 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Fishing Hole Sign Text Template: Standard: Text: |- DON'T LITTER! Do NOT toss empty bottles or - here! - The fish are CRYING! + here! The fish are CRYING! Keep the fishing hole clean! diff --git a/src/dusk/randomizer/generator/data/text/languages/italian.yaml b/src/dusk/randomizer/generator/data/text/languages/italian.yaml index 057b380393..e372fd5380 100644 --- a/src/dusk/randomizer/generator/data/text/languages/italian.yaml +++ b/src/dusk/randomizer/generator/data/text/languages/italian.yaml @@ -806,7 +806,7 @@ Hyrule Castle Compass: Mirror Chamber Portal: Standard: - Text: Mirror Chamnber Portal + Text: Mirror Chamber Portal Pretty: Text: the {Mirror Chamber Portal} Cryptic: @@ -1970,88 +1970,65 @@ Midna Call As Wolf Three Choice: 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! + : 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? + 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? + 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? + 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? + 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? + 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. + 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? + 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. + 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. + 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? + 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. + 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: @@ -2061,23 +2038,20 @@ Kakariko Malo Mart Hawkeye After Purchase Text Template: 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. + 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? + 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. +# This potion replenishes your +# life energy. Keep it in an empty +# bottle. Kakariko Malo Mart Hawkeye Coming Soon Text Template: Standard: @@ -2088,9 +2062,9 @@ 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. +# This eyewear allows you to see +# distant objects as if with the eyes +# of a hawk. Kakariko Malo Mart Sold Out Text: Standard: @@ -2099,24 +2073,24 @@ Kakariko Malo Mart Sold Out Text: 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. + : 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! + : 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 + Only for the richest and most precious customers who value their lives over their Rupees. @@ -2129,9 +2103,9 @@ 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? +# 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: @@ -2153,43 +2127,35 @@ Charlo Donation Ask Text Template: For ... Would you please make a donation? - Coro Bottle Offer 1 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Coro Bottle Offer 2 Text Template: Standard: Text: |- I have a special, one-time offer of - for only - 100 Rupees. How 'bout it, guy? + for only 100 Rupees. How 'bout it, guy? Coro Bottle Offer 3 Text Template: Standard: Text: |- - Right now we have a 100-Rupee - and 20-Rupee - refills to choose from! + Right now we have a 100-Rupee + and 20-Rupee refills to choose from! Coro Bottle Offer 4 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Fishing Hole Sign Text Template: Standard: Text: |- DON'T LITTER! Do NOT toss empty bottles or - here! - The fish are CRYING! + here! The fish are CRYING! Keep the fishing hole clean! diff --git a/src/dusk/randomizer/generator/data/text/languages/spanish.yaml b/src/dusk/randomizer/generator/data/text/languages/spanish.yaml index 38dd5e9ec8..1ac06fc5a4 100644 --- a/src/dusk/randomizer/generator/data/text/languages/spanish.yaml +++ b/src/dusk/randomizer/generator/data/text/languages/spanish.yaml @@ -806,7 +806,7 @@ Hyrule Castle Compass: Mirror Chamber Portal: Standard: - Text: Mirror Chamnber Portal + Text: Mirror Chamber Portal Pretty: Text: the {Mirror Chamber Portal} Cryptic: @@ -1970,88 +1970,65 @@ Midna Call As Wolf Three Choice: 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! + : 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? + 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? + 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? + 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? + 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? + 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. + 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? + 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. + 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. + 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? + 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. + 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: @@ -2061,23 +2038,20 @@ Kakariko Malo Mart Hawkeye After Purchase Text Template: 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. + 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? + 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. +# This potion replenishes your +# life energy. Keep it in an empty +# bottle. Kakariko Malo Mart Hawkeye Coming Soon Text Template: Standard: @@ -2088,9 +2062,9 @@ 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. +# This eyewear allows you to see +# distant objects as if with the eyes +# of a hawk. Kakariko Malo Mart Sold Out Text: Standard: @@ -2099,24 +2073,24 @@ Kakariko Malo Mart Sold Out Text: 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. + : 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! + : 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 + Only for the richest and most precious customers who value their lives over their Rupees. @@ -2129,9 +2103,9 @@ 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? +# 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: @@ -2153,43 +2127,35 @@ Charlo Donation Ask Text Template: For ... Would you please make a donation? - Coro Bottle Offer 1 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Coro Bottle Offer 2 Text Template: Standard: Text: |- I have a special, one-time offer of - for only - 100 Rupees. How 'bout it, guy? + for only 100 Rupees. How 'bout it, guy? Coro Bottle Offer 3 Text Template: Standard: Text: |- - Right now we have a 100-Rupee - and 20-Rupee - refills to choose from! + Right now we have a 100-Rupee + and 20-Rupee refills to choose from! Coro Bottle Offer 4 Text Template: Standard: Text: |- And check this out! I have a special, - one-time offer of - for only 100 Rupees! - How 'bout it, guy? What a bargain! + one-time offer of for only 100 Rupees! How 'bout it, guy? What a bargain! Fishing Hole Sign Text Template: Standard: Text: |- DON'T LITTER! Do NOT toss empty bottles or - here! - The fish are CRYING! + here! The fish are CRYING! Keep the fishing hole clean! diff --git a/src/dusk/randomizer/generator/logic/hints.cpp b/src/dusk/randomizer/generator/logic/hints.cpp index 7deff29e4e..1b6c011a9a 100644 --- a/src/dusk/randomizer/generator/logic/hints.cpp +++ b/src/dusk/randomizer/generator/logic/hints.cpp @@ -45,6 +45,8 @@ namespace randomizer::logic::hints { text = getTextObject(textName + " Template"); text.Replace("", itemStandardName); text.Replace("", itemPrettyName); + text.Capitalize(); + text.BreakLines(); } } diff --git a/src/dusk/randomizer/generator/utility/text.cpp b/src/dusk/randomizer/generator/utility/text.cpp index b8ca9d67cd..df57b200b2 100644 --- a/src/dusk/randomizer/generator/utility/text.cpp +++ b/src/dusk/randomizer/generator/utility/text.cpp @@ -9,154 +9,6 @@ namespace randomizer { - // std::array supported_languages = {"English", "Spanish", "French"}; - // - // static std::unordered_map nameToColor = { - // {Text::Color::NONE, TEXT_COLOR_DEFAULT}, - // {Text::Color::RED, TEXT_COLOR_RED}, - // {Text::Color::GREEN, TEXT_COLOR_GREEN}, - // {Text::Color::BLUE, TEXT_COLOR_BLUE}, - // {Text::Color::YELLOW, TEXT_COLOR_YELLOW}, - // {Text::Color::CYAN, TEXT_COLOR_CYAN}, - // {Text::Color::MAGENTA, TEXT_COLOR_MAGENTA}, - // {Text::Color::GRAY, TEXT_COLOR_GRAY}, - // {Text::Color::ORANGE, TEXT_COLOR_ORANGE}, - // }; - // - // std::u16string apply_name_color(std::u16string str, const Color& color) - // { - // // Return the raw text (bars included) - // if (color == Color::RAW) - // { - // return str; - // } - // // If there are no '|'s then just return with the color surrounding the whole string - // if (str.find('|') == std::string::npos) - // { - // auto textColor = nameToColor[color]; - // return textColor + str + TEXT_COLOR_DEFAULT; - // } - // - // // Alternate between the text color and default incase there are multiple - // // pairs of bars - // auto textColor = nameToColor[color]; - // bool insertColor = false; - // for (size_t pos = 0; pos < str.length(); pos++) - // { - // if (str[pos] == '|') - // { - // insertColor = !insertColor; - // str.erase(pos, 1); - // str.insert(pos, insertColor ? textColor : TEXT_COLOR_DEFAULT); - // } - // } - // - // return str; - // } - // - // std::u16string word_wrap_string(const std::u16string& string, const size_t& max_line_len) { - // size_t index_in_str = 0; - // std::u16string wordwrapped_str; - // std::u16string current_word; - // size_t curr_word_len = 0; - // size_t len_curr_line = 0; - // - // while (index_in_str < string.length()) { //length is weird because its utf-16 - // char16_t character = string[index_in_str]; - // - // if (character == u'\x0E') { //need to parse the commands, only implementing a few necessary ones for now (will break with other commands) - // std::u16string substr; - // size_t code_len = 0; - // if (string[index_in_str + 1] == u'\x00') { - // if (string[index_in_str + 2] == u'\x03') { //color command - // if (string[index_in_str + 4] == u'\xFFFF') { //text color white, weird length - // code_len = 10; - // } - // else { - // code_len = 5; - // } - // } - // } - // else if (string[index_in_str + 1] == u'\x01') { //all implemented commands in this group have length 4 - // code_len = 4; - // } - // else if (string[index_in_str + 1] == u'\x02') { //all implemented commands in this group have length 4 - // code_len = 4; - // } - // else if (string[index_in_str + 1] == u'\x03') { //all implemented commands in this group have length 4 - // code_len = 4; - // } - // else if (string[index_in_str + 1] == u'\x04') { //all implemented commands in this group have length 4. Only used for Ho Ho sound - // code_len = 4; - // } - // - // substr = string.substr(index_in_str, code_len); - // current_word += substr; - // index_in_str += code_len; - // } - // else if (character == u'\n') { - // wordwrapped_str += current_word; - // wordwrapped_str += character; - // len_curr_line = 0; - // current_word = u""; - // curr_word_len = 0; - // index_in_str += 1; - // } - // else if (character == u' ') { - // wordwrapped_str += current_word; - // wordwrapped_str += character; - // len_curr_line += curr_word_len + 1; - // current_word = u""; - // curr_word_len = 0; - // index_in_str += 1; - // } - // else { - // current_word += character; - // curr_word_len += 1; - // index_in_str += 1; - // - // if (len_curr_line + curr_word_len > max_line_len) { - // wordwrapped_str += u'\n'; - // len_curr_line = 0; - // - // if (curr_word_len > max_line_len) { - // wordwrapped_str += current_word + u'\n'; - // current_word = u""; - // } - // } - // } - // } - // wordwrapped_str += current_word; - // - // return wordwrapped_str; - // } - // - // std::string pad_str_4_lines(const std::string& string) - // { - // std::vector lines = randomizer::utility::str::Split(string, '\n'); - // - // unsigned int padding_lines_needed = (4 - lines.size() % 4) % 4; - // for (unsigned int i = 0; i < padding_lines_needed; i++) - // { - // lines.push_back(""); - // } - // - // return randomizer::utility::str::Merge(lines, '\n'); - // } - // - // std::u16string pad_str_4_lines(const std::u16string& string) - // { - // std::vector lines = randomizer::utility::str::Split(string, u'\n'); - // - // unsigned int padding_lines_needed = (4 - lines.size() % 4) % 4; - // for (unsigned int i = 0; i < padding_lines_needed; i++) - // { - // lines.push_back(u""); - // } - // - // return randomizer::utility::str::erge(lines, u'\n'); - // } - Text::Text(const std::string& str) { for (auto& text : mText) { text = str; @@ -185,6 +37,38 @@ namespace randomizer { } } + void Text::Capitalize() { + try { + // Determine the platform-specific locale string +#if defined(_WIN32) || defined(_WIN64) + const char* localeName = "English_United States.1252"; +#else + const char* localeName = "en_US.iso88591"; +#endif + + static const std::locale latin1Locale(localeName); + + for (auto& text : mText) { + if (!text.empty()) { + text[0] = std::toupper(text[0], latin1Locale); + } + } + } catch (const std::runtime_error&) { + // Fallback incase the system completely lacks the requested locale definition + for (auto& text : mText) { + if (!text.empty()) { + text[0] = static_cast(std::toupper(static_cast(text[0]))); + } + } + } + } + + void Text::BreakLines(int maxLineWidth /*= MAX_LINE_WIDTH*/) { + for (auto& text : mText) { + breakLines(text, maxLineWidth); + } + } + bool Text::Empty() const { for (auto& text : mText) { if (!text.empty()) { @@ -289,7 +173,7 @@ namespace randomizer { return strToGender.at(str); } - return Text::Gender::NUETRAL; + return Text::Gender::NEUTRAL; } Text::Plurality stringToPlurality(const std::string& str) @@ -444,30 +328,89 @@ namespace randomizer { 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\x05\x00\x00\x20"s}, - {"", "\x1A\x05\x06\x00\x02"s}, - {"", "\x1A\x05\x06\x00\x03"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}, - }; + using namespace std::string_view_literals; + static const std::unordered_map messageCodes = { + {"", "\x1A\x05\x00\x00\x01"sv}, + {"", "\x1A\x05\x00\x00\x02"sv}, + {"", "\x1A\x05\x00\x00\x20"sv}, + {"", "\x1A\x05\x06\x00\x02"sv}, + {"", "\x1A\x05\x06\x00\x03"sv}, + {"", "\x1A\x06\x00\x00\x09\x01"sv}, + {"", "\x1A\x06\x00\x00\x09\x02"sv}, + {"", "\x1A\x06\x00\x00\x09\x03"sv}, + {"", "\x1A\x06\xFF\x00\x00\x00"sv}, + {"", "\x1A\x06\xFF\x00\x00\x01"sv}, + {"", "\x1A\x06\xFF\x00\x00\x02"sv}, + {"", "\x1A\x06\xFF\x00\x00\x03"sv}, + {"", "\x1A\x06\xFF\x00\x00\x04"sv}, + {"", "\x1A\x06\xFF\x00\x00\x06"sv}, + {"", "\x1A\x06\xFF\x00\x00\x08"sv}, + // custom colors + {"", "\x1A\x06\xFF\x00\x00\x09"sv}, + {"", "\x1A\x06\xFF\x00\x00\x0A"sv}, + {"", "\x1A\x06\xFF\x00\x00\x0B"sv}, + }; + void breakLines(std::string& str, int maxLineWidth) { + // Get game's font + auto gameFont = mDoExt_getMesgFont(); + + int curLineWidth = 0; + size_t i = 0; + size_t previousSpace = 0; + while (i < str.length()) { + + // Skip over control codes since they don't get displayed + std::string code{}; + for (const auto& [messageCode, replacement] : messageCodes) { + if (str.substr(i, messageCode.length()) == messageCode) { + code = messageCode; + break; + } + } + + if (!code.empty()) { + // Assume worst case for player name width. + // 8 chars max * max char width + if (code == "") { + curLineWidth += 8 * 21; + } + i += code.length(); + continue; + } + + // Keep track of the previous space to replace with + // a line break when we reach the maximum width + if (str[i] == ' ') { + previousSpace = i; + } + // If we encounter an already inserted newline, reset the counter + else if (str[i] == '\n') { + curLineWidth = 0; + ++i; + continue; + } + + JUTFont::TWidth width{}; + gameFont->getWidthEntry(str[i], &width); + curLineWidth += /*width.field_0x0 + */width.field_0x1; + // If we exceed the maximum line width, replace the + // previous space with a newline and start counting + // from the newline again + if (curLineWidth > maxLineWidth) { + str[previousSpace] = '\n'; + i = previousSpace; + curLineWidth = 0; + } + + ++i; + } + + // Free game's font + mDoExt_removeMesgFont(); + } + + void applyMessageCodes(std::string& str) { for (const auto& [code, replacement] : messageCodes) { size_t pos = 0; while ((pos = str.find(code, pos)) != std::string::npos) { diff --git a/src/dusk/randomizer/generator/utility/text.hpp b/src/dusk/randomizer/generator/utility/text.hpp index ad4b410c88..3bc386e5d4 100644 --- a/src/dusk/randomizer/generator/utility/text.hpp +++ b/src/dusk/randomizer/generator/utility/text.hpp @@ -44,7 +44,7 @@ namespace randomizer { enum Gender { - NUETRAL = 0, + NEUTRAL = 0, MASCULINE, FEMININE, GENDER_MAX, @@ -57,6 +57,8 @@ namespace randomizer { PLURALITY_MAX, }; + static constexpr size_t MAX_LINE_WIDTH = 441; + Text() = default; explicit Text(const std::string& str); @@ -72,6 +74,8 @@ namespace randomizer { */ 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); + void BreakLines(int maxLineWidth = MAX_LINE_WIDTH); + void Capitalize(); bool Empty() const; Text& operator+=(const Text& rhs); Text& operator+=(const std::string& rhs); @@ -110,6 +114,9 @@ namespace randomizer { Text addColor(const Text& text, Text::Color color, int count = 1, bool forceAround = false); + // Adds newlines in appropriate places to properly break the text string for textboxes + void breakLines(std::string& str, int maxLineWidth); + // Replaces the message codes in the string with the ingame hex equivalents void applyMessageCodes(std::string&); }; // namespace Text From b8f69e82dd2ff4718a884cc4b6dd62c59e647055 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Thu, 25 Jun 2026 08:57:34 -0700 Subject: [PATCH 2/6] add shadow crystal icon --- CMakeLists.txt | 2 ++ src/d/d_menu_ring.cpp | 7 ++----- src/d/d_meter2_info.cpp | 8 ++++++++ .../assets/textures/shadow_crystal.bti | Bin 0 -> 1976 bytes src/dusk/randomizer/randomizer.cmake | 1 + 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 src/dusk/randomizer/assets/textures/shadow_crystal.bti diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a3054a410..aa04dec7bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -525,6 +525,8 @@ endif () # Add embedded data to target file(GLOB_RECURSE RANDOMIZER_DATA "src/dusk/randomizer/generator/data/*") +file(GLOB_RECURSE RANDOMIZER_ASSETS "src/dusk/randomizer/assets/*") +list(APPEND RANDOMIZER_DATA ${RANDOMIZER_ASSETS}) set(RANDO_ROOT_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}) foreach (RANDOMIZER_FILE IN LISTS RANDOMIZER_DATA) diff --git a/src/d/d_menu_ring.cpp b/src/d/d_menu_ring.cpp index 15de2949c0..d223268cb6 100644 --- a/src/d/d_menu_ring.cpp +++ b/src/d/d_menu_ring.cpp @@ -28,16 +28,13 @@ #include #include -#if TARGET_PC -#include "dusk/randomizer/game/verify_item_functions.h" -#include "dusk/randomizer/game/tools.h" -#endif - #if TARGET_PC #include "dusk/game_clock.h" #include "dusk/menu_pointer.h" #include "dusk/settings.h" #include "dusk/ui/touch_controls.hpp" +#include "dusk/randomizer/game/verify_item_functions.h" +#include "dusk/randomizer/game/tools.h" #endif typedef void (dMenu_Ring_c::*initFunc)(); diff --git a/src/d/d_meter2_info.cpp b/src/d/d_meter2_info.cpp index 63e22056f5..6a8d656666 100644 --- a/src/d/d_meter2_info.cpp +++ b/src/d/d_meter2_info.cpp @@ -15,7 +15,10 @@ #include +#if TARGET_PC #include "dusk/string.hpp" +#include "battery/embed.hpp" +#endif enum ITEMICON_RES_FILE_ID { ITEMICON_BTI_ARI_MESU_00=0x3, @@ -815,6 +818,11 @@ int dMeter2Info_c::readItemTexture(u8 i_itemNo, void* i_texBuf1, J2DPicture* i_p } else if ((itemType == ItemType_POU_FIRE || itemType == ItemType_FAIRY || itemType == ItemType_BEE_CHILD || itemType == ItemType_WORM) && i_texBuf3 == NULL) { u32 size = JKRReadIdxResource(i_texBuf1, 0xC00, get2ndTexture(itemType), dComIfGp_getItemIconArchive()); JUT_ASSERT(1222, size != 0); +#if TARGET_PC + } else if (randomizer_IsActive() && i_itemNo == dItemNo_Randomizer_MAGIC_LV1_e) { + auto shadowCrystalBti = b::embed(); + std::memcpy(i_texBuf1, shadowCrystalBti.data(), shadowCrystalBti.size()); +#endif } else { u32 size; if (param_9 >= 0) { diff --git a/src/dusk/randomizer/assets/textures/shadow_crystal.bti b/src/dusk/randomizer/assets/textures/shadow_crystal.bti new file mode 100644 index 0000000000000000000000000000000000000000..c6c4dd636bee95302869a503309773aa5257808f GIT binary patch literal 1976 zcmb_d&u<$=6rSCAYtMS#uCudQd)+3E-PmywViVdxL;2C91!CI%0X>35r1A&gvr!WX zRYmj=q;iWyddM+S4@KfoPy6U>dEfiK zdGFb^*#ui;%(B@P#)=I_%d+TCZy0N&&;RRT>BtnD11BgHLAY7y#5SA6F`EQT0!jA% zKS0R=iGt`n@Cnl+N_`XJ{25(LCKcBdcW6YiAeRb5J2GQa(vQ zS5EvI2u%SHzg;VgmP*WaT(9Ujtme9;4cHWy)we6sfv`ItD#bZUf!HDO%>eOD;Yvj) zT4!HBapv42c>eUbQ-7lyPt@O1I2Uy)O@)#!D(5qmm|&n~v&41N%1oF&O9r1muWN}M zu2XJQx!5Bl>q!`Ph*pZlWkDD&w0)F;kfJrIROlJ&mMF`nY+EKonCFIL1wB?A?bVo7YWNvOg=&7xGIzp&(C zyc_{~Am3@X>+ild)@q-OB9BsP#*~w$ZQS z(lT|Iqs7gfva>oQ=hLsK9?Aaz<4awEoeo{b7&ZG!A2A9rl=^;=I!sTNe9)NdrnBk0 zG|UmcoHxh3?vEf@>y!6nBKo?VoDvNes-Oa+TvHG z*dJ^x-)ijiudZ$vZvSxm`t)Gq&X8?xt*w4@BOa_>_-uXSU~#aud-ur}8*X1)-QWDR z^;6^E)M4ZC=H}OHd%y6#!r|((6fgC{qy z|J;8z+*^6@Xn1L-@brV5KYn@T+Yk5I=kD<7oiFxg_8 C|G+i? literal 0 HcmV?d00001 diff --git a/src/dusk/randomizer/randomizer.cmake b/src/dusk/randomizer/randomizer.cmake index a6296edece..3bf7a4e111 100644 --- a/src/dusk/randomizer/randomizer.cmake +++ b/src/dusk/randomizer/randomizer.cmake @@ -7,6 +7,7 @@ set(GAME_COMPILE_DEFS ${GAME_COMPILE_DEFS} RANDOMIZER_ONLY=${RANDOMIZER_ONLY} RANDO_SAVE_PATH="${RANDO_SAVE_PATH}" RANDO_DATA_PATH="src/dusk/randomizer/generator/data/" + RANDO_ASSETS_PATH="src/dusk/randomizer/assets/" RANDO_LOGIC_TESTS_PATH="${CMAKE_SOURCE_DIR}/src/dusk/randomizer/generator/data/tests/logic") if(RANDO_ERROR_LOG) From 563944d4a3c3f45767c6a9b80c30733632f9baa6 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Fri, 26 Jun 2026 11:32:59 -0700 Subject: [PATCH 3/6] use updated shadow crystal bti from melonspeedruns --- .../assets/textures/shadow_crystal.bti | Bin 1976 -> 2754 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/dusk/randomizer/assets/textures/shadow_crystal.bti b/src/dusk/randomizer/assets/textures/shadow_crystal.bti index c6c4dd636bee95302869a503309773aa5257808f..9d43aeb438f6be69cefa88b68ec190a320a3c5c1 100644 GIT binary patch literal 2754 zcmcguPiz!b9G=ah+wPX_%F?nHbc>~wg@RO2L@(ZrE(wWVJsTlP z3>pqS;K2kFP)H=vL=N7RgpiVO=z#+!Tr^;6#Ka>eGJfw(7qrHPAo`NdxASKA{l59W z@Aped&S)7s4a3YCFB=A}8(5}^KlQ;d>iYVBUCdlgmC6?^OM&AOl9f)=j8B@{d9{`G<*JEUURlfTxys_0CSDNBZLo$yd*@FgiAa{C{2l9{41{R|2t-;ep{RoWak8y zHYc!1u}}!|4k6IUfWK{gC>Zfv4-| zz08k_n_+dmnl zrDVWE%LRUedu{K-`kV1F%SE3U<)C1}A|n7Ztda4SUwdLSiDc4fOiXSjwBG4(&Owzk z!T83cy$Lkj&FvPAA|jq_PAMGWb`$)GuVn*|%z!j41eunaR;5G; zzHug*+lIX;3>ge3b{RaXF0t|%LQ3ROJFocVijHODHIQFeWRxB7QU0ksH+SXA0U{(O zEX($Z=uN5b5Xnn57nVA#*YZX~Iy2jCNg2u6#FG)_4H-@`Dm%g(8?npRd3{4C@pLB7ygbQ92oja21LX}0&-Ds>$u z7iRaCV#y?(oS&-;){Ce;E0Ohx?UQo2!6|bXug6?)#<*ZkhjGc6BWG%@cG9X55mM@T zHR4Ff5J69cScBZ@_JwYPd)+p;S3Jt#q0!FJ800?~fgka6`#GD8geWaAbRZRR54CF^ z$T3;sLb9H8z&wn5JjNZ5Rig^NaG=}mwk0F3<#}qbcR&UpR>kn`!W6~?i^ zV&E4;uuzEZ{NAl#VvACvIR-zGyHHd&5VW*jdW=A)L7xnCE8O=Nh9dKdj*6Z_`06S& zF*xQV@{fug7~APpD%omB#&i@Qde-!fDxYrTZqt`jD=6h z?k3ncd1Ln$0L;Spvy^A6ppJWpwZ_lY+zt4`UY$RTG>x!Tp^5Q}9P#K7!UHdLbU3)F z+L$2-cVG~aB`BL)N|{Gl>+*xGG{&i_T|=O1-w3E^QpL(Ing+nNVGY1h4r$SVk7upN zPq`T(e+qRD!H@W;n=9IOQE8->$Oe<4$CP@gcOTbfJ$|TRX6aPb(lu)>gEf!;_W#eL zJ%7M&?eBxs?zj5W{kQt(oiC4E*uOY`vVP1wbL*A&}GWiiZ zdvNjRrSY#WE#+=r{jT^MJ#qBrdpECKY%eX`J835r1A&gvr!WX zRYmj=q;iWyddM+S4@KfoPy6U>dEfiK zdGFb^*#ui;%(B@P#)=I_%d+TCZy0N&&;RRT>BtnD11BgHLAY7y#5SA6F`EQT0!jA% zKS0R=iGt`n@Cnl+N_`XJ{25(LCKcBdcW6YiAeRb5J2GQa(vQ zS5EvI2u%SHzg;VgmP*WaT(9Ujtme9;4cHWy)we6sfv`ItD#bZUf!HDO%>eOD;Yvj) zT4!HBapv42c>eUbQ-7lyPt@O1I2Uy)O@)#!D(5qmm|&n~v&41N%1oF&O9r1muWN}M zu2XJQx!5Bl>q!`Ph*pZlWkDD&w0)F;kfJrIROlJ&mMF`nY+EKonCFIL1wB?A?bVo7YWNvOg=&7xGIzp&(C zyc_{~Am3@X>+ild)@q-OB9BsP#*~w$ZQS z(lT|Iqs7gfva>oQ=hLsK9?Aaz<4awEoeo{b7&ZG!A2A9rl=^;=I!sTNe9)NdrnBk0 zG|UmcoHxh3?vEf@>y!6nBKo?VoDvNes-Oa+TvHG z*dJ^x-)ijiudZ$vZvSxm`t)Gq&X8?xt*w4@BOa_>_-uXSU~#aud-ur}8*X1)-QWDR z^;6^E)M4ZC=H}OHd%y6#!r|((6fgC{qy z|J;8z+*^6@Xn1L-@brV5KYn@T+Yk5I=kD<7oiFxg_8 C|G+i? From ec2173db9fd82cf3be86b806069e6e839dd38cbd Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Fri, 26 Jun 2026 11:34:22 -0700 Subject: [PATCH 4/6] change seed option menu styling --- res/rml/window.rcss | 12 ++ src/dusk/ui/pane.cpp | 3 + src/dusk/ui/rando_config.cpp | 271 +++++++++++++++++------------------ 3 files changed, 148 insertions(+), 138 deletions(-) diff --git a/res/rml/window.rcss b/res/rml/window.rcss index c9357cc687..bc36604f85 100644 --- a/res/rml/window.rcss +++ b/res/rml/window.rcss @@ -532,3 +532,15 @@ progress.verification-progress-bar { flex: 0 0 auto; padding-top: 4dp; } + +.current-option-text { + padding-left: 5dp; + border: 2dp #C2A42D; + border-radius: 14dp; +} + +.not-current-option-text { + padding-left: 5dp; + margin: 2dp; /*Used to mimic border*/ + opacity: 0.5; +} \ No newline at end of file diff --git a/src/dusk/ui/pane.cpp b/src/dusk/ui/pane.cpp index 902ffbd2ca..05425bb6c9 100644 --- a/src/dusk/ui/pane.cpp +++ b/src/dusk/ui/pane.cpp @@ -222,6 +222,9 @@ bool Pane::focus_closest_child(float posY) { } else if (posY >= 0.f) { float closestRightChildDistance = std::numeric_limits::max(); for (const auto& child : children()) { + if (child->disabled()) { + continue; + } float distance = std::abs(posY - child->root()->GetAbsoluteTop()); if (distance < closestRightChildDistance) { closestchild = child->root(); diff --git a/src/dusk/ui/rando_config.cpp b/src/dusk/ui/rando_config.cpp index b8f830e6b7..746be6e89c 100644 --- a/src/dusk/ui/rando_config.cpp +++ b/src/dusk/ui/rando_config.cpp @@ -19,15 +19,6 @@ #include namespace dusk::ui { -struct ConfigBoolProps { - Rml::String key; - Rml::String icon; - Rml::String helpText; - std::function onChange; - std::function isDisabled; -}; - - randomizer::seedgen::settings::Setting* FindSetting(const std::string& key) { if (key.empty()) { @@ -59,33 +50,40 @@ bool TryCreateRandomSeed() { return false; } -// ripped straight from settings window -SelectButton& config_bool_select( - Pane& leftPane, Pane& rightPane, ConfigVar& var, ConfigBoolProps props) { - auto& button = leftPane.add_child(BoolButton::Props{ - .key = std::move(props.key), - .icon = std::move(props.icon), - .getValue = [&var] { return var.getValue(); }, - .setValue = - [&var, callback = std::move(props.onChange)](bool value) { - if (value == var.getValue()) { - return; - } - var.setValue(value); - config::Save(); - if (callback) { - callback(value); - } - }, - .isDisabled = std::move(props.isDisabled), - .isModified = [&var] { return var.getValue() != var.getDefaultValue(); }, - }); - leftPane.register_control( - button, rightPane, [helpText = std::move(props.helpText)](Pane& pane) { - pane.clear(); - pane.add_rml(helpText); - }); - return button; +void rando_config_group_update_right_pane( + Pane& pane, + randomizer::seedgen::settings::Setting* curSetting, + std::function onSelected) +{ + pane.clear(); + auto curSelIdx = curSetting->GetCurrentOptionIndex(); + auto settingInfo = curSetting->GetInfo(); + + Rml::Element* text_elem = pane.add_rml(settingInfo->GetDescriptions().at(curSelIdx)); + + for (int i = 0; i < settingInfo->GetOptions().size(); ++i) { + pane.add_button( + { + .text = settingInfo->GetOptions()[i], + .isSelected = [curSetting, i] { + return curSetting->GetCurrentOptionIndex() == i; + }, + }) + .on_pressed([i, text_elem, curSetting, &pane, onSelected] { + auto settingInfo = curSetting->GetInfo(); + + mDoAud_seStartMenu(kSoundItemChange); + curSetting->SetCurrentOption(i); + text_elem->SetInnerRML(settingInfo->GetDescriptions().at(i)); + + SaveRandomizerConfig(); + rando_config_group_update_right_pane(pane, curSetting, onSelected); + }); + } + + if (onSelected) { + onSelected(curSetting->GetCurrentOption(), pane); + } } void rando_config_group(Pane& leftPane, Pane& rightPane, std::string settingKey, @@ -105,68 +103,67 @@ void rando_config_group(Pane& leftPane, Pane& rightPane, std::string settingKey, [curSetting] { return Rml::String{curSetting->GetCurrentOption()}; }, }), rightPane, [curSetting, onSelected](Pane& pane) { - auto curSelIdx = curSetting->GetCurrentOptionIndex(); - auto settingInfo = curSetting->GetInfo(); - - Rml::Element* text_elem = pane.add_rml(settingInfo->GetDescriptions().at(curSelIdx)); - - for (int i = 0; i < settingInfo->GetOptions().size(); ++i) { - pane.add_button( - { - .text = settingInfo->GetOptions()[i], - .isSelected = [curSetting, i] { - return curSetting->GetCurrentOptionIndex() == i; - }, - }) - .on_pressed([i, text_elem, curSetting] { - auto settingInfo = curSetting->GetInfo(); - - mDoAud_seStartMenu(kSoundItemChange); - curSetting->SetCurrentOption(i); - text_elem->SetInnerRML(settingInfo->GetDescriptions().at(i)); - - SaveRandomizerConfig(); - }); - } - - if (onSelected) { - onSelected(curSetting->GetCurrentOption(), pane); - } + rando_config_group_update_right_pane(pane, curSetting, onSelected); }); } -SelectButton& rando_config_toggle( +SelectButton& rando_config_button( Pane& leftPane, Pane& rightPane, std::string settingKey) { auto setting = FindSetting(settingKey); - auto& button = leftPane.add_child(BoolButton::Props{ - .key = settingKey, - .getValue = [setting] { return setting->GetCurrentOptionIndex() != 0; }, - .setValue = - [setting](bool value) { - auto idx = setting->GetCurrentOptionIndex(); - if (idx == value) { - return; - } - - setting->SetCurrentOption(value); - - SaveRandomizerConfig(); - }, - }); - auto& comp = leftPane.register_control( - button, rightPane, [setting](Pane& pane) { - pane.clear(); - - auto info = setting->GetInfo(); - pane.add_rml(info->GetDescriptions()[setting->GetCurrentOptionIndex()]); - }); - - comp.listen(comp.root(), Rml::EventId::Click, [&rightPane, setting](Rml::Event&) { + // Helper function to call when we want to update the right pane + auto updateRightPane = [setting, &rightPane] { rightPane.clear(); auto info = setting->GetInfo(); - rightPane.add_rml(info->GetDescriptions()[setting->GetCurrentOptionIndex()]); + // Show all options/descriptions + for (size_t i = 0; i < info->GetOptions().size(); ++i) { + auto text = rightPane.add_rml(fmt::format("{}: {}", info->GetOptions()[i], info->GetDescriptions()[i])); + // Change styling for currently selected option + if (i == setting->GetCurrentOptionIndex()) { + text->SetClass("current-option-text", true); + } else { + text->SetClass("not-current-option-text", true); + } + } + }; + + // Helper function for changing the setting index based on button presses + auto changeOptionIndex = [setting, updateRightPane](int change) { + auto newIndex = setting->GetCurrentOptionIndex() + change; + if (newIndex < 0) { + newIndex = setting->GetInfo()->GetOptions().size() - 1; + } else if (newIndex >= setting->GetInfo()->GetOptions().size()) { + newIndex = 0; + } + setting->SetCurrentOption(newIndex); + updateRightPane(); + }; + + auto& button = leftPane.add_select_button(ControlledSelectButton::Props{ + .key = settingKey, + .getValue = [setting] { return setting->GetCurrentOption(); } + }) + // Cycle through the options forward when the button is pressed + .on_pressed([changeOptionIndex] { + changeOptionIndex(1); + }); + + // Update the right pane info when we change between options + auto& comp = leftPane.register_control(button, rightPane, [updateRightPane](Pane&) { + updateRightPane(); + }); + + // Listen for left/right nav commands to cycle between the available options + comp.listen(comp.root(), Rml::EventId::Keydown, [changeOptionIndex](Rml::Event& event) { + auto cmd = map_nav_event(event); + if (cmd == NavCommand::Left) { + changeOptionIndex(-1); + event.StopPropagation(); + } else if (cmd == NavCommand::Right) { + changeOptionIndex(1); + event.StopPropagation(); + } }); return button; @@ -916,7 +913,7 @@ RandomizerWindow::RandomizerWindow(dFile_select_c* fileSelect /*= nullptr*/) : m leftPane.add_section("Logic Settings"); - rando_config_group(leftPane, rightPane, "Logic Rules"); + rando_config_button(leftPane, rightPane, "Logic Rules"); leftPane.add_section("Access Options"); @@ -924,74 +921,72 @@ RandomizerWindow::RandomizerWindow(dFile_select_c* fileSelect /*= nullptr*/) : m [](const std::string& value, Pane& pane) { return rando_add_optional_setting(value, "Hyrule Barrier", pane); }); - rando_config_group(leftPane, rightPane, "Palace of Twilight Requirements"); - rando_config_group(leftPane, rightPane, "Faron Woods Logic"); - rando_config_group(leftPane, rightPane, "Mirror Chamber Access"); + rando_config_button(leftPane, rightPane, "Palace of Twilight Requirements"); + rando_config_button(leftPane, rightPane, "Faron Woods Logic"); + rando_config_button(leftPane, rightPane, "Mirror Chamber Access"); - // leftPane.add_section("World (TODO)"); + leftPane.add_section("Shuffles"); - leftPane.add_section("Item Pool"); + rando_config_button(leftPane, rightPane, "Golden Bugs"); + rando_config_button(leftPane, rightPane, "Sky Characters"); + rando_config_button(leftPane, rightPane, "Gifts From NPCs"); + rando_config_button(leftPane, rightPane, "Shop Items"); + rando_config_button(leftPane, rightPane, "Hidden Skills"); + rando_config_button(leftPane, rightPane, "Hidden Rupees"); + rando_config_button(leftPane, rightPane, "Freestanding Rupees"); - rando_config_toggle(leftPane, rightPane, "Golden Bugs"); - rando_config_toggle(leftPane, rightPane, "Sky Characters"); - rando_config_toggle(leftPane, rightPane, "Gifts From NPCs"); - rando_config_toggle(leftPane, rightPane, "Shop Items"); - rando_config_toggle(leftPane, rightPane, "Hidden Skills"); - rando_config_toggle(leftPane, rightPane, "Hidden Rupees"); - rando_config_toggle(leftPane, rightPane, "Freestanding Rupees"); - - rando_config_group(leftPane, rightPane, "Poe Souls"); - rando_config_group(leftPane, rightPane, "Ilia Memory Quest"); - rando_config_group(leftPane, rightPane, "Item Scarcity"); - rando_config_group(leftPane, rightPane, "Trap Item Frequency"); + rando_config_button(leftPane, rightPane, "Poe Souls"); + rando_config_button(leftPane, rightPane, "Ilia Memory Quest"); + rando_config_button(leftPane, rightPane, "Item Scarcity"); + rando_config_button(leftPane, rightPane, "Trap Item Frequency"); leftPane.add_section("Dungeon Items"); - rando_config_group(leftPane, rightPane, "Small Keys"); - rando_config_group(leftPane, rightPane, "Big Keys"); - rando_config_group(leftPane, rightPane, "Maps and Compasses"); + rando_config_button(leftPane, rightPane, "Small Keys"); + rando_config_button(leftPane, rightPane, "Big Keys"); + rando_config_button(leftPane, rightPane, "Maps and Compasses"); rando_config_group(leftPane, rightPane, "Hyrule Castle Big Key Requirements", [](const std::string& value, Pane& pane) { return rando_add_optional_setting(value, "Hyrule Castle Big Key", pane); }); - rando_config_toggle(leftPane, rightPane, "Dungeon Rewards Can Be Anywhere"); - rando_config_toggle(leftPane, rightPane, "No Small Keys on Bosses"); - rando_config_toggle(leftPane, rightPane, "Unrequired Dungeons Are Barren"); + rando_config_button(leftPane, rightPane, "Dungeon Rewards Can Be Anywhere"); + rando_config_button(leftPane, rightPane, "No Small Keys on Bosses"); + rando_config_button(leftPane, rightPane, "Unrequired Dungeons Are Barren"); leftPane.add_section("Timesavers"); - rando_config_toggle(leftPane, rightPane, "Skip Prologue"); - rando_config_toggle(leftPane, rightPane, "Faron Twilight Cleared"); - rando_config_toggle(leftPane, rightPane, "Eldin Twilight Cleared"); - rando_config_toggle(leftPane, rightPane, "Lanayru Twilight Cleared"); - rando_config_toggle(leftPane, rightPane, "Skip Midna's Desparate Hour"); - rando_config_toggle(leftPane, rightPane, "Skip Minor Cutscenes"); - rando_config_toggle(leftPane, rightPane, "Skip Major Cutscenes"); - rando_config_toggle(leftPane, rightPane, "Unlock Map Regions"); - rando_config_toggle(leftPane, rightPane, "Open Door of Time"); - rando_config_toggle(leftPane, rightPane, "Active Goron Mines Magnets"); - rando_config_toggle(leftPane, rightPane, "Lower Hyrule Castle Chandelier"); - rando_config_toggle(leftPane, rightPane, "Skip Bridge Donation"); + rando_config_button(leftPane, rightPane, "Skip Prologue"); + rando_config_button(leftPane, rightPane, "Faron Twilight Cleared"); + rando_config_button(leftPane, rightPane, "Eldin Twilight Cleared"); + rando_config_button(leftPane, rightPane, "Lanayru Twilight Cleared"); + rando_config_button(leftPane, rightPane, "Skip Midna's Desparate Hour"); + rando_config_button(leftPane, rightPane, "Skip Minor Cutscenes"); + rando_config_button(leftPane, rightPane, "Skip Major Cutscenes"); + rando_config_button(leftPane, rightPane, "Unlock Map Regions"); + rando_config_button(leftPane, rightPane, "Open Door of Time"); + rando_config_button(leftPane, rightPane, "Active Goron Mines Magnets"); + rando_config_button(leftPane, rightPane, "Lower Hyrule Castle Chandelier"); + rando_config_button(leftPane, rightPane, "Skip Bridge Donation"); leftPane.add_section("Additional Settings"); // rando_config_group(leftPane, rightPane, "Starting Form"); // rando_config_toggle(leftPane, rightPane, "Bonks Do Damage"); - rando_config_group(leftPane, rightPane, "Starting Time of Day"); - rando_config_toggle(leftPane, rightPane, "Logic Transform Anywhere"); - rando_config_toggle(leftPane, rightPane, "Logic Increase Wallet Capacity"); - rando_config_group(leftPane, rightPane, "Logic Damage Multiplier"); + rando_config_button(leftPane, rightPane, "Starting Time of Day"); + rando_config_button(leftPane, rightPane, "Logic Transform Anywhere"); + rando_config_button(leftPane, rightPane, "Logic Increase Wallet Capacity"); + rando_config_button(leftPane, rightPane, "Logic Damage Multiplier"); leftPane.add_section("Dungeon Entrance Settings"); - rando_config_toggle(leftPane, rightPane, "Lakebed Does Not Require Water Bombs"); - rando_config_toggle(leftPane, rightPane, "Arbiters Does Not Require Bulblin Camp"); - rando_config_toggle(leftPane, rightPane, "Snowpeak Does Not Require Reekfish Scent"); - rando_config_toggle(leftPane, rightPane, "Sacred Grove Does Not Require Skull Kid"); - rando_config_toggle(leftPane, rightPane, "City Does Not Require Filled Skybook"); - rando_config_group(leftPane, rightPane, "Goron Mines Entrance"); - rando_config_group(leftPane, rightPane, "Temple of Time Sword Requirement"); + rando_config_button(leftPane, rightPane, "Lakebed Does Not Require Water Bombs"); + rando_config_button(leftPane, rightPane, "Arbiters Does Not Require Bulblin Camp"); + rando_config_button(leftPane, rightPane, "Snowpeak Does Not Require Reekfish Scent"); + rando_config_button(leftPane, rightPane, "Sacred Grove Does Not Require Skull Kid"); + rando_config_button(leftPane, rightPane, "City Does Not Require Filled Skybook"); + rando_config_button(leftPane, rightPane, "Goron Mines Entrance"); + rando_config_button(leftPane, rightPane, "Temple of Time Sword Requirement"); // rando_config_toggle(leftPane, rightPane, "Randomize Starting Spawn"); // rando_config_group(leftPane, rightPane, "Randomize Dungeon Entrances"); // rando_config_toggle(leftPane, rightPane, "Randomize Boss Entrances"); @@ -1004,8 +999,8 @@ RandomizerWindow::RandomizerWindow(dFile_select_c* fileSelect /*= nullptr*/) : m leftPane.add_section("Tricks"); - rando_config_toggle(leftPane, rightPane, "Back Slice as Sword"); - rando_config_toggle(leftPane, rightPane, "Ball and Chain Webs"); + rando_config_button(leftPane, rightPane, "Back Slice as Sword"); + rando_config_button(leftPane, rightPane, "Ball and Chain Webs"); }); add_tab("Starting Inventory", [this](Rml::Element* content) { From f62a70f9d05c21355fc84cd716021ab1b71f8f11 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Fri, 26 Jun 2026 11:40:09 -0700 Subject: [PATCH 5/6] update starting time of day descriptions --- src/dusk/randomizer/generator/data/settings_list.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dusk/randomizer/generator/data/settings_list.yaml b/src/dusk/randomizer/generator/data/settings_list.yaml index fae5064bfa..706f5e3bbc 100644 --- a/src/dusk/randomizer/generator/data/settings_list.yaml +++ b/src/dusk/randomizer/generator/data/settings_list.yaml @@ -395,10 +395,10 @@ - Name: Starting Time of Day Default Option: Noon Options: - - Morning: "Choose your in-game starting time." - - Noon: "" - - Evening: "" - - Night: "" + - Morning: "Time of day will start at 9am." + - Noon: "Time of day will start at noon." + - Evening: "Time of day will start at 6pm." + - Night: "Time of day will start at midnight." - Name: Logic Transform Anywhere Default Option: "On" From 1b3b493fbf244faf1cd0dc823638abfc593be8bc Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Fri, 26 Jun 2026 11:53:33 -0700 Subject: [PATCH 6/6] reset rando context if current seed is deleted --- src/dusk/ui/rando_config.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dusk/ui/rando_config.cpp b/src/dusk/ui/rando_config.cpp index 746be6e89c..3e362d9ace 100644 --- a/src/dusk/ui/rando_config.cpp +++ b/src/dusk/ui/rando_config.cpp @@ -689,7 +689,11 @@ void delete_seed_callback(Pane& pane) { return !playerIsOnTitleScreen() || hash.ends_with(')'); } }) - .on_pressed([entry, &pane] { + .on_pressed([entry, &pane, hash] { + // If the currently selected seed is deleted, reset the context + if (randomizer_GetContext().mHash == hash) { + randomizer_GetContext() = RandomizerContext{}; + } std::filesystem::remove_all(entry); delete_seed_callback(pane); });