Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gui/desktop/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ void MainWindow::apply_config_settings()
APPLY_CHECKBOX_SETTING(config, ui, ho_ho_hints);
APPLY_CHECKBOX_SETTING(config, ui, ho_ho_triforce_hints);
APPLY_CHECKBOX_SETTING(config, ui, korl_hints);
APPLY_CHECKBOX_SETTING(config, ui, kreeb_bow_hints);
APPLY_CHECKBOX_SETTING(config, ui, use_always_hints);
APPLY_CHECKBOX_SETTING(config, ui, clearer_hints);
APPLY_CHECKBOX_SETTING(config, ui, hint_importance);
Expand Down Expand Up @@ -1102,6 +1103,7 @@ void MainWindow::on_player_in_casual_clothes_stateChanged(int arg1) {
DEFINE_STATE_CHANGE_FUNCTION(ho_ho_hints)
DEFINE_STATE_CHANGE_FUNCTION(ho_ho_triforce_hints)
DEFINE_STATE_CHANGE_FUNCTION(korl_hints)
DEFINE_STATE_CHANGE_FUNCTION(kreeb_bow_hints)
DEFINE_STATE_CHANGE_FUNCTION(use_always_hints)
DEFINE_STATE_CHANGE_FUNCTION(clearer_hints)
DEFINE_STATE_CHANGE_FUNCTION(hint_importance)
Expand Down Expand Up @@ -1372,3 +1374,4 @@ void MainWindow::on_paste_permalink_clicked()
auto permalink = QGuiApplication::clipboard()->text();
on_permalink_textEdited(permalink);
}

4 changes: 1 addition & 3 deletions gui/desktop/mainwindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ private slots:
void on_ho_ho_hints_stateChanged(int arg1);
void on_ho_ho_triforce_hints_stateChanged(int arg1);
void on_korl_hints_stateChanged(int arg1);
void on_kreeb_bow_hints_stateChanged(int arg1);
void on_use_always_hints_stateChanged(int arg1);
void on_path_hints_valueChanged(int path_hints);
void on_barren_hints_valueChanged(int barren_hints);
Expand Down Expand Up @@ -304,9 +305,6 @@ private slots:
void open_chart_mapping_list(uint8_t islandNum);
void tracker_give_and_map_chart(TrackerLabel* label, GameItem chart);




public:
void update_items_color();
void update_locations_color();
Expand Down
111 changes: 59 additions & 52 deletions gui/desktop/mainwindow.ui

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions gui/desktop/option_descriptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ static std::unordered_map<std::string, std::string> optionDescriptions = {
"korl_hints",
"Places hints on the King of Red Lions. Talk to the King of Red Lions to get hints.",
},
{
"kreeb_bow_hints",
"When this option is selected, Kreeb will give an item hint for each Progressive Bow after Link reactivates the Windfall lighthouse.",
},
{
"path_hints",
"Determines the number of path hints that will be placed in the game, distributed using the selected hint placement options.<br>If multiple hint placement options are selected, the hint count will be split evenly among the placement options.",
Expand Down
10 changes: 10 additions & 0 deletions gui/wiiu/OptionActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ namespace OptionCB {
return fromBool(conf.settings.korl_hints);
}

std::string toggleKreebBowHints() {
conf.settings.kreeb_bow_hints = !conf.settings.kreeb_bow_hints;
return fromBool(conf.settings.kreeb_bow_hints);
}

std::string toggleClearHints() {
conf.settings.clearer_hints = !conf.settings.clearer_hints;
return fromBool(conf.settings.clearer_hints);
Expand Down Expand Up @@ -983,6 +988,8 @@ std::string getValue(const Option& option) {
return fromBool(conf.settings.ho_ho_triforce_hints);
case Option::KorlHints:
return fromBool(conf.settings.korl_hints);
case Option::KreebBowHints:
return fromBool(conf.settings.kreeb_bow_hints);
case Option::ClearerHints:
return fromBool(conf.settings.clearer_hints);
case Option::UseAlwaysHints:
Expand Down Expand Up @@ -1195,6 +1202,8 @@ TriggerCallback getCallback(const Option& option) {
return &toggleHoHoTriforceHints;
case Option::KorlHints:
return &toggleKorlHints;
case Option::KreebBowHints:
return &toggleKreebBowHints;
case Option::ClearerHints:
return &toggleClearHints;
case Option::UseAlwaysHints:
Expand Down Expand Up @@ -1362,6 +1371,7 @@ std::pair<std::string, std::string> getNameDesc(const Option& option) {
{HoHoHints, {"Place Hints on Old Man Ho Ho", "Places hints on Old Man Ho Ho. Old Man Ho Ho appears at 10 different islands. Simply talk to Old Man Ho Ho to get hints."}},
{HoHoTriforceHints, {"Old Man Ho Ho Hints Shards", "When this option is selected, each Old Man Ho Ho will give an item hint for a Triforce Shard. Hints are not repeated until each shard is hinted once. This setting will override placing other hints on Old Man Ho Ho."}},
{KorlHints, {"Place Hints on King of Red Lions", "Places hints on the King of Red Lions. Talk to the King of Red Lions to get hints."}},
{KreebBowHints, {"Kreeb Hints Bows", "When this option is selected, Kreeb will give an item hint for each Progressive Bow after Link reactivates the Windfall lighthouse."}},
{ClearerHints, {"Clearer Hints", "When this option is selected, location and item hints will use the standard check or item name, instead of using cryptic hints."}},
{UseAlwaysHints, {"Use Always Hints", "When the number of location hints is nonzero, certain locations that will always be hinted will take precedence over normal location hints."}},
{HintImportance, {"Hint Importance", "When this option is selected, item and location hints will also indicate if the hinted item is required, possibly required, or not required. Only progress items will have these additions; non-progress items are trivially not required."}},
Expand Down
1 change: 1 addition & 0 deletions gui/wiiu/OptionActions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace OptionCB {
std::string toggleHoHoHints();
std::string toggleHoHoTriforceHints();
std::string toggleKorlHints();
std::string toggleKreebBowHints();
std::string toggleClearHints();
std::string toggleAlwaysHints();
std::string toggleHintImportance();
Expand Down
1 change: 1 addition & 0 deletions gui/wiiu/Page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ HintsPage::HintsPage() {
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::HoHoHints));
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::HoHoTriforceHints));
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::KorlHints));
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::KreebBowHints));
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::ClearerHints));
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::UseAlwaysHints));
buttonColumns[0].emplace_back(std::make_unique<BasicButton>(Option::HintImportance));
Expand Down
24 changes: 24 additions & 0 deletions logic/Hints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,24 @@ static HintError assignHoHoHints(World& world, WorldPool& worlds, std::list<Loca
return HintError::NONE;
}

static HintError assignKreebHints(World& world, WorldPool& worlds)
{
// Get all bow locations
// Shuffle locations to prevent any possible meta-gaming where the last bow might be
// since otherwise they'll appear in order of location id
auto allLocations = world.getLocations(/*onlyProgression = */ true);
shufflePool(allLocations);
for (auto& location : allLocations)
{
if (location->currentItem.getGameItemId() == GameItem::ProgressiveBow)
{
world.kreebHints.push_back(location);
LOG_AND_RETURN_IF_ERR(generateItemHintMessage(location));
}
}
return HintError::NONE;
}

HintError generateHints(WorldPool& worlds)
{
LOG_AND_RETURN_IF_ERR(calculatePossiblePathLocations(worlds));
Expand Down Expand Up @@ -751,6 +769,12 @@ HintError generateHints(WorldPool& worlds)
uint8_t totalMadeHints = hintLocations.size();
LOG_AND_RETURN_IF_ERR(generateLocationHintLocations(world, hintLocations, totalNumHints - totalMadeHints));

// Assign Kreeb Bow Hints if the setting is enabled
if (settings.kreeb_bow_hints)
{
assignKreebHints(world, worlds);
}

// Distribute hints evenly among the possible hint placement options
std::vector<std::string> hintPlacementOptions = {};
std::unordered_map<std::string, std::list<Location*>> hintsForCategory = {};
Expand Down
2 changes: 2 additions & 0 deletions logic/LogicTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ void runLogicTests(Config& newConfig)
TEST(settings1, settings1.ho_ho_hints, "5 item hints");
settings1.location_hints = 5;
TEST(settings1, settings1.ho_ho_hints, "5 location hints");
TEST(settings1, settings1.kreeb_bow_hints, "kreeb bow hints");
TEST(settings1, settings1.use_always_hints, "use always hints");
TEST(settings1, settings1.clearer_hints, "clearer hints");
TEST(settings1, settings1.hint_importance, "hint importance");
Expand Down Expand Up @@ -223,6 +224,7 @@ void runLogicTests(Config& newConfig)
TEST(settings2, settings2.hint_importance, "hint importance");
TEST(settings2, settings2.clearer_hints, "clearer hints");
TEST(settings2, settings2.use_always_hints, "use always hints");
TEST(settings2, settings2.kreeb_bow_hints, "kreeb bow hints");
settings2.path_hints = 5;
TEST(settings2, settings2.korl_hints, "5 path hints");
settings2.barren_hints = 5;
Expand Down
12 changes: 11 additions & 1 deletion logic/SpoilerLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void generateSpoilerLog(WorldPool& worlds)
for (auto& world : worlds)
{
// Don't print "Hints" if there are none
if (world.hohoHints.empty() && world.korlHints.empty() && world.bigOctoFairyHintLocation == nullptr)
if (world.hohoHints.empty() && world.korlHints.empty() && world.bigOctoFairyHintLocation == nullptr && world.kreebHints.empty())
{
continue;
}
Expand Down Expand Up @@ -291,6 +291,16 @@ void generateSpoilerLog(WorldPool& worlds)
}
spoilerLog << " " << Utility::Str::toUTF8(hintText) << std::endl;
}

if (!world.kreebHints.empty())
{
spoilerLog << " Kreeb Hints:" << std::endl;
for (auto location : world.kreebHints)
{
spoilerLog << " " << getSpoilerFormatHint(location);
spoilerLog << std::endl;
}
}
}
spoilerLog << std::endl;

Expand Down
1 change: 1 addition & 0 deletions logic/World.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class World
std::list<Location*> goalLocations = {};
std::map<std::string, std::unordered_set<Location*>> barrenRegions = {};
std::list<Location*> korlHints = {};
std::list<Location*> kreebHints = {};
std::map<Location*, std::unordered_set<Location*>, PointerLess<Location>> hohoHints = {}; // map of Ho Ho Hint Location to hinted locations
Location* bigOctoFairyHintLocation = nullptr;
std::list<std::list<Location*>> playthroughSpheres = {};
Expand Down
7 changes: 7 additions & 0 deletions options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void Settings::resetDefaultSettings() {
decouple_entrances = false;

korl_hints = false;
kreeb_bow_hints = false;
ho_ho_hints = false;
ho_ho_triforce_hints = false;
path_hints = false;
Expand Down Expand Up @@ -237,6 +238,8 @@ uint8_t Settings::getSetting(const Option& option) const {
return ho_ho_triforce_hints;
case Option::KorlHints:
return korl_hints;
case Option::KreebBowHints:
return kreeb_bow_hints;
case Option::ClearerHints:
return clearer_hints;
case Option::UseAlwaysHints:
Expand Down Expand Up @@ -426,6 +429,8 @@ void Settings::setSetting(const Option& option, const size_t& value) {
ho_ho_triforce_hints = value; return;
case Option::KorlHints:
korl_hints = value; return;
case Option::KreebBowHints:
kreeb_bow_hints = value; return;
case Option::ClearerHints:
clearer_hints = value; return;
case Option::UseAlwaysHints:
Expand Down Expand Up @@ -914,6 +919,7 @@ Option nameToSetting(const std::string& name) {
{"Ho Ho Hints", Option::HoHoHints},
{"Ho Ho Triforce Hints", Option::HoHoTriforceHints},
{"Korl Hints", Option::KorlHints},
{"Kreeb Bow Hints", Option::KreebBowHints},
{"Clearer Hints", Option::ClearerHints},
{"Use Always Hints", Option::UseAlwaysHints},
{"Hint Importance", Option::HintImportance},
Expand Down Expand Up @@ -1016,6 +1022,7 @@ std::string settingToName(const Option& setting) {
{Option::HoHoHints, "Ho Ho Hints"},
{Option::HoHoTriforceHints, "Ho Ho Triforce Hints"},
{Option::KorlHints, "Korl Hints"},
{Option::KreebBowHints, "Kreeb Bow Hints"},
{Option::ClearerHints, "Clearer Hints"},
{Option::UseAlwaysHints, "Use Always Hints"},
{Option::HintImportance, "Hint Importance"},
Expand Down
2 changes: 2 additions & 0 deletions options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ enum struct Option {
HoHoHints,
HoHoTriforceHints,
KorlHints,
KreebBowHints,
ClearerHints,
UseAlwaysHints,
HintImportance,
Expand Down Expand Up @@ -269,6 +270,7 @@ class Settings {
bool ho_ho_hints;
bool ho_ho_triforce_hints;
bool korl_hints;
bool kreeb_bow_hints;
bool clearer_hints;
bool use_always_hints;
bool hint_importance;
Expand Down
4 changes: 4 additions & 0 deletions seedgen/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ ConfigError Config::loadFromFile(const fspath& filePath, const fspath& preferenc
GET_FIELD(root, "ho_ho_hints", settings.ho_ho_hints)
GET_FIELD(root, "ho_ho_triforce_hints", settings.ho_ho_triforce_hints)
GET_FIELD(root, "korl_hints", settings.korl_hints)
GET_FIELD(root, "kreeb_bow_hints", settings.kreeb_bow_hints)
GET_FIELD(root, "clearer_hints", settings.clearer_hints)
GET_FIELD(root, "use_always_hints", settings.use_always_hints)
GET_FIELD(root, "hint_importance", settings.hint_importance)
Expand Down Expand Up @@ -527,6 +528,7 @@ YAML::Node Config::settingsToYaml() const {
SET_FIELD(root, "ho_ho_hints", settings.ho_ho_hints)
SET_FIELD(root, "ho_ho_triforce_hints", settings.ho_ho_triforce_hints)
SET_FIELD(root, "korl_hints", settings.korl_hints)
SET_FIELD(root, "kreeb_bow_hints", settings.kreeb_bow_hints)
SET_FIELD(root, "clearer_hints", settings.clearer_hints)
SET_FIELD(root, "use_always_hints", settings.use_always_hints)
SET_FIELD(root, "hint_importance", settings.hint_importance)
Expand Down Expand Up @@ -808,6 +810,7 @@ static const std::vector<Option> PERMALINK_OPTIONS {
Option::HoHoHints,
Option::HoHoTriforceHints,
Option::KorlHints,
Option::KreebBowHints,
Option::PathHints,
Option::BarrenHints,
Option::ItemHints,
Expand Down Expand Up @@ -902,6 +905,7 @@ static size_t getOptionBitCount(const Option& option) {
case Option::HoHoHints:
case Option::HoHoTriforceHints:
case Option::KorlHints:
case Option::KreebBowHints:
case Option::UseAlwaysHints:
case Option::ClearerHints:
case Option::HintImportance:
Expand Down
33 changes: 33 additions & 0 deletions tweaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,38 @@ TweakError update_ho_ho_dialog(World& world) {
return TweakError::NONE;
}

TweakError update_kreeb_dialog(World& world) {
// Don't change text if theres no kreeb hints
if (world.kreebHints.empty()) {
return TweakError::NONE;
}

for (const auto& language : Text::supported_languages) {
RandoSession::CacheEntry& entry = g_session.openGameFile("content/Common/Pack/permanent_2d_Us" + language + ".pack@SARC@message4_msbt.szs@YAZ0@SARC@message4.msbt@MSBT");

entry.addAction([=, &world](RandoSession* session, FileType* data) -> int {
std::u16string hintLines = u"";
size_t i = 0; // counter to know when to add null terminator
for (auto location : world.kreebHints) {
std::u16string hint = u"";
hint += location->hint.text[language];
hint = Text::word_wrap_string(hint, 43);
++i;
if (i == world.kreebHints.size()) {
hint += u'\0'; // add null terminator on last hint before padding
}
hint = Text::pad_str_4_lines(hint);
hintLines += hint;
}
CAST_ENTRY_TO_FILETYPE(msbt, FileTypes::MSBTFile, data)

msbt.messages_by_label["12220"].text.message = hintLines;
return true;
});
}
return TweakError::NONE;
}

TweakError rotate_ho_ho_to_face_hints(World& world) {

// If no ho ho hints, don't do anything
Expand Down Expand Up @@ -4144,6 +4176,7 @@ TweakError apply_necessary_post_randomization_tweaks(World& world/* , const bool
// Update text last so everything has a chance to add textboxes
TWEAK_ERR_CHECK(update_text_replacements(world));
TWEAK_ERR_CHECK(update_korl_dialog(world));
TWEAK_ERR_CHECK(update_kreeb_dialog(world));
TWEAK_ERR_CHECK(update_ho_ho_dialog(world));
TWEAK_ERR_CHECK(rotate_ho_ho_to_face_hints(world));
TWEAK_ERR_CHECK(add_chart_number_to_item_get_messages(world));
Expand Down