Skip to content

Commit

Permalink
Update from Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Caladius committed Nov 29, 2024
1 parent c2df8c4 commit 6f85442
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 30 deletions.
12 changes: 6 additions & 6 deletions soh/assets/soh_assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ static const ALIGN_ASSET(2) char gSplitEntranceTex[] = dgSplitEntrance;
#define dgBossSoul "__OTR__textures/parameter_static/gBossSoul"
static const ALIGN_ASSET(2) char gBossSoulTex[] = dgBossSoul;

#define dgMoonIco "__OTR__textures/parameter_static/gMoon"
static const ALIGN_ASSET(2) char gMoonIcoTex[] = dgMoonIco;
#define dgMoonIcon "__OTR__textures/parameter_static/gMoon"
static const ALIGN_ASSET(2) char gMoonIconTex[] = dgMoonIcon;

#define dgSunIco "__OTR__textures/parameter_static/gSun"
static const ALIGN_ASSET(2) char gSunIcoTex[] = dgSunIco;
#define dgSunIcon "__OTR__textures/parameter_static/gSun"
static const ALIGN_ASSET(2) char gSunIconTex[] = dgSunIcon;

#define dgNaviIco "__OTR__textures/parameter_static/gNavi"
static const ALIGN_ASSET(2) char gNaviIcoTex[] = dgNaviIco;
#define dgNaviIcon "__OTR__textures/parameter_static/gNavi"
static const ALIGN_ASSET(2) char gNaviIconTex[] = dgNaviIcon;

#define dgFileSelMQButtonTex "__OTR__textures/title_static/gFileSelMQButtonTex"
static const ALIGN_ASSET(2) char gFileSelMQButtonTex[] = dgFileSelMQButtonTex;
Expand Down
18 changes: 9 additions & 9 deletions soh/soh/Enhancements/TimeDisplay/TimeDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ImVec4 textColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
#define COLOR_LIGHT_GREEN ImVec4(0.52f, 1.0f, 0.23f, 1.0f)
#define COLOR_GREY ImVec4(0.78f, 0.78f, 0.78f, 1.0f)

std::vector<std::pair<std::string, const char*>> digitList = {
const static std::vector<std::pair<std::string, const char*>> digitList = {
{ "DIGIT_0_TEXTURE", gCounterDigit0Tex },
{ "DIGIT_1_TEXTURE", gCounterDigit1Tex },
{ "DIGIT_2_TEXTURE", gCounterDigit2Tex },
Expand All @@ -41,14 +41,14 @@ std::vector<std::pair<std::string, const char*>> digitList = {
{ "COLON_TEXTURE", gCounterColonTex },
};

std::vector<TimeObject> timeDisplayList = {
const std::vector<TimeObject> timeDisplayList = {
{ DISPLAY_IN_GAME_TIMER, "Display Gameplay Timer", CVAR_ENHANCEMENT("TimeDisplay.Timers.InGameTimer") },
{ DISPLAY_TIME_OF_DAY, "Display Time of Day", CVAR_ENHANCEMENT("TimeDisplay.Timers.TimeofDay") },
{ DISPLAY_CONDITIONAL_TIMER, "Display Conditional Timer", CVAR_ENHANCEMENT("TimeDisplay.Timers.HotWater") },
{ DISPLAY_NAVI_TIMER, "Display Navi Timer", CVAR_ENHANCEMENT("TimeDisplay.Timers.NaviTimer") }
};

std::vector<TimeObject> activeTimers;
static std::vector<TimeObject> activeTimers;

std::string convertDayTime(uint32_t dayTime) {
uint32_t totalSeconds = 24 * 60 * 60;
Expand Down Expand Up @@ -80,7 +80,7 @@ std::string formatTimeDisplay(uint32_t value) {
return fmt::format("{}:{:0>2}:{:0>2}.{}", hh, mm, ss, ds);
}

void TimeDisplayGetTimer(uint32_t timeID) {
static void TimeDisplayGetTimer(uint32_t timeID) {
timeDisplayTime = "";
textureDisplay = 0;
textColor = COLOR_WHITE;
Expand Down Expand Up @@ -197,7 +197,7 @@ void TimeDisplayWindow::Draw() {
if (textToDecode[i] == ':' || textToDecode[i] == '.') {
textureIndex = 10;
} else {
textureIndex = textToDecode[i] - 48;
textureIndex = textToDecode[i] - '0';
}
if (textToDecode[i] == '.') {
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (8.0f * fontScale));
Expand Down Expand Up @@ -232,7 +232,7 @@ void TimeDisplayInitSettings() {
}
}

void TimeDisplayInitTimers() {
static void TimeDisplayInitTimers() {
for (auto& update : timeDisplayList) {
if (CVarGetInteger(update.timeEnable, 0)) {
activeTimers.push_back(update);
Expand All @@ -242,9 +242,9 @@ void TimeDisplayInitTimers() {

void TimeDisplayWindow::InitElement() {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("GAMEPLAY_TIMER", gClockIconTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("DAY_TIME_TIMER", gSunIcoTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("NIGHT_TIME_TIMER", gMoonIcoTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("NAVI_TIMER", gNaviIcoTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("DAY_TIME_TIMER", gSunIconTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("NIGHT_TIME_TIMER", gMoonIconTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("NAVI_TIMER", gNaviIconTex, ImVec4(1, 1, 1, 1));

for (auto& load : digitList) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(load.first.c_str(), load.second, ImVec4(1, 1, 1, 1));
Expand Down
2 changes: 1 addition & 1 deletion soh/soh/Enhancements/TimeDisplay/TimeDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ typedef struct {
const char* timeEnable;
} TimeObject;

extern std::vector<TimeObject> timeDisplayList;
extern const std::vector<TimeObject> timeDisplayList;
26 changes: 12 additions & 14 deletions soh/src/code/z_parameter.c
Original file line number Diff line number Diff line change
Expand Up @@ -6056,22 +6056,20 @@ void Interface_Draw(PlayState* play) {
}
svar5 = OTRGetRectDimensionFromLeftEdge(gSaveContext.timerX[svar6]+X_Margins_Timer);
svar2 = gSaveContext.timerY[svar6];
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 4 ||
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 4 || // Hidden
(CVarGetInteger(CVAR_WINDOW("TimeDisplayEnabled"), 0) &&
CVarGetInteger(CVAR_ENHANCEMENT("TimeDisplay.Timers.HotWater"), 0) == 1)) {
CVarGetInteger(CVAR_ENHANCEMENT("TimeDisplay.Timers.HotWater"), 0))) {
svar5 = -9999;
} else {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) != 0) {
svar2 = (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosY"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 1) {//Anchor Left
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.UseMargins"), 0) != 0) {X_Margins_Timer = Left_HUD_Margin;};
svar5 = OTRGetRectDimensionFromLeftEdge(CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosX"), 0)+X_Margins_Timer);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 2) {//Anchor Right
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.UseMargins"), 0) != 0) {X_Margins_Timer = Right_HUD_Margin;};
svar5 = OTRGetRectDimensionFromRightEdge(CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosX"), 0)+X_Margins_Timer);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 3) {//Anchor None
svar5 = CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosX"), 0)+204+X_Margins_Timer;
}
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) != 0) {
svar2 = (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosY"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 1) {//Anchor Left
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.UseMargins"), 0) != 0) {X_Margins_Timer = Left_HUD_Margin;};
svar5 = OTRGetRectDimensionFromLeftEdge(CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosX"), 0)+X_Margins_Timer);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 2) {//Anchor Right
if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.UseMargins"), 0) != 0) {X_Margins_Timer = Right_HUD_Margin;};
svar5 = OTRGetRectDimensionFromRightEdge(CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosX"), 0)+X_Margins_Timer);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosType"), 0) == 3) {//Anchor None
svar5 = CVarGetInteger(CVAR_COSMETIC("HUD.Timers.PosX"), 0)+204+X_Margins_Timer;
}
}

Expand Down

0 comments on commit 6f85442

Please sign in to comment.