mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-12 21:30:14 -05:00
Save timesplits colour to cvar and reload it on init. (#4572)
* save timesplits colour to cvar and reload it * fix mac and match cosmetics with the color conversion * more stupid other platform fixes
This commit is contained in:
parent
f0e5b9c22b
commit
eda97653d6
@ -220,7 +220,7 @@ static const ALIGN_ASSET(2) char gLinkChildDL_18580[] = dgLinkChildDL_18580;
|
|||||||
static const ALIGN_ASSET(2) char gLinkChildBottle2DL[] = dgLinkChildBottle2DL;
|
static const ALIGN_ASSET(2) char gLinkChildBottle2DL[] = dgLinkChildBottle2DL;
|
||||||
|
|
||||||
#define dgLinkChildSlinghotStringDL "__OTR__objects/object_link_child/gLinkChildSlinghotStringDL"
|
#define dgLinkChildSlinghotStringDL "__OTR__objects/object_link_child/gLinkChildSlinghotStringDL"
|
||||||
static const ALIGN_ASSET(2) char gLinkChildSlinghotStringDL[] = dgLinkChildSlinghotStringDL;
|
static const ALIGN_ASSET(2) char gLinkChildSlingshotStringDL[] = dgLinkChildSlinghotStringDL;
|
||||||
|
|
||||||
#define dgLinkChildDekuShieldDL "__OTR__objects/object_link_child/gLinkChildDekuShieldDL"
|
#define dgLinkChildDekuShieldDL "__OTR__objects/object_link_child/gLinkChildDekuShieldDL"
|
||||||
static const ALIGN_ASSET(2) char gLinkChildDekuShieldDL[] = dgLinkChildDekuShieldDL;
|
static const ALIGN_ASSET(2) char gLinkChildDekuShieldDL[] = dgLinkChildDekuShieldDL;
|
||||||
|
@ -851,7 +851,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
|
|||||||
Color_RGBA8 color = CVarGetColor(equipmentSlingshotString.cvar, defaultColor);
|
Color_RGBA8 color = CVarGetColor(equipmentSlingshotString.cvar, defaultColor);
|
||||||
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString1",equipmentSlingshotString.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
|
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString1",equipmentSlingshotString.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
|
||||||
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString2",equipmentSlingshotString.changedCvar, 76, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
|
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString2",equipmentSlingshotString.changedCvar, 76, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
|
||||||
PATCH_GFX(gLinkChildSlinghotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
|
PATCH_GFX(gLinkChildSlingshotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
static CosmeticOption& equipmentBowTips = cosmeticOptions.at("Equipment.BowTips");
|
static CosmeticOption& equipmentBowTips = cosmeticOptions.at("Equipment.BowTips");
|
||||||
|
@ -745,14 +745,18 @@ void TimeSplitsDrawOptionsMenu() {
|
|||||||
ImGui::SeparatorText("Window Options");
|
ImGui::SeparatorText("Window Options");
|
||||||
if (ImGui::ColorEdit4("Background Color", (float*)&windowColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) {
|
if (ImGui::ColorEdit4("Background Color", (float*)&windowColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) {
|
||||||
Color_RGBA8 color;
|
Color_RGBA8 color;
|
||||||
color.r = windowColor.x;
|
color.r = windowColor.x * 255.0;
|
||||||
color.g = windowColor.y;
|
color.g = windowColor.y * 255.0;
|
||||||
color.b = windowColor.z;
|
color.b = windowColor.z * 255.0;
|
||||||
color.a = windowColor.w;
|
color.a = windowColor.w * 255.0;
|
||||||
|
CVarSetColor("TimeSplits.WindowColor", color);
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Reset")) {
|
if (ImGui::Button("Reset")) {
|
||||||
windowColor = { 0.0f, 0.0f, 0.0f, 1.0f };
|
windowColor = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||||
|
CVarSetColor("TimeSplits.WindowColor", {0, 0, 0, 1});
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UIWidgets::PaddedEnhancementSliderFloat("Window Size: %.1fx", "##windowSize",
|
if (UIWidgets::PaddedEnhancementSliderFloat("Window Size: %.1fx", "##windowSize",
|
||||||
@ -914,6 +918,9 @@ static bool initialized = false;
|
|||||||
void TimeSplitWindow::DrawElement() {
|
void TimeSplitWindow::DrawElement() {
|
||||||
ImGui::SetWindowFontScale(timeSplitsWindowSize);
|
ImGui::SetWindowFontScale(timeSplitsWindowSize);
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
|
Color_RGBA8 defaultColour = {0, 0, 0, 255};
|
||||||
|
Color_RGBA8 color = CVarGetColor("TimeSplits.WindowColor", defaultColour);
|
||||||
|
windowColor = {(float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f, (float)color.a / 255.0f};
|
||||||
InitializeSplitDataFile();
|
InitializeSplitDataFile();
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -1753,7 +1753,7 @@ Vec3f sLeftHandArrowVec3 = { 398.0f, 1419.0f, 244.0f };
|
|||||||
|
|
||||||
BowStringData sBowStringData[] = {
|
BowStringData sBowStringData[] = {
|
||||||
{ gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // bow
|
{ gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // bow
|
||||||
{ gLinkChildSlinghotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot
|
{ gLinkChildSlingshotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot
|
||||||
};
|
};
|
||||||
|
|
||||||
Vec3f sRightHandLimbModelShieldQuadVertices[] = {
|
Vec3f sRightHandLimbModelShieldQuadVertices[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user