Merge pull request #1125 from HarbourMasters/develop-zhora

zhora -> rando-next to fix a crash
This commit is contained in:
briaguya 2022-08-09 22:52:22 -04:00 committed by GitHub
commit 0c4add7e0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 319 additions and 293 deletions

View File

@ -15,9 +15,9 @@ namespace Ship {
std::map<ImGuiKey, std::string> BindingToggle; std::map<ImGuiKey, std::string> BindingToggle;
static bool HelpCommand(const std::vector<std::string>&) { static bool HelpCommand(const std::vector<std::string>&) {
INFO("SoH Commands:"); SohImGui::console->SendInfoMessage("SoH Commands:");
for (const auto& cmd : SohImGui::console->Commands) { for (const auto& cmd : SohImGui::console->Commands) {
INFO("%s", (" - " + cmd.first).c_str()); SohImGui::console->SendInfoMessage(" - " + cmd.first);
} }
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -45,7 +45,7 @@ namespace Ship {
std::ostringstream imploded; std::ostringstream imploded;
std::copy(args.begin() + 2, args.end(), std::ostream_iterator<std::string>(imploded, delim)); std::copy(args.begin() + 2, args.end(), std::ostream_iterator<std::string>(imploded, delim));
Bindings[k] = imploded.str(); Bindings[k] = imploded.str();
INFO("Binding '%s' to %s", args[1].c_str(), Bindings[k].c_str()); SohImGui::console->SendInfoMessage("Binding '%s' to %s", args[1].c_str(), Bindings[k].c_str());
break; break;
} }
} }
@ -61,7 +61,7 @@ namespace Ship {
if (toLowerCase(args[1]) == toLowerCase(key)) { if (toLowerCase(args[1]) == toLowerCase(key)) {
BindingToggle[k] = args[2]; BindingToggle[k] = args[2];
INFO("Binding toggle '%s' to %s", args[1].c_str(), BindingToggle[k].c_str()); SohImGui::console->SendInfoMessage("Binding toggle '%s' to %s", args[1].c_str(), BindingToggle[k].c_str());
break; break;
} }
} }
@ -159,6 +159,8 @@ namespace Ship {
// Renders top bar filters // Renders top bar filters
if (ImGui::Button("Clear")) this->Log[this->selected_channel].clear(); if (ImGui::Button("Clear")) this->Log[this->selected_channel].clear();
if (CVar_GetS32("gSinkEnabled", 0)) {
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(150); ImGui::SetNextItemWidth(150);
if (ImGui::BeginCombo("##channel", this->selected_channel.c_str())) { if (ImGui::BeginCombo("##channel", this->selected_channel.c_str())) {
@ -170,19 +172,27 @@ namespace Ship {
} }
ImGui::EndCombo(); ImGui::EndCombo();
} }
} else {
this->selected_channel = "Console";
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(150); ImGui::SetNextItemWidth(150);
if (ImGui::BeginCombo("##level", this->level_filter.c_str())) {
for (const auto& filter : priority_filters) { if (this->selected_channel != "Console") {
const bool is_selected = (filter == std::string(this->level_filter)); if (ImGui::BeginCombo("##level", spdlog::level::to_string_view(this->level_filter).data())) {
if (ImGui::Selectable(filter.c_str(), is_selected)) for (const auto& priority_filter : priority_filters) {
const bool is_selected = priority_filter == this->level_filter;
if (ImGui::Selectable(spdlog::level::to_string_view(priority_filter).data(), is_selected))
{ {
this->level_filter = filter; this->level_filter = priority_filter;
if (is_selected) ImGui::SetItemDefaultFocus(); if (is_selected) ImGui::SetItemDefaultFocus();
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
} }
} else {
this->level_filter = spdlog::level::trace;
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushItemWidth(-1); ImGui::PushItemWidth(-1);
if (ImGui::InputTextWithHint("##input", "Filter", this->FilterBuffer, MAX_BUFFER_SIZE))this->filter = std::string(this->FilterBuffer); if (ImGui::InputTextWithHint("##input", "Filter", this->FilterBuffer, MAX_BUFFER_SIZE))this->filter = std::string(this->FilterBuffer);
@ -203,7 +213,7 @@ namespace Ship {
for (int i = 0; i < static_cast<int>(channel.size()); i++) { for (int i = 0; i < static_cast<int>(channel.size()); i++) {
ConsoleLine line = channel[i]; ConsoleLine line = channel[i];
if (!this->filter.empty() && line.text.find(this->filter) == std::string::npos) continue; if (!this->filter.empty() && line.text.find(this->filter) == std::string::npos) continue;
if (this->level_filter != NULLSTR && line.priority != (std::find(priority_filters.begin(), priority_filters.end(), this->level_filter) - priority_filters.begin()) - 1) continue; if (this->level_filter > line.priority) continue;
std::string id = line.text + "##" + std::to_string(i); std::string id = line.text + "##" + std::to_string(i);
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableSetColumnIndex(0); ImGui::TableSetColumnIndex(0);
@ -226,6 +236,7 @@ namespace Ship {
ImGui::SetScrollHereY(1.0f); ImGui::SetScrollHereY(1.0f);
ImGui::EndChild(); ImGui::EndChild();
if (this->selected_channel == "Console") {
// Renders input textfield // Renders input textfield
constexpr ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackEdit | constexpr ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackEdit |
ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory; ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory;
@ -259,21 +270,22 @@ namespace Ship {
ImGui::SetItemDefaultFocus(); ImGui::SetItemDefaultFocus();
if (input_focus) ImGui::SetKeyboardFocusHere(-1); if (input_focus) ImGui::SetKeyboardFocusHere(-1);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
}
ImGui::End(); ImGui::End();
} }
void Console::Dispatch(const std::string& line) { void Console::Dispatch(const std::string& line) {
this->CMDHint = NULLSTR; this->CMDHint = NULLSTR;
this->History.push_back(line); this->History.push_back(line);
this->Log[this->selected_channel].push_back({ "> " + line }); SendInfoMessage("> " + line);
const std::vector<std::string> cmd_args = StringHelper::Split(line, " "); const std::vector<std::string> cmd_args = StringHelper::Split(line, " ");
if (this->Commands.contains(cmd_args[0])) { if (this->Commands.contains(cmd_args[0])) {
const CommandEntry entry = this->Commands[cmd_args[0]]; const CommandEntry entry = this->Commands[cmd_args[0]];
if (!entry.handler(cmd_args) && !entry.arguments.empty()) if (!entry.handler(cmd_args) && !entry.arguments.empty())
this->Log[this->selected_channel].push_back({ "[SOH] Usage: " + cmd_args[0] + " " + BuildUsage(entry), ERROR_LVL }); SendErrorMessage("[SOH] Usage: " + cmd_args[0] + " " + BuildUsage(entry));
return; return;
} }
this->Log[this->selected_channel].push_back({ "[SOH] Command not found", ERROR_LVL }); SendErrorMessage("[SOH] Command not found");
} }
int Console::CallbackStub(ImGuiInputTextCallbackData* data) { int Console::CallbackStub(ImGuiInputTextCallbackData* data) {
@ -325,13 +337,39 @@ namespace Ship {
return 0; return 0;
} }
void Console::Append(const std::string& channel, Priority priority, const char* fmt, ...) { void Console::Append(const std::string& channel, spdlog::level::level_enum priority, const char* fmt, va_list args) {
char buf[1024]; char buf[2048];
va_list args;
va_start(args, fmt);
vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args); vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args);
buf[IM_ARRAYSIZE(buf) - 1] = 0; buf[IM_ARRAYSIZE(buf) - 1] = 0;
va_end(args);
this->Log[channel].push_back({ std::string(buf), priority }); this->Log[channel].push_back({ std::string(buf), priority });
} }
void Console::Append(const std::string& channel, spdlog::level::level_enum priority, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
Append(channel, priority, fmt, args);
va_end(args);
}
void Console::SendInfoMessage(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
Append("Console", spdlog::level::info, fmt, args);
va_end(args);
}
void Console::SendErrorMessage(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
Append("Console", spdlog::level::err, fmt, args);
va_end(args);
}
void Console::SendInfoMessage(const std::string& str) {
Append("Console", spdlog::level::info, str.c_str());
}
void Console::SendErrorMessage(const std::string& str) {
Append("Console", spdlog::level::err, str.c_str());
}
} }

View File

@ -6,12 +6,11 @@
#include <functional> #include <functional>
#include "Lib/ImGui/imgui.h" #include "Lib/ImGui/imgui.h"
#define NOGDI
#define WIN32_LEAN_AND_MEAN
#include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
#define LOG(msg, ...) SohImGui::console->Append("Main", Ship::Priority::LOG_LVL, msg, ##__VA_ARGS__)
#define INFO(msg, ...) SohImGui::console->Append("Main", Ship::Priority::INFO_LVL, msg, ##__VA_ARGS__)
#define WARNING(msg, ...) SohImGui::console->Append("Main", Ship::Priority::WARNING_LVL, msg, ##__VA_ARGS__)
#define ERROR(msg, ...) SohImGui::console->Append("Main", Ship::Priority::ERROR_LVL, msg, ##__VA_ARGS__)
#define CMD_SUCCESS true #define CMD_SUCCESS true
#define CMD_FAILED false #define CMD_FAILED false
#define MAX_BUFFER_SIZE 255 #define MAX_BUFFER_SIZE 255
@ -19,13 +18,6 @@ namespace Ship {
typedef std::function<bool(std::vector<std::string> args)> CommandHandler; typedef std::function<bool(std::vector<std::string> args)> CommandHandler;
enum Priority {
INFO_LVL,
LOG_LVL,
WARNING_LVL,
ERROR_LVL
};
enum class ArgumentType { enum class ArgumentType {
TEXT, NUMBER, PLAYER_POS, PLAYER_ROT TEXT, NUMBER, PLAYER_POS, PLAYER_ROT
}; };
@ -44,23 +36,29 @@ namespace Ship {
struct ConsoleLine { struct ConsoleLine {
std::string text; std::string text;
Priority priority = Priority::INFO_LVL; spdlog::level::level_enum priority = spdlog::level::info;
std::string channel = "Main"; std::string channel = "Console";
}; };
class Console { class Console {
int selectedId = -1; int selectedId = -1;
std::vector<int> selectedEntries; std::vector<int> selectedEntries;
std::string filter; std::string filter;
std::string level_filter = NULLSTR; spdlog::level::level_enum level_filter = spdlog::level::trace;
std::vector<std::string> log_channels = { "Main", "SoH Logging" }; std::vector<std::string> log_channels = { "Console", "Logs" };
std::vector<std::string> priority_filters = { "None", "Info", "Log", "Warning", "Error" }; std::vector<spdlog::level::level_enum> priority_filters = { spdlog::level::off, spdlog::level::critical, spdlog::level::err, spdlog::level::warn, spdlog::level::info, spdlog::level::debug, spdlog::level::trace };
std::vector<ImVec4> priority_colors = { std::vector<ImVec4> priority_colors = {
ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ImVec4(0.8f, 0.8f, 0.8f, 1.0f), // TRACE
ImVec4(0.2f, 1.0f, 0.2f, 1.0f), ImVec4(0.9f, 0.9f, 0.9f, 1.0f), // DEBUG
ImVec4(0.9f, 0.8f, 0.4f, 0.01f), ImVec4(1.0f, 1.0f, 1.0f, 1.0f), // INFO
ImVec4(1.0f, 0.2f, 0.2f, 1.0f) ImVec4(1.0f, 0.875f, 0.125f, 1.0f), // WARN
ImVec4(0.65f, 0.18f, 0.25, 1.0f), // ERROR
ImVec4(0.95f, 0.11f, 0.25, 1.0f), // CRITICAL
ImVec4(0.0f, 0.0f, 0.0f, 0.0f) // OFF
}; };
protected:
void Append(const std::string& channel, spdlog::level::level_enum priority, const char* fmt, va_list args);
public: public:
std::map<std::string, std::vector<ConsoleLine>> Log; std::map<std::string, std::vector<ConsoleLine>> Log;
std::map<std::string, CommandEntry> Commands; std::map<std::string, CommandEntry> Commands;
@ -71,13 +69,17 @@ namespace Ship {
char* InputBuffer = nullptr; char* InputBuffer = nullptr;
bool OpenAutocomplete = false; bool OpenAutocomplete = false;
int HistoryIndex = -1; int HistoryIndex = -1;
std::string selected_channel = "Main"; std::string selected_channel = "Console";
bool opened = false; bool opened = false;
void Init(); void Init();
void Update(); void Update();
void Draw(); void Draw();
void Append(const std::string& channel, Priority priority, const char* fmt, ...) IM_FMTARGS(4);
void Dispatch(const std::string& line); void Dispatch(const std::string& line);
static int CallbackStub(ImGuiInputTextCallbackData* data); static int CallbackStub(ImGuiInputTextCallbackData* data);
void SendInfoMessage(const char* fmt, ...);
void SendErrorMessage(const char* fmt, ...);
void SendInfoMessage(const std::string& str);
void SendErrorMessage(const std::string& str);
void Append(const std::string& channel, spdlog::level::level_enum priority, const char* fmt, ...);
}; };
} }

View File

@ -1,4 +1,5 @@
#include "Cutscene.h" #include "Cutscene.h"
#include "spdlog/spdlog.h"
enum class CutsceneCommands enum class CutsceneCommands
{ {
@ -511,9 +512,7 @@ void Ship::CutsceneV0::ParseFileBinary(BinaryReader* reader, Resource* res)
return; return;
} }
default: default:
#ifdef _DEBUG SPDLOG_TRACE("CutsceneV0: Unknown command {}\n", commandId);
printf("CutsceneV0: Unknown command %x\n", commandId);
#endif
// error? // error?
break; break;
} }

View File

@ -4,7 +4,6 @@
#include "File.h" #include "File.h"
#include "Archive.h" #include "Archive.h"
#include "ResourceMgr.h" #include "ResourceMgr.h"
#include "Console.h"
#include "ImGuiImpl.h" #include "ImGuiImpl.h"
#include "Lib/ImGui/imgui_internal.h" #include "Lib/ImGui/imgui_internal.h"
#include "Utils/StringHelper.h" #include "Utils/StringHelper.h"
@ -209,24 +208,25 @@ namespace Ship {
if (args[1] == "add") { if (args[1] == "add") {
if (!overlay->RegisteredOverlays.contains(key)) { if (!overlay->RegisteredOverlays.contains(key)) {
overlay->RegisteredOverlays[key] = new Overlay({ OverlayType::TEXT, ImStrdup(key), -1.0f }); overlay->RegisteredOverlays[key] = new Overlay({ OverlayType::TEXT, ImStrdup(key), -1.0f });
INFO("Added overlay: %s ", key); SPDLOG_INFO("Added overlay: {} ", key);
SohImGui::console->SendInfoMessage("Added overlay: %s", key);
} }
else { else {
ERROR("Overlay already exists: %s", key); SPDLOG_ERROR("Overlay already exists: {}", key);
} }
} }
else if (args[1] == "remove") { else if (args[1] == "remove") {
if (overlay->RegisteredOverlays.contains(key)) { if (overlay->RegisteredOverlays.contains(key)) {
overlay->RegisteredOverlays.erase(key); overlay->RegisteredOverlays.erase(key);
INFO("Removed overlay: %s ", key); SPDLOG_INFO("Removed overlay: {} ", key);
} }
else { else {
ERROR("Overlay not found: %s ", key); SPDLOG_ERROR("Overlay not found: {}", key);
} }
} }
} }
else { else {
ERROR("CVar %s does not exist", args[2].c_str()); SPDLOG_ERROR("CVar {} does not exist", args[2].c_str());
} }
return CMD_SUCCESS; return CMD_SUCCESS;

View File

@ -90,12 +90,20 @@ namespace Ship {
// Setup Logging // Setup Logging
spdlog::init_thread_pool(8192, 1); spdlog::init_thread_pool(8192, 1);
auto SohConsoleSink = std::make_shared<spdlog::sinks::soh_sink_mt>(); auto SohConsoleSink = std::make_shared<spdlog::sinks::soh_sink_mt>();
auto ConsoleSink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
auto FileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(logPath, 1024 * 1024 * 10, 10);
SohConsoleSink->set_level(spdlog::level::trace); SohConsoleSink->set_level(spdlog::level::trace);
#if defined(__linux__)
auto ConsoleSink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
ConsoleSink->set_level(spdlog::level::trace); ConsoleSink->set_level(spdlog::level::trace);
#endif
auto FileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(logPath, 1024 * 1024 * 10, 10);
FileSink->set_level(spdlog::level::trace); FileSink->set_level(spdlog::level::trace);
std::vector<spdlog::sink_ptr> Sinks{ ConsoleSink, FileSink, SohConsoleSink }; std::vector<spdlog::sink_ptr> Sinks{
#if defined(__linux__)
ConsoleSink,
#endif
FileSink,
SohConsoleSink
};
Logger = std::make_shared<spdlog::async_logger>(GetName(), Sinks.begin(), Sinks.end(), spdlog::thread_pool(), spdlog::async_overflow_policy::block); Logger = std::make_shared<spdlog::async_logger>(GetName(), Sinks.begin(), Sinks.end(), spdlog::thread_pool(), spdlog::async_overflow_policy::block);
GetLogger()->set_level(spdlog::level::trace); GetLogger()->set_level(spdlog::level::trace);
GetLogger()->set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%@] [%l] %v"); GetLogger()->set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%@] [%l] %v");

View File

@ -1530,7 +1530,7 @@ namespace SohImGui {
if (ImGui::BeginCombo("##perf", SWITCH_CPU_PROFILES[slot])) { if (ImGui::BeginCombo("##perf", SWITCH_CPU_PROFILES[slot])) {
for (int sId = 0; sId <= SwitchProfiles::POWERSAVINGM3; sId++) { for (int sId = 0; sId <= SwitchProfiles::POWERSAVINGM3; sId++) {
if (ImGui::Selectable(SWITCH_CPU_PROFILES[sId], sId == slot)) { if (ImGui::Selectable(SWITCH_CPU_PROFILES[sId], sId == slot)) {
INFO("Profile:: %s", SWITCH_CPU_PROFILES[sId]); SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[sId]);
CVar_SetS32("gSwitchPerfMode", sId); CVar_SetS32("gSwitchPerfMode", sId);
Switch::ApplyOverclock(); Switch::ApplyOverclock();
needs_save = true; needs_save = true;

View File

@ -31,47 +31,24 @@ public:
{} {}
protected: protected:
void sink_it_(const details::log_msg &msg) override void sink_it_(const details::log_msg &msg) override {
{
const Ship::Priority priority = convert_to_soh(msg.level);
memory_buf_t formatted; memory_buf_t formatted;
if (use_raw_msg_) if (use_raw_msg_) {
{
details::fmt_helper::append_string_view(msg.payload, formatted); details::fmt_helper::append_string_view(msg.payload, formatted);
} }
else else {
{
base_sink<Mutex>::formatter_->format(msg, formatted); base_sink<Mutex>::formatter_->format(msg, formatted);
} }
formatted.push_back('\0'); formatted.push_back('\0');
const char* msg_output = formatted.data(); const char* msg_output = formatted.data();
if (CVar_GetS32("gSinkEnabled", 0) && SohImGui::console->opened) if (CVar_GetS32("gSinkEnabled", 0) && SohImGui::console->opened) {
SohImGui::console->Append("SoH Logging", priority, "%s", msg_output); SohImGui::console->Append("Logs", msg.level, "%s", msg_output);
}
} }
void flush_() override {} void flush_() override {}
private: private:
static Ship::Priority convert_to_soh(spdlog::level::level_enum level)
{
switch (level) {
case spdlog::level::trace:
return Ship::Priority::INFO_LVL;
case spdlog::level::debug:
return Ship::Priority::LOG_LVL;
case spdlog::level::info:
return Ship::Priority::LOG_LVL;
case spdlog::level::warn:
return Ship::Priority::WARNING_LVL;
case spdlog::level::err:
return Ship::Priority::ERROR_LVL;
case spdlog::level::critical:
return Ship::Priority::ERROR_LVL;
default:
break;
}
return Ship::Priority::LOG_LVL;
}
std::string tag_; std::string tag_;
bool use_raw_msg_; bool use_raw_msg_;

View File

@ -1,6 +1,7 @@
#include "Resource.h" #include "Resource.h"
#include "DisplayList.h" #include "DisplayList.h"
#include "ResourceMgr.h" #include "ResourceMgr.h"
#include "spdlog/spdlog.h"
#include "Utils/BinaryReader.h" #include "Utils/BinaryReader.h"
#include "Lib/tinyxml2/tinyxml2.h" #include "Lib/tinyxml2/tinyxml2.h"
#include "Lib/Fast3D/U64/PR/ultra64/gbi.h" #include "Lib/Fast3D/U64/PR/ultra64/gbi.h"
@ -56,9 +57,7 @@ namespace Ship
patches.clear(); patches.clear();
#if _DEBUG
if (file != nullptr) if (file != nullptr)
printf("Deconstructor called on file %s\n", file->path.c_str()); SPDLOG_TRACE("Deconstructor called on file %s\n", file->path.c_str());
#endif
} }
} }

View File

@ -118,6 +118,7 @@ bool CustomMessageManager::ClearMessageTable(std::string tableID) {
} }
auto& messageTable = foundMessageTable->second; auto& messageTable = foundMessageTable->second;
messageTable.clear(); messageTable.clear();
return true;
} }
bool CustomMessageManager::AddCustomMessageTable(std::string tableID) { bool CustomMessageManager::AddCustomMessageTable(std::string tableID) {

View File

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

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 //Entrances shouldn't connect to their own scene, fail in this situation
if (entrance->GetParentRegion()->scene != "" && entrance->GetParentRegion()->scene == target->GetConnectedRegion()->scene) { 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"; 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; 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 //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) { static void ChangeConnections(Entrance* entrance, Entrance* targetEntrance) {
auto message = "Attempting to connect " + entrance->GetName() + " to " + targetEntrance->to_string() + "\n"; auto message = "Attempting to connect " + entrance->GetName() + " to " + targetEntrance->to_string() + "\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
entrance->Connect(targetEntrance->Disconnect()); entrance->Connect(targetEntrance->Disconnect());
entrance->SetReplacement(targetEntrance->GetReplacement()); entrance->SetReplacement(targetEntrance->GetReplacement());
if (entrance->GetReverse() != nullptr /*&& entrances aren't decoupled*/) { 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) { static bool EntranceUnreachableAs(Entrance* entrance, uint8_t age, std::vector<Entrance*>& alreadyChecked) {
if (entrance == nullptr) { if (entrance == nullptr) {
SPDLOG_INFO("Entrance is nullptr in EntranceUnreachableAs()"); SPDLOG_DEBUG("Entrance is nullptr in EntranceUnreachableAs()");
return true; return true;
} }
@ -247,7 +247,7 @@ static bool EntranceUnreachableAs(Entrance* entrance, uint8_t age, std::vector<E
} }
static bool ValidateWorld(Entrance* entrancePlaced) { 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 //check certain conditions when certain types of ER are enabled
EntranceType type = EntranceType::None; EntranceType type = EntranceType::None;
@ -285,11 +285,11 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
if (ElementInContainer(replacementName, childForbidden) && !EntranceUnreachableAs(entrance, AGE_CHILD, alreadyChecked)) { if (ElementInContainer(replacementName, childForbidden) && !EntranceUnreachableAs(entrance, AGE_CHILD, alreadyChecked)) {
auto message = replacementName + " is replaced by an entrance with a potential child access\n"; auto message = replacementName + " is replaced by an entrance with a potential child access\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
return false; return false;
} else if (ElementInContainer(replacementName, adultForbidden) && !EntranceUnreachableAs(entrance, AGE_ADULT, alreadyChecked)) { } else if (ElementInContainer(replacementName, adultForbidden) && !EntranceUnreachableAs(entrance, AGE_ADULT, alreadyChecked)) {
auto message = replacementName + " is replaced by an entrance with a potential adult access\n"; auto message = replacementName + " is replaced by an entrance with a potential adult access\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
return false; return false;
} }
} }
@ -299,11 +299,11 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
if (ElementInContainer(name, childForbidden) && !EntranceUnreachableAs(entrance, AGE_CHILD, alreadyChecked)) { if (ElementInContainer(name, childForbidden) && !EntranceUnreachableAs(entrance, AGE_CHILD, alreadyChecked)) {
auto message = name + " is potentially accessible as child\n"; auto message = name + " is potentially accessible as child\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
return false; return false;
} else if (ElementInContainer(name, adultForbidden) && !EntranceUnreachableAs(entrance, AGE_ADULT, alreadyChecked)) { } else if (ElementInContainer(name, adultForbidden) && !EntranceUnreachableAs(entrance, AGE_ADULT, alreadyChecked)) {
auto message = name + " is potentially accessible as adult\n"; auto message = name + " is potentially accessible as adult\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
return false; return false;
} }
} }
@ -317,7 +317,7 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
auto impasHouseBackHintRegion = GetHintRegionHintKey(KAK_IMPAS_HOUSE_BACK); auto impasHouseBackHintRegion = GetHintRegionHintKey(KAK_IMPAS_HOUSE_BACK);
if (impasHouseFrontHintRegion != NONE && impasHouseBackHintRegion != NONE && impasHouseBackHintRegion != LINKS_POCKET && impasHouseFrontHintRegion != LINKS_POCKET && impasHouseBackHintRegion != impasHouseFrontHintRegion) { 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"; auto message = "Kak Impas House entrances are not in the same hint area\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
return false; return false;
} }
} }
@ -328,23 +328,23 @@ static bool ValidateWorld(Entrance* entrancePlaced) {
if (checkOtherEntranceAccess) { 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 // 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()) { if (!AreaTable(KOKIRI_FOREST)->HasAccess() && !AreaTable(KAKARIKO_VILLAGE)->HasAccess()) {
SPDLOG_INFO("Invalid starting area\n"); SPDLOG_DEBUG("Invalid starting area\n");
return false; return false;
} }
// Check that a region where time passes is always reachable as both ages without having collected any items // 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)) { 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; return false;
} }
// The player should be able to get back to ToT after going through time, without having collected any items // 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 // 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()) { 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; return false;
} else if (Settings::ResolvedStartingAge == AGE_ADULT && !AreaTable(TEMPLE_OF_TIME)->Child()) { } 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; 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 // 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 (checkPoeCollectorAccess) {
if (!AreaTable(MARKET_GUARD_HOUSE)->Adult()) { 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; return false;
} }
} }
SPDLOG_INFO("All Locations NOT REACHABLE\n"); SPDLOG_DEBUG("All Locations NOT REACHABLE\n");
return false; return false;
} }
return true; return true;
@ -476,7 +476,7 @@ static void ShuffleEntrancePool(std::vector<Entrance*>& entrancePool, std::vecto
} }
if (retries <= 0) { 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; entranceShuffleFailure = true;
} }
} }
@ -840,7 +840,7 @@ void CreateEntranceOverrides() {
if (noRandomEntrances) { if (noRandomEntrances) {
return; return;
} }
SPDLOG_INFO("\nCREATING ENTRANCE OVERRIDES\n"); SPDLOG_DEBUG("\nCREATING ENTRANCE OVERRIDES\n");
auto allShuffleableEntrances = GetShuffleableEntrances(EntranceType::All, false); auto allShuffleableEntrances = GetShuffleableEntrances(EntranceType::All, false);
for (Entrance* entrance : allShuffleableEntrances) { for (Entrance* entrance : allShuffleableEntrances) {
@ -851,7 +851,7 @@ void CreateEntranceOverrides() {
} }
auto message = "Setting " + entrance->to_string() + "\n"; auto message = "Setting " + entrance->to_string() + "\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
int16_t originalIndex = entrance->GetIndex(); int16_t originalIndex = entrance->GetIndex();
int16_t destinationIndex = entrance->GetReverse()->GetIndex(); int16_t destinationIndex = entrance->GetReverse()->GetIndex();
@ -868,9 +868,9 @@ void CreateEntranceOverrides() {
}); });
message = "\tOriginal: " + std::to_string(originalIndex) + "\n"; message = "\tOriginal: " + std::to_string(originalIndex) + "\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
message = "\tReplacement " + std::to_string(replacementIndex) + "\n"; 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()) { if (!Location(loc)->IsAddedToPool()) {
allLocationsReachable = false; allLocationsReachable = false;
auto message = "Location " + Location(loc)->GetName() + " not reachable\n"; auto message = "Location " + Location(loc)->GetName() + " not reachable\n";
SPDLOG_INFO(message); SPDLOG_DEBUG(message);
#ifndef ENABLE_DEBUG #ifndef ENABLE_DEBUG
break; break;
#endif #endif
@ -567,17 +567,17 @@ static void AssumedFill(const std::vector<uint32_t>& items, const std::vector<ui
if (items.size() > allowedLocations.size()) { if (items.size() > allowedLocations.size()) {
printf("\x1b[2;2HERROR: MORE ITEMS THAN LOCATIONS IN GIVEN LISTS"); 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) { for (const uint32_t item : items) {
SPDLOG_INFO("\t"); SPDLOG_DEBUG("\t");
SPDLOG_INFO(ItemTable(item).GetName().GetEnglish()); SPDLOG_DEBUG(ItemTable(item).GetName().GetEnglish());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
} }
SPDLOG_INFO("\nAllowed Locations:\n"); SPDLOG_DEBUG("\nAllowed Locations:\n");
for (const uint32_t loc : allowedLocations) { for (const uint32_t loc : allowedLocations) {
SPDLOG_INFO("\t"); SPDLOG_DEBUG("\t");
SPDLOG_INFO(Location(loc)->GetName()); SPDLOG_DEBUG(Location(loc)->GetName());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
} }
placementFailure = true; placementFailure = true;
return; 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 // retry if there are no more locations to place items
if (accessibleLocations.empty()) { if (accessibleLocations.empty()) {
SPDLOG_INFO("\nCANNOT PLACE "); SPDLOG_DEBUG("\nCANNOT PLACE ");
SPDLOG_INFO(ItemTable(item).GetName().GetEnglish()); SPDLOG_DEBUG(ItemTable(item).GetName().GetEnglish());
SPDLOG_INFO(". TRYING AGAIN...\n"); SPDLOG_DEBUG(". TRYING AGAIN...\n");
#ifdef ENABLE_DEBUG #ifdef ENABLE_DEBUG
Areas::DumpWorldGraph(ItemTable(item).GetName().GetEnglish()); Areas::DumpWorldGraph(ItemTable(item).GetName().GetEnglish());
@ -666,7 +666,7 @@ static void AssumedFill(const std::vector<uint32_t>& items, const std::vector<ui
LogicReset(); LogicReset();
GetAccessibleLocations(allLocations, SearchMode::CheckBeatable); GetAccessibleLocations(allLocations, SearchMode::CheckBeatable);
if (playthroughBeatable) { 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"); " major items remaining.\n\n");
FastFill(itemsToPlace, GetEmptyLocations(allowedLocations), true); FastFill(itemsToPlace, GetEmptyLocations(allowedLocations), true);
return; return;
@ -1062,7 +1062,7 @@ int Fill() {
} }
//Unsuccessful placement //Unsuccessful placement
if(retries < 4) { if(retries < 4) {
SPDLOG_INFO("\nGOT STUCK. RETRYING...\n"); SPDLOG_DEBUG("\nGOT STUCK. RETRYING...\n");
Areas::ResetAllLocations(); Areas::ResetAllLocations();
LogicReset(); LogicReset();
ClearProgress(); 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) { static void CreateLocationHint(const std::vector<uint32_t>& possibleHintLocations) {
//return if there aren't any hintable locations or gossip stones available //return if there aren't any hintable locations or gossip stones available
if (possibleHintLocations.empty()) { if (possibleHintLocations.empty()) {
SPDLOG_INFO("\tNO LOCATIONS TO HINT\n\n"); SPDLOG_DEBUG("\tNO LOCATIONS TO HINT\n\n");
return; return;
} }
uint32_t hintedLocation = RandomElement(possibleHintLocations); uint32_t hintedLocation = RandomElement(possibleHintLocations);
const std::vector<uint32_t> accessibleGossipStones = GetAccessibleGossipStones(hintedLocation); const std::vector<uint32_t> accessibleGossipStones = GetAccessibleGossipStones(hintedLocation);
SPDLOG_INFO("\tLocation: "); SPDLOG_DEBUG("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName()); SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: "); SPDLOG_DEBUG("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish()); SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
if (accessibleGossipStones.empty()) { if (accessibleGossipStones.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n"); SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return; return;
} }
@ -235,9 +235,9 @@ static void CreateLocationHint(const std::vector<uint32_t>& possibleHintLocation
Text prefix = Hint(PREFIX).GetText(); Text prefix = Hint(PREFIX).GetText();
Text finalHint = prefix + locationHintText + " #"+itemHintText+"#."; Text finalHint = prefix + locationHintText + " #"+itemHintText+"#.";
SPDLOG_INFO("\tMessage: "); SPDLOG_DEBUG("\tMessage: ");
SPDLOG_INFO(finalHint.english); SPDLOG_DEBUG(finalHint.english);
SPDLOG_INFO("\n\n"); SPDLOG_DEBUG("\n\n");
AddHint(finalHint, gossipStone, {QM_GREEN, QM_RED}); 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 no more locations can be hinted at for woth, then just try to get another hint
if (possibleHintLocations.empty()) { if (possibleHintLocations.empty()) {
SPDLOG_INFO("\tNO LOCATIONS TO HINT\n\n"); SPDLOG_DEBUG("\tNO LOCATIONS TO HINT\n\n");
return; return;
} }
uint32_t hintedLocation = RandomElement(possibleHintLocations); uint32_t hintedLocation = RandomElement(possibleHintLocations);
SPDLOG_INFO("\tLocation: "); SPDLOG_DEBUG("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName()); SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: "); SPDLOG_DEBUG("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish()); SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
// get an accessible gossip stone // get an accessible gossip stone
const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation); const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation);
if (gossipStoneLocations.empty()) { if (gossipStoneLocations.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n"); SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return; return;
} }
Location(hintedLocation)->SetAsHinted(); Location(hintedLocation)->SetAsHinted();
@ -293,9 +293,9 @@ static void CreateWothHint(uint8_t* remainingDungeonWothHints) {
locationText = GetHintRegion(parentRegion)->GetHint().GetText(); locationText = GetHintRegion(parentRegion)->GetHint().GetText();
} }
Text finalWothHint = Hint(PREFIX).GetText() + "#" + locationText + "#" + Hint(WAY_OF_THE_HERO).GetText(); Text finalWothHint = Hint(PREFIX).GetText() + "#" + locationText + "#" + Hint(WAY_OF_THE_HERO).GetText();
SPDLOG_INFO("\tMessage: "); SPDLOG_DEBUG("\tMessage: ");
SPDLOG_INFO(finalWothHint.english); SPDLOG_DEBUG(finalWothHint.english);
SPDLOG_INFO("\n\n"); SPDLOG_DEBUG("\n\n");
AddHint(finalWothHint, gossipStone, { QM_LBLUE }); AddHint(finalWothHint, gossipStone, { QM_LBLUE });
} }
@ -312,18 +312,18 @@ static void CreateBarrenHint(uint8_t* remainingDungeonBarrenHints, std::vector<u
uint32_t hintedLocation = RandomElement(barrenLocations, true); uint32_t hintedLocation = RandomElement(barrenLocations, true);
SPDLOG_INFO("\tLocation: "); SPDLOG_DEBUG("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName()); SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: "); SPDLOG_DEBUG("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish()); SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
// get an accessible gossip stone // get an accessible gossip stone
const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation); const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation);
if (gossipStoneLocations.empty()) { if (gossipStoneLocations.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n"); SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return; return;
} }
Location(hintedLocation)->SetAsHinted(); Location(hintedLocation)->SetAsHinted();
@ -341,9 +341,9 @@ static void CreateBarrenHint(uint8_t* remainingDungeonBarrenHints, std::vector<u
} }
Text finalBarrenHint = Text finalBarrenHint =
Hint(PREFIX).GetText() + Hint(PLUNDERING).GetText() + "#" + locationText + "#" + Hint(FOOLISH).GetText(); Hint(PREFIX).GetText() + Hint(PLUNDERING).GetText() + "#" + locationText + "#" + Hint(FOOLISH).GetText();
SPDLOG_INFO("\tMessage: "); SPDLOG_DEBUG("\tMessage: ");
SPDLOG_INFO(finalBarrenHint.english); SPDLOG_DEBUG(finalBarrenHint.english);
SPDLOG_INFO("\n\n"); SPDLOG_DEBUG("\n\n");
AddHint(finalBarrenHint, gossipStone, { QM_PINK }); AddHint(finalBarrenHint, gossipStone, { QM_PINK });
// get rid of all other locations in this same barren region // 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 no more locations can be hinted at, then just try to get another hint
if (possibleHintLocations.empty()) { if (possibleHintLocations.empty()) {
SPDLOG_INFO("\tNO LOCATIONS TO HINT\n\n"); SPDLOG_DEBUG("\tNO LOCATIONS TO HINT\n\n");
return; return;
} }
uint32_t hintedLocation = RandomElement(possibleHintLocations); uint32_t hintedLocation = RandomElement(possibleHintLocations);
SPDLOG_INFO("\tLocation: "); SPDLOG_DEBUG("\tLocation: ");
SPDLOG_INFO(Location(hintedLocation)->GetName()); SPDLOG_DEBUG(Location(hintedLocation)->GetName());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
SPDLOG_INFO("\tItem: "); SPDLOG_DEBUG("\tItem: ");
SPDLOG_INFO(Location(hintedLocation)->GetPlacedItemName().GetEnglish()); SPDLOG_DEBUG(Location(hintedLocation)->GetPlacedItemName().GetEnglish());
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
//get an acessible gossip stone //get an acessible gossip stone
const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation); const std::vector<uint32_t> gossipStoneLocations = GetAccessibleGossipStones(hintedLocation);
if (gossipStoneLocations.empty()) { if (gossipStoneLocations.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n"); SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return; return;
} }
Location(hintedLocation)->SetAsHinted(); Location(hintedLocation)->SetAsHinted();
@ -387,16 +387,16 @@ static void CreateRandomLocationHint(const bool goodItem = false) {
uint32_t parentRegion = Location(hintedLocation)->GetParentRegionKey(); uint32_t parentRegion = Location(hintedLocation)->GetParentRegionKey();
Text locationText = AreaTable(parentRegion)->GetHint().GetText(); Text locationText = AreaTable(parentRegion)->GetHint().GetText();
Text finalHint = Hint(PREFIX).GetText()+"#"+locationText+"# "+Hint(HOARDS).GetText()+" #"+itemText+"#."; Text finalHint = Hint(PREFIX).GetText()+"#"+locationText+"# "+Hint(HOARDS).GetText()+" #"+itemText+"#.";
SPDLOG_INFO("\tMessage: "); SPDLOG_DEBUG("\tMessage: ");
SPDLOG_INFO(finalHint.english); SPDLOG_DEBUG(finalHint.english);
SPDLOG_INFO("\n\n"); SPDLOG_DEBUG("\n\n");
AddHint(finalHint, gossipStone, {QM_GREEN, QM_RED}); AddHint(finalHint, gossipStone, {QM_GREEN, QM_RED});
} else { } else {
Text locationText = GetHintRegion(Location(hintedLocation)->GetParentRegionKey())->GetHint().GetText(); Text locationText = GetHintRegion(Location(hintedLocation)->GetParentRegionKey())->GetHint().GetText();
Text finalHint = Hint(PREFIX).GetText()+"#"+itemText+"# "+Hint(CAN_BE_FOUND_AT).GetText()+" #"+locationText+"#."; Text finalHint = Hint(PREFIX).GetText()+"#"+itemText+"# "+Hint(CAN_BE_FOUND_AT).GetText()+" #"+locationText+"#.";
SPDLOG_INFO("\tMessage: "); SPDLOG_DEBUG("\tMessage: ");
SPDLOG_INFO(finalHint.english); SPDLOG_DEBUG(finalHint.english);
SPDLOG_INFO("\n\n"); SPDLOG_DEBUG("\n\n");
AddHint(finalHint, gossipStone, {QM_RED, QM_GREEN}); AddHint(finalHint, gossipStone, {QM_RED, QM_GREEN});
} }
} }
@ -411,15 +411,15 @@ static void CreateJunkHint() {
LogicReset(); LogicReset();
const std::vector<uint32_t> gossipStones = GetAccessibleLocations(gossipStoneLocations); const std::vector<uint32_t> gossipStones = GetAccessibleLocations(gossipStoneLocations);
if (gossipStones.empty()) { if (gossipStones.empty()) {
SPDLOG_INFO("\tNO GOSSIP STONES TO PLACE HINT\n\n"); SPDLOG_DEBUG("\tNO GOSSIP STONES TO PLACE HINT\n\n");
return; return;
} }
uint32_t gossipStone = RandomElement(gossipStones); uint32_t gossipStone = RandomElement(gossipStones);
Text hint = junkHint.GetText(); Text hint = junkHint.GetText();
SPDLOG_INFO("\tMessage: "); SPDLOG_DEBUG("\tMessage: ");
SPDLOG_INFO(hint.english); SPDLOG_DEBUG(hint.english);
SPDLOG_INFO("\n\n"); SPDLOG_DEBUG("\n\n");
AddHint(hint, gossipStone, {QM_PINK}); AddHint(hint, gossipStone, {QM_PINK});
} }
@ -711,7 +711,7 @@ void CreateAllHints() {
CreateGanonText(); CreateGanonText();
CreateAltarText(); CreateAltarText();
SPDLOG_INFO("\nNOW CREATING HINTS\n"); SPDLOG_DEBUG("\nNOW CREATING HINTS\n");
const HintSetting& hintSetting = hintSettingTable[Settings::HintDistribution.Value<uint8_t>()]; const HintSetting& hintSetting = hintSettingTable[Settings::HintDistribution.Value<uint8_t>()];
uint8_t remainingDungeonWothHints = hintSetting.dungeonsWothLimit; uint8_t remainingDungeonWothHints = hintSetting.dungeonsWothLimit;
@ -768,9 +768,9 @@ void CreateAllHints() {
barrenDungeons.push_back(barrenRegion); barrenDungeons.push_back(barrenRegion);
} }
} }
SPDLOG_INFO("\nBarren Dungeons:\n"); SPDLOG_DEBUG("\nBarren Dungeons:\n");
for (std::string barrenDungeon : barrenDungeons) { for (std::string barrenDungeon : barrenDungeons) {
SPDLOG_INFO(barrenDungeon + "\n"); SPDLOG_DEBUG(barrenDungeon + "\n");
} }
//Get list of all woth dungeons //Get list of all woth dungeons
@ -783,9 +783,9 @@ void CreateAllHints() {
wothDungeons.push_back(wothRegion); wothDungeons.push_back(wothRegion);
} }
} }
SPDLOG_INFO("\nWoth Dungeons:\n"); SPDLOG_DEBUG("\nWoth Dungeons:\n");
for (std::string wothDungeon : wothDungeons) { for (std::string wothDungeon : wothDungeons) {
SPDLOG_INFO(wothDungeon + "\n"); SPDLOG_DEBUG(wothDungeon + "\n");
} }
//Set DungeonInfo array for each dungeon //Set DungeonInfo array for each dungeon
@ -827,9 +827,9 @@ void CreateAllHints() {
//get a random hint type from the remaining hints //get a random hint type from the remaining hints
HintType type = RandomElement(remainingHintTypes, true); HintType type = RandomElement(remainingHintTypes, true);
SPDLOG_INFO("Attempting to make hint of type: "); SPDLOG_DEBUG("Attempting to make hint of type: ");
SPDLOG_INFO(hintTypeNames[static_cast<int>(type)]); SPDLOG_DEBUG(hintTypeNames[static_cast<int>(type)]);
SPDLOG_INFO("\n"); SPDLOG_DEBUG("\n");
//create the appropriate hint for the type //create the appropriate hint for the type
if (type == HintType::Woth) { if (type == HintType::Woth) {

View File

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

View File

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

View File

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