LUS Cleanup: Strips out the logging system created for the console

Properly routes SPDLog to the console.
Creates an API to be able to send command responses back to the console.
Cleans up the console UI, hiding options when not needed.
Removes stdout console sink for Windows.
This commit is contained in:
Kenix3 2022-08-09 21:47:39 -04:00
commit c7ccd6dbff
14 changed files with 309 additions and 282 deletions

View file

@ -34,12 +34,12 @@ extern GlobalContext* gGlobalCtx;
static bool ActorSpawnHandler(const std::vector<std::string>& args) {
if ((args.size() != 9) && (args.size() != 3) && (args.size() != 6)) {
ERROR("Not enough arguments passed to actorspawn");
SPDLOG_ERROR("Not enough arguments passed to actorspawn");
return CMD_FAILED;
}
if (gGlobalCtx == nullptr) {
ERROR("GlobalCtx == nullptr");
SPDLOG_ERROR("GlobalCtx == nullptr");
return CMD_FAILED;
}
@ -75,7 +75,7 @@ static bool ActorSpawnHandler(const std::vector<std::string>& args) {
if (Actor_Spawn(&gGlobalCtx->actorCtx, gGlobalCtx, actorId, spawnPoint.pos.x, spawnPoint.pos.y, spawnPoint.pos.z,
spawnPoint.rot.x, spawnPoint.rot.y, spawnPoint.rot.z, params) == NULL) {
ERROR("Failed to spawn actor. Actor_Spawn returned NULL");
SPDLOG_ERROR("Failed to spawn actor. Actor_Spawn returned NULL");
return CMD_FAILED;
}
return CMD_SUCCESS;
@ -85,13 +85,13 @@ static bool ActorSpawnHandler(const std::vector<std::string>& args) {
static bool KillPlayerHandler([[maybe_unused]] const std::vector<std::string>&) {
gSaveContext.health = 0;
INFO("[SOH] You've met with a terrible fate, haven't you?");
SPDLOG_INFO("[SOH] You've met with a terrible fate, haven't you?");
return CMD_SUCCESS;
}
static bool SetPlayerHealthHandler(const std::vector<std::string>& args) {
if (args.size() != 2) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
@ -100,18 +100,18 @@ static bool SetPlayerHealthHandler(const std::vector<std::string>& args) {
try {
health = std::stoi(args[1]);
} catch (std::invalid_argument const& ex) {
ERROR("[SOH] Health value must be an integer.");
SPDLOG_ERROR("[SOH] Health value must be an integer.");
return CMD_FAILED;
}
if (health < 0) {
ERROR("[SOH] Health value must be a positive integer");
SPDLOG_ERROR("[SOH] Health value must be a positive integer");
return CMD_SUCCESS;
}
gSaveContext.health = health * 0x10;
INFO("[SOH] Player health updated to %d", health);
SPDLOG_INFO("[SOH] Player health updated to %d", health);
return CMD_SUCCESS;
}
@ -133,31 +133,31 @@ static bool RuppeHandler(const std::vector<std::string>& args) {
rupeeAmount = std::stoi(args[1]);
}
catch (std::invalid_argument const& ex) {
ERROR("[SOH] Rupee count must be an integer.");
SPDLOG_ERROR("[SOH] Rupee count must be an integer.");
return CMD_FAILED;
}
if (rupeeAmount < 0) {
ERROR("[SOH] Rupee count must be positive");
SPDLOG_ERROR("[SOH] Rupee count must be positive");
return CMD_FAILED;
}
gSaveContext.rupees = rupeeAmount;
INFO("Set rupee count to %u", rupeeAmount);
SPDLOG_INFO("Set rupee count to {}", rupeeAmount);
return CMD_SUCCESS;
}
static bool SetPosHandler(const std::vector<std::string> args) {
if (gGlobalCtx == nullptr) {
ERROR("GlobalCtx == nullptr");
SPDLOG_ERROR("GlobalCtx == nullptr");
return CMD_FAILED;
}
Player* player = GET_PLAYER(gGlobalCtx);
if (args.size() == 1) {
INFO("Player position is [ %.2f, %.2f, %.2f ]", player->actor.world.pos.x, player->actor.world.pos.y,
SPDLOG_INFO("Player position is [ {:.2f}, {:.2f}, {:.2f} ]", player->actor.world.pos.x, player->actor.world.pos.y,
player->actor.world.pos.z);
return CMD_SUCCESS;
}
@ -168,14 +168,14 @@ static bool SetPosHandler(const std::vector<std::string> args) {
player->actor.world.pos.y = std::stof(args[2]);
player->actor.world.pos.z = std::stof(args[3]);
INFO("Set player position to [ %.2f, %.2f, %.2f ]", player->actor.world.pos.x, player->actor.world.pos.y,
SPDLOG_INFO("Set player position to [ {:.2f}, {:.2f}, {:.2f} ]", player->actor.world.pos.x, player->actor.world.pos.y,
player->actor.world.pos.z);
return CMD_SUCCESS;
}
static bool ResetHandler(std::vector<std::string> args) {
if (gGlobalCtx == nullptr) {
ERROR("GlobalCtx == nullptr");
SPDLOG_ERROR("GlobalCtx == nullptr");
return CMD_FAILED;
}
@ -196,7 +196,7 @@ const static std::map<std::string, uint16_t> ammoItems{
static bool AmmoHandler(const std::vector<std::string>& args) {
if (args.size() != 3) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
@ -205,19 +205,19 @@ static bool AmmoHandler(const std::vector<std::string>& args) {
try {
count = std::stoi(args[2]);
} catch (std::invalid_argument const& ex) {
ERROR("Ammo count must be an integer");
SPDLOG_ERROR("Ammo count must be an integer");
return CMD_FAILED;
}
if (count < 0) {
ERROR("Ammo count must be positive");
SPDLOG_ERROR("Ammo count must be positive");
return CMD_FAILED;
}
const auto& it = ammoItems.find(args[1]);
if (it == ammoItems.end()) {
ERROR("Invalid item passed");
SPDLOG_ERROR("Invalid item passed");
return CMD_FAILED;
}
@ -239,7 +239,7 @@ const static std::map<std::string, uint16_t> bottleItems{
static bool BottleHandler(const std::vector<std::string>& args) {
if (args.size() != 3) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
@ -247,19 +247,19 @@ static bool BottleHandler(const std::vector<std::string>& args) {
try {
slot = std::stoi(args[2]);
} catch (std::invalid_argument const& ex) {
ERROR("[SOH] Bottle slot must be an integer.");
SPDLOG_ERROR("[SOH] Bottle slot must be an integer.");
return CMD_FAILED;
}
if ((slot < 1) || (slot > 4)) {
ERROR("Invalid slot passed");
SPDLOG_ERROR("Invalid slot passed");
return CMD_FAILED;
}
const auto& it = bottleItems.find(args[1]);
if (it == bottleItems.end()) {
ERROR("Invalid item passed");
SPDLOG_ERROR("Invalid item passed");
return CMD_FAILED;
}
@ -271,7 +271,7 @@ static bool BottleHandler(const std::vector<std::string>& args) {
static bool BHandler(const std::vector<std::string>& args) {
if (args.size() != 2) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
@ -281,7 +281,7 @@ static bool BHandler(const std::vector<std::string>& args) {
static bool ItemHandler(const std::vector<std::string>& args) {
if (args.size() != 3) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
@ -292,7 +292,7 @@ static bool ItemHandler(const std::vector<std::string>& args) {
static bool EntranceHandler(const std::vector<std::string>& args) {
if (args.size() != 2) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
@ -301,7 +301,7 @@ static bool EntranceHandler(const std::vector<std::string>& args) {
try {
entrance = std::stoi(args[1], nullptr, 16);
} catch (std::invalid_argument const& ex) {
ERROR("[SOH] Entrance value must be a Hex number.");
SPDLOG_ERROR("[SOH] Entrance value must be a Hex number.");
return CMD_FAILED;
}
gGlobalCtx->nextEntranceIndex = entrance;
@ -317,10 +317,10 @@ static bool SaveStateHandler(const std::vector<std::string>& args) {
switch (rtn) {
case SaveStateReturn::SUCCESS:
INFO("[SOH] Saved state to slot %u", slot);
SPDLOG_INFO("[SOH] Saved state to slot {}", slot);
return CMD_SUCCESS;
case SaveStateReturn::FAIL_WRONG_GAMESTATE:
ERROR("[SOH] Can not save a state outside of \"GamePlay\"");
SPDLOG_ERROR("[SOH] Can not save a state outside of \"GamePlay\"");
return CMD_FAILED;
}
@ -332,16 +332,16 @@ static bool LoadStateHandler(const std::vector<std::string>& args) {
switch (rtn) {
case SaveStateReturn::SUCCESS:
INFO("[SOH] Loaded state from slot %u", slot);
SPDLOG_INFO("[SOH] Loaded state from slot ({})", slot);
return CMD_SUCCESS;
case SaveStateReturn::FAIL_INVALID_SLOT:
ERROR("[SOH] Invalid State Slot Number (%u)", slot);
SPDLOG_ERROR("[SOH] Invalid State Slot Number ({})", slot);
return CMD_FAILED;
case SaveStateReturn::FAIL_STATE_EMPTY:
ERROR("[SOH] State Slot (%u) is empty", slot);
SPDLOG_ERROR("[SOH] State Slot ({}) is empty", slot);
return CMD_FAILED;
case SaveStateReturn::FAIL_WRONG_GAMESTATE:
ERROR("[SOH] Can not load a state outside of \"GamePlay\"");
SPDLOG_ERROR("[SOH] Can not load a state outside of \"GamePlay\"");
return CMD_FAILED;
}
@ -349,7 +349,7 @@ static bool LoadStateHandler(const std::vector<std::string>& args) {
static bool StateSlotSelectHandler(const std::vector<std::string>& args) {
if (args.size() != 2) {
ERROR("[SOH] Unexpected arguments passed");
SPDLOG_ERROR("[SOH] Unexpected arguments passed");
return CMD_FAILED;
}
int slot;
@ -357,17 +357,17 @@ static bool StateSlotSelectHandler(const std::vector<std::string>& args) {
try {
slot = std::stoi(args[1], nullptr, 10);
} catch (std::invalid_argument const& ex) {
ERROR("[SOH] SaveState slot value must be a number.");
SPDLOG_ERROR("[SOH] SaveState slot value must be a number.");
return CMD_FAILED;
}
if (slot < 0) {
ERROR("[SOH] Invalid slot passed. Slot must be between 0 and 2");
SPDLOG_ERROR("[SOH] Invalid slot passed. Slot must be between 0 and 2");
return CMD_FAILED;
}
OTRGlobals::Instance->gSaveStateMgr->SetCurrentSlot(slot);
INFO("[SOH] Slot %u selected", OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot());
SPDLOG_INFO("[SOH] Slot {} selected", OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot());
return CMD_SUCCESS;
}
@ -441,17 +441,18 @@ static bool GetCVarHandler(const std::vector<std::string>& args) {
if (cvar != nullptr)
{
if (cvar->type == CVarType::S32)
INFO("[SOH] Variable %s is %i", args[1].c_str(), cvar->value.valueS32);
SPDLOG_INFO("[SOH] Variable {} is {}", args[1], cvar->value.valueS32);
else if (cvar->type == CVarType::Float)
INFO("[SOH] Variable %s is %f", args[1].c_str(), cvar->value.valueFloat);
SPDLOG_INFO("[SOH] Variable {} is {}", args[1], cvar->value.valueFloat);
else if (cvar->type == CVarType::String)
INFO("[SOH] Variable %s is %s", args[1].c_str(), cvar->value.valueStr);
SPDLOG_INFO("[SOH] Variable {} is {}", args[1], cvar->value.valueStr);
else if (cvar->type == CVarType::RGBA)
INFO("[SOH] Variable %s is %08X", args[1].c_str(), cvar->value.valueRGBA);
SPDLOG_INFO("[SOH] Variable {} is ({}, {}, {}, {})", args[1], cvar->value.valueRGBA.r,
cvar->value.valueRGBA.g, cvar->value.valueRGBA.b, cvar->value.valueRGBA.a);
}
else
{
INFO("[SOH] Could not find variable %s", args[1].c_str());
SPDLOG_INFO("[SOH] Could not find variable %s", args[1]);
}

View file

@ -156,7 +156,7 @@ static bool AreEntrancesCompatible(Entrance* entrance, Entrance* target, std::ve
//Entrances shouldn't connect to their own scene, fail in this situation
if (entrance->GetParentRegion()->scene != "" && entrance->GetParentRegion()->scene == target->GetConnectedRegion()->scene) {
auto message = "Entrance " + entrance->GetName() + " attempted to connect with own scene target " + target->to_string() + ". Connection failed.\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
return false;
}
@ -168,7 +168,7 @@ static bool AreEntrancesCompatible(Entrance* entrance, Entrance* target, std::ve
//Change connections between an entrance and a target assumed entrance, in order to test the connections afterwards if necessary
static void ChangeConnections(Entrance* entrance, Entrance* targetEntrance) {
auto message = "Attempting to connect " + entrance->GetName() + " to " + targetEntrance->to_string() + "\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
entrance->Connect(targetEntrance->Disconnect());
entrance->SetReplacement(targetEntrance->GetReplacement());
if (entrance->GetReverse() != nullptr /*&& entrances aren't decoupled*/) {
@ -208,7 +208,7 @@ static void ConfirmReplacement(Entrance* entrance, Entrance* targetEntrance) {
static bool EntranceUnreachableAs(Entrance* entrance, uint8_t age, std::vector<Entrance*>& alreadyChecked) {
if (entrance == nullptr) {
SPDLOG_INFO("Entrance is nullptr in EntranceUnreachableAs()");
SPDLOG_DEBUG("Entrance is nullptr in EntranceUnreachableAs()");
return true;
}
@ -247,7 +247,7 @@ static bool EntranceUnreachableAs(Entrance* entrance, uint8_t age, std::vector<E
}
static bool ValidateWorld(Entrance* entrancePlaced) {
SPDLOG_INFO("Validating world\n");
SPDLOG_DEBUG("Validating world\n");
//check certain conditions when certain types of ER are enabled
EntranceType type = EntranceType::None;
@ -285,11 +285,11 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
if (ElementInContainer(replacementName, childForbidden) && !EntranceUnreachableAs(entrance, AGE_CHILD, alreadyChecked)) {
auto message = replacementName + " is replaced by an entrance with a potential child access\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
return false;
} else if (ElementInContainer(replacementName, adultForbidden) && !EntranceUnreachableAs(entrance, AGE_ADULT, alreadyChecked)) {
auto message = replacementName + " is replaced by an entrance with a potential adult access\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
return false;
}
}
@ -299,11 +299,11 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
if (ElementInContainer(name, childForbidden) && !EntranceUnreachableAs(entrance, AGE_CHILD, alreadyChecked)) {
auto message = name + " is potentially accessible as child\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
return false;
} else if (ElementInContainer(name, adultForbidden) && !EntranceUnreachableAs(entrance, AGE_ADULT, alreadyChecked)) {
auto message = name + " is potentially accessible as adult\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
return false;
}
}
@ -317,7 +317,7 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
auto impasHouseBackHintRegion = GetHintRegionHintKey(KAK_IMPAS_HOUSE_BACK);
if (impasHouseFrontHintRegion != NONE && impasHouseBackHintRegion != NONE && impasHouseBackHintRegion != LINKS_POCKET && impasHouseFrontHintRegion != LINKS_POCKET && impasHouseBackHintRegion != impasHouseFrontHintRegion) {
auto message = "Kak Impas House entrances are not in the same hint area\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
return false;
}
}
@ -328,23 +328,23 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
if (checkOtherEntranceAccess) {
// At least one valid starting region with all basic refills should be reachable without using any items at the beginning of the seed
if (!AreaTable(KOKIRI_FOREST)->HasAccess() && !AreaTable(KAKARIKO_VILLAGE)->HasAccess()) {
SPDLOG_INFO("Invalid starting area\n");
SPDLOG_DEBUG("Invalid starting area\n");
return false;
}
// Check that a region where time passes is always reachable as both ages without having collected any items
if (!Areas::HasTimePassAccess(AGE_CHILD) || !Areas::HasTimePassAccess(AGE_ADULT)) {
SPDLOG_INFO("Time passing is not guaranteed as both ages\n");
SPDLOG_DEBUG("Time passing is not guaranteed as both ages\n");
return false;
}
// The player should be able to get back to ToT after going through time, without having collected any items
// This is important to ensure that the player never loses access to the pedestal after going through time
if (Settings::ResolvedStartingAge == AGE_CHILD && !AreaTable(TEMPLE_OF_TIME)->Adult()) {
SPDLOG_INFO("Path to Temple of Time as adult is not guaranteed\n");
SPDLOG_DEBUG("Path to Temple of Time as adult is not guaranteed\n");
return false;
} else if (Settings::ResolvedStartingAge == AGE_ADULT && !AreaTable(TEMPLE_OF_TIME)->Child()) {
SPDLOG_INFO("Path to Temple of Time as child is not guaranteed\n");
SPDLOG_DEBUG("Path to Temple of Time as child is not guaranteed\n");
return false;
}
}
@ -353,11 +353,11 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
// This is important to ensure that players can never lock their only bottles by filling them with Big Poes they can't sell
if (checkPoeCollectorAccess) {
if (!AreaTable(MARKET_GUARD_HOUSE)->Adult()) {
SPDLOG_INFO("Big Poe Shop access is not guarenteed as adult\n");
SPDLOG_DEBUG("Big Poe Shop access is not guarenteed as adult\n");
return false;
}
}
SPDLOG_INFO("All Locations NOT REACHABLE\n");
SPDLOG_DEBUG("All Locations NOT REACHABLE\n");
return false;
}
return true;
@ -476,7 +476,7 @@ static void ShuffleEntrancePool(std::vector<Entrance*>& entrancePool, std::vecto
}
if (retries <= 0) {
SPDLOG_INFO("Entrance placement attempt count exceeded. Restarting randomization completely");
SPDLOG_DEBUG("Entrance placement attempt count exceeded. Restarting randomization completely");
entranceShuffleFailure = true;
}
}
@ -840,7 +840,7 @@ void CreateEntranceOverrides() {
if (noRandomEntrances) {
return;
}
SPDLOG_INFO("\nCREATING ENTRANCE OVERRIDES\n");
SPDLOG_DEBUG("\nCREATING ENTRANCE OVERRIDES\n");
auto allShuffleableEntrances = GetShuffleableEntrances(EntranceType::All, false);
for (Entrance* entrance : allShuffleableEntrances) {
@ -851,7 +851,7 @@ void CreateEntranceOverrides() {
}
auto message = "Setting " + entrance->to_string() + "\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
int16_t originalIndex = entrance->GetIndex();
int16_t destinationIndex = entrance->GetReverse()->GetIndex();
@ -868,9 +868,9 @@ void CreateEntranceOverrides() {
});
message = "\tOriginal: " + std::to_string(originalIndex) + "\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
message = "\tReplacement " + std::to_string(replacementIndex) + "\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
}
}

View file

@ -420,7 +420,7 @@ std::vector<uint32_t> GetAccessibleLocations(const std::vector<uint32_t>& allowe
if (!Location(loc)->IsAddedToPool()) {
allLocationsReachable = false;
auto message = "Location " + Location(loc)->GetName() + " not reachable\n";
SPDLOG_INFO(message);
SPDLOG_DEBUG(message);
#ifndef ENABLE_DEBUG
break;
#endif
@ -567,17 +567,17 @@ static void AssumedFill(const std::vector<uint32_t>& items, const std::vector<ui
if (items.size() > allowedLocations.size()) {
printf("\x1b[2;2HERROR: MORE ITEMS THAN LOCATIONS IN GIVEN LISTS");
SPDLOG_INFO("Items:\n");
SPDLOG_DEBUG("Items:\n");
for (const uint32_t item : items) {
SPDLOG_INFO("\t");
SPDLOG_INFO(ItemTable(item).GetName().GetEnglish());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\t");
SPDLOG_DEBUG(ItemTable(item).GetName().GetEnglish());
SPDLOG_DEBUG("\n");
}
SPDLOG_INFO("\nAllowed Locations:\n");
SPDLOG_DEBUG("\nAllowed Locations:\n");
for (const uint32_t loc : allowedLocations) {
SPDLOG_INFO("\t");
SPDLOG_INFO(Location(loc)->GetName());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\t");
SPDLOG_DEBUG(Location(loc)->GetName());
SPDLOG_DEBUG("\n");
}
placementFailure = true;
return;
@ -627,9 +627,9 @@ static void AssumedFill(const std::vector<uint32_t>& items, const std::vector<ui
// retry if there are no more locations to place items
if (accessibleLocations.empty()) {
SPDLOG_INFO("\nCANNOT PLACE ");
SPDLOG_INFO(ItemTable(item).GetName().GetEnglish());
SPDLOG_INFO(". TRYING AGAIN...\n");
SPDLOG_DEBUG("\nCANNOT PLACE ");
SPDLOG_DEBUG(ItemTable(item).GetName().GetEnglish());
SPDLOG_DEBUG(". TRYING AGAIN...\n");
#ifdef ENABLE_DEBUG
Areas::DumpWorldGraph(ItemTable(item).GetName().GetEnglish());
@ -666,7 +666,7 @@ static void AssumedFill(const std::vector<uint32_t>& items, const std::vector<ui
LogicReset();
GetAccessibleLocations(allLocations, SearchMode::CheckBeatable);
if (playthroughBeatable) {
SPDLOG_INFO("Game beatable, now placing items randomly. " + std::to_string(itemsToPlace.size()) +
SPDLOG_DEBUG("Game beatable, now placing items randomly. " + std::to_string(itemsToPlace.size()) +
" major items remaining.\n\n");
FastFill(itemsToPlace, GetEmptyLocations(allowedLocations), true);
return;
@ -1062,7 +1062,7 @@ int Fill() {
}
//Unsuccessful placement
if(retries < 4) {
SPDLOG_INFO("\nGOT STUCK. RETRYING...\n");
SPDLOG_DEBUG("\nGOT STUCK. RETRYING...\n");
Areas::ResetAllLocations();
LogicReset();
ClearProgress();

View file

@ -206,23 +206,23 @@ static void AddHint(Text hint, const uint32_t gossipStone, const std::vector<uin
static void CreateLocationHint(const std::vector<uint32_t>& possibleHintLocations) {
//return if there aren't any hintable locations or gossip stones available
if (possibleHintLocations.empty()) {
SPDLOG_INFO("\tNO LOCATIONS TO HINT\n\n");
SPDLOG_DEBUG("\tNO LOCATIONS TO HINT\n\n");
return;
}
uint32_t hintedLocation = RandomElement(possibleHintLocations);
const std::vector<uint32_t> accessibleGossipStones = GetAccessibleGossipStones(hintedLocation);
SPDLOG_INFO("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tLocation: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tItem: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_DEBUG("\n");
if (accessibleGossipStones.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n");
SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return;
}
@ -235,9 +235,9 @@ static void CreateLocationHint(const std::vector<uint32_t>& possibleHintLocation
Text prefix = Hint(PREFIX).GetText();
Text finalHint = prefix + locationHintText + " #"+itemHintText+"#.";
SPDLOG_INFO("\tMessage: ");
SPDLOG_INFO(finalHint.english);
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\tMessage: ");
SPDLOG_DEBUG(finalHint.english);
SPDLOG_DEBUG("\n\n");
AddHint(finalHint, gossipStone, {QM_GREEN, QM_RED});
}
@ -258,24 +258,24 @@ static void CreateWothHint(uint8_t* remainingDungeonWothHints) {
// If no more locations can be hinted at for woth, then just try to get another hint
if (possibleHintLocations.empty()) {
SPDLOG_INFO("\tNO LOCATIONS TO HINT\n\n");
SPDLOG_DEBUG("\tNO LOCATIONS TO HINT\n\n");
return;
}
uint32_t hintedLocation = RandomElement(possibleHintLocations);
SPDLOG_INFO("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tLocation: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tItem: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_DEBUG("\n");
// get an accessible gossip stone
const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation);
if (gossipStoneLocations.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n");
SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return;
}
Location(hintedLocation)->SetAsHinted();
@ -293,9 +293,9 @@ static void CreateWothHint(uint8_t* remainingDungeonWothHints) {
locationText = GetHintRegion(parentRegion)->GetHint().GetText();
}
Text finalWothHint = Hint(PREFIX).GetText() + "#" + locationText + "#" + Hint(WAY_OF_THE_HERO).GetText();
SPDLOG_INFO("\tMessage: ");
SPDLOG_INFO(finalWothHint.english);
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\tMessage: ");
SPDLOG_DEBUG(finalWothHint.english);
SPDLOG_DEBUG("\n\n");
AddHint(finalWothHint, gossipStone, { QM_LBLUE });
}
@ -312,18 +312,18 @@ static void CreateBarrenHint(uint8_t* remainingDungeonBarrenHints, std::vector<u
uint32_t hintedLocation = RandomElement(barrenLocations, true);
SPDLOG_INFO("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tLocation: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tItem: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_DEBUG("\n");
// get an accessible gossip stone
const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation);
if (gossipStoneLocations.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n");
SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return;
}
Location(hintedLocation)->SetAsHinted();
@ -341,9 +341,9 @@ static void CreateBarrenHint(uint8_t* remainingDungeonBarrenHints, std::vector<u
}
Text finalBarrenHint =
Hint(PREFIX).GetText() + Hint(PLUNDERING).GetText() + "#" + locationText + "#" + Hint(FOOLISH).GetText();
SPDLOG_INFO("\tMessage: ");
SPDLOG_INFO(finalBarrenHint.english);
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\tMessage: ");
SPDLOG_DEBUG(finalBarrenHint.english);
SPDLOG_DEBUG("\n\n");
AddHint(finalBarrenHint, gossipStone, { QM_PINK });
// get rid of all other locations in this same barren region
@ -359,23 +359,23 @@ static void CreateRandomLocationHint(const bool goodItem = false) {
});
//If no more locations can be hinted at, then just try to get another hint
if (possibleHintLocations.empty()) {
SPDLOG_INFO("\tNO LOCATIONS TO HINT\n\n");
SPDLOG_DEBUG("\tNO LOCATIONS TO HINT\n\n");
return;
}
uint32_t hintedLocation = RandomElement(possibleHintLocations);
SPDLOG_INFO("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tLocation: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tItem: ");
SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_DEBUG("\n");
//get an acessible gossip stone
const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation);
if (gossipStoneLocations.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n");
SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return;
}
Location(hintedLocation)->SetAsHinted();
@ -387,16 +387,16 @@ static void CreateRandomLocationHint(const bool goodItem = false) {
uint32_t parentRegion = Location(hintedLocation)->GetParentRegionKey();
Text locationText = AreaTable(parentRegion)->GetHint().GetText();
Text finalHint = Hint(PREFIX).GetText()+"#"+locationText+"# "+Hint(HOARDS).GetText()+" #"+itemText+"#.";
SPDLOG_INFO("\tMessage: ");
SPDLOG_INFO(finalHint.english);
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\tMessage: ");
SPDLOG_DEBUG(finalHint.english);
SPDLOG_DEBUG("\n\n");
AddHint(finalHint, gossipStone, {QM_GREEN, QM_RED});
} else {
Text locationText = GetHintRegion(Location(hintedLocation)->GetParentRegionKey())->GetHint().GetText();
Text finalHint = Hint(PREFIX).GetText()+"#"+itemText+"# "+Hint(CAN_BE_FOUND_AT).GetText()+" #"+locationText+"#.";
SPDLOG_INFO("\tMessage: ");
SPDLOG_INFO(finalHint.english);
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\tMessage: ");
SPDLOG_DEBUG(finalHint.english);
SPDLOG_DEBUG("\n\n");
AddHint(finalHint, gossipStone, {QM_RED, QM_GREEN});
}
}
@ -411,15 +411,15 @@ static void CreateJunkHint() {
LogicReset();
const std::vector<uint32_t> gossipStones = GetAccessibleLocations(gossipStoneLocations);
if (gossipStones.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n");
SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return;
}
uint32_t gossipStone = RandomElement(gossipStones);
Text hint = junkHint.GetText();
SPDLOG_INFO("\tMessage: ");
SPDLOG_INFO(hint.english);
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\tMessage: ");
SPDLOG_DEBUG(hint.english);
SPDLOG_DEBUG("\n\n");
AddHint(hint, gossipStone, {QM_PINK});
}
@ -711,7 +711,7 @@ void CreateAllHints() {
CreateGanonText();
CreateAltarText();
SPDLOG_INFO("\nNOW CREATING HINTS\n");
SPDLOG_DEBUG("\nNOW CREATING HINTS\n");
const HintSetting& hintSetting = hintSettingTable[Settings::HintDistribution.Value<uint8_t>()];
uint8_t remainingDungeonWothHints = hintSetting.dungeonsWothLimit;
@ -768,9 +768,9 @@ void CreateAllHints() {
barrenDungeons.push_back(barrenRegion);
}
}
SPDLOG_INFO("\nBarren Dungeons:\n");
SPDLOG_DEBUG("\nBarren Dungeons:\n");
for (std::string barrenDungeon : barrenDungeons) {
SPDLOG_INFO(barrenDungeon + "\n");
SPDLOG_DEBUG(barrenDungeon + "\n");
}
//Get list of all woth dungeons
@ -783,9 +783,9 @@ void CreateAllHints() {
wothDungeons.push_back(wothRegion);
}
}
SPDLOG_INFO("\nWoth Dungeons:\n");
SPDLOG_DEBUG("\nWoth Dungeons:\n");
for (std::string wothDungeon : wothDungeons) {
SPDLOG_INFO(wothDungeon + "\n");
SPDLOG_DEBUG(wothDungeon + "\n");
}
//Set DungeonInfo array for each dungeon
@ -827,9 +827,9 @@ void CreateAllHints() {
//get a random hint type from the remaining hints
HintType type = RandomElement(remainingHintTypes, true);
SPDLOG_INFO("Attempting to make hint of type: ");
SPDLOG_INFO(hintTypeNames[static_cast<int>(type)]);
SPDLOG_INFO("\n");
SPDLOG_DEBUG("Attempting to make hint of type: ");
SPDLOG_DEBUG(hintTypeNames[static_cast<int>(type)]);
SPDLOG_DEBUG("\n");
//create the appropriate hint for the type
if (type == HintType::Woth) {

View file

@ -1460,11 +1460,11 @@ void GenerateLocationPool() {
void PlaceItemInLocation(uint32_t locKey, uint32_t item, bool applyEffectImmediately /*= false*/, bool setHidden /*= false*/) {
auto loc = Location(locKey);
SPDLOG_INFO("\n");
SPDLOG_INFO(ItemTable(item).GetName().GetEnglish());
SPDLOG_INFO(" placed at ");
SPDLOG_INFO(loc->GetName());
SPDLOG_INFO("\n\n");
SPDLOG_DEBUG("\n");
SPDLOG_DEBUG(ItemTable(item).GetName().GetEnglish());
SPDLOG_DEBUG(" placed at ");
SPDLOG_DEBUG(loc->GetName());
SPDLOG_DEBUG("\n\n");
if (applyEffectImmediately || Settings::Logic.Is(LOGIC_NONE) || Settings::Logic.Is(LOGIC_VANILLA)) {
ItemTable(item).ApplyEffect();
@ -1551,7 +1551,7 @@ void AddExcludedOptions() {
}
void CreateItemOverrides() {
SPDLOG_INFO("NOW CREATING OVERRIDES\n\n");
SPDLOG_DEBUG("NOW CREATING OVERRIDES\n\n");
for (uint32_t locKey : allLocations) {
auto loc = Location(locKey);
ItemOverride_Value val = ItemTable(loc->GetPlaceduint32_t()).Value();
@ -1563,18 +1563,18 @@ void CreateItemOverrides() {
.key = loc->Key(),
.value = val,
});
SPDLOG_INFO("\tScene: ");
SPDLOG_INFO(std::to_string(loc->Key().scene));
SPDLOG_INFO("\tType: ");
SPDLOG_INFO(std::to_string(loc->Key().type));
SPDLOG_INFO("\tFlag: ");
SPDLOG_INFO(std::to_string(loc->Key().flag));
SPDLOG_INFO("\t");
SPDLOG_INFO(loc->GetName());
SPDLOG_INFO(": ");
SPDLOG_INFO(loc->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n");
SPDLOG_DEBUG("\tScene: ");
SPDLOG_DEBUG(std::to_string(loc->Key().scene));
SPDLOG_DEBUG("\tType: ");
SPDLOG_DEBUG(std::to_string(loc->Key().type));
SPDLOG_DEBUG("\tFlag: ");
SPDLOG_DEBUG(std::to_string(loc->Key().flag));
SPDLOG_DEBUG("\t");
SPDLOG_DEBUG(loc->GetName());
SPDLOG_DEBUG(": ");
SPDLOG_DEBUG(loc->GetPlacedItemName().GetEnglish());
SPDLOG_DEBUG("\n");
}
SPDLOG_INFO("Overrides Created: ");
SPDLOG_INFO(std::to_string(overrides.size()));
SPDLOG_DEBUG("Overrides Created: ");
SPDLOG_DEBUG(std::to_string(overrides.size()));
}

View file

@ -1174,6 +1174,6 @@ void GenerateItemPool() {
}
void AddJunk() {
SPDLOG_INFO("HAD TO PLACE EXTRA JUNK ");
SPDLOG_DEBUG("HAD TO PLACE EXTRA JUNK ");
AddItemToMainPool(GetPendingJunkItem());
}

View file

@ -26,13 +26,13 @@ Menu* currentMenu;
} // namespace
void PrintTopScreen() {
SPDLOG_INFO("\x1b[2;11H%sOcarina of Time 3D Randomizer%s", CYAN, RESET);
SPDLOG_INFO("\x1b[3;18H%s%s-%s%s", CYAN, RANDOMIZER_VERSION, COMMIT_NUMBER, RESET);
SPDLOG_INFO("\x1b[4;10HA/B/D-pad: Navigate Menu\n");
SPDLOG_INFO(" Select: Exit to Homebrew Menu\n");
SPDLOG_INFO(" Y: New Random Seed\n");
SPDLOG_INFO(" X: Input Custom Seed\n");
SPDLOG_INFO("\x1b[11;7HCurrent Seed: %s", Settings::seed.c_str());
SPDLOG_DEBUG("\x1b[2;11H%sOcarina of Time 3D Randomizer%s", CYAN, RESET);
SPDLOG_DEBUG("\x1b[3;18H%s%s-%s%s", CYAN, RANDOMIZER_VERSION, COMMIT_NUMBER, RESET);
SPDLOG_DEBUG("\x1b[4;10HA/B/D-pad: Navigate Menu\n");
SPDLOG_DEBUG(" Select: Exit to Homebrew Menu\n");
SPDLOG_DEBUG(" Y: New Random Seed\n");
SPDLOG_DEBUG(" X: Input Custom Seed\n");
SPDLOG_DEBUG("\x1b[11;7HCurrent Seed: %s", Settings::seed.c_str());
}
void MenuInit() {
@ -526,7 +526,7 @@ std::string GenerateRandomizer(std::unordered_map<RandomizerSettingKey, uint8_t>
if (ret == -1) { // Failed to generate after 5 tries
printf("\n\nFailed to generate after 5 tries.\nPress B to go back to the menu.\nA different seed might be "
"successful.");
SPDLOG_INFO("\nRANDOMIZATION FAILED COMPLETELY. PLZ FIX\n");
SPDLOG_DEBUG("\nRANDOMIZATION FAILED COMPLETELY. PLZ FIX\n");
return "";
} else {
printf("\n\nError %d with fill.\nPress Select to exit or B to go back to the menu.\n", ret);