Merge pull request #1471 from HarbourMasters/develop-zhora

zhora -> rando-next
This commit is contained in:
briaguya 2022-09-14 10:58:59 -04:00 committed by GitHub
commit 978ddcc5a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 70 deletions

View file

@ -546,7 +546,11 @@ namespace GameMenuBar {
}
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
#if defined(__SWITCH__) || defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif
if (ImGui::SliderInt("##ExtraLatencyThreshold", &val, 0, 360, "", ImGuiSliderFlags_AlwaysClamp))
{
CVar_SetS32(cvar, val);
@ -1095,8 +1099,8 @@ namespace GameMenuBar {
}
ImGui::SameLine();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
#ifdef __WIIU__
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f * 2);
#if defined(__SWITCH__) || defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif

View file

@ -322,8 +322,8 @@ namespace UIWidgets {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f);
}
if (PlusMinusButton) {
#ifdef __WIIU__
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f * 2);
#if defined(__SWITCH__) || defined(__WIIU__)
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 110.0f);
#else
ImGui::PushItemWidth(ImGui::GetWindowSize().x - 79.0f);
#endif

View file

@ -81,7 +81,7 @@ Color_RGB8 sOcarinaNoteA4Prim;
Color_RGB8 sOcarinaNoteF4Prim;
Color_RGB8 sOcarinaNoteD4Prim;
// If the "separate" bool is set, use the "gCCC<cDirection>BtnPrim<R/G/B> CVars
// If the "separate" bool is set, use the "gCCC<cDirection>BtnPrim CVars
// to set the button color. Otherwise, use sOcarinaNoteCBtnPrim.
void Message_SetCustomOrGeneralCColor(Color_RGB8* color, bool separate, char cDirection) {
if (!separate) {
@ -90,15 +90,9 @@ void Message_SetCustomOrGeneralCColor(Color_RGB8* color, bool separate, char cDi
}
// C direction is '*' @ idx 4
// Color component is '*' @ idx 12
char cVar[] = "gCCC*BtnPrim*";
char cVar[] = "gCCC*BtnPrim";
cVar[4] = cDirection;
cVar[12] = 'R';
color->r = CVar_GetS32(cVar, 255);
cVar[12] = 'G';
color->g = CVar_GetS32(cVar, 255);
cVar[12] = 'B';
color->b = CVar_GetS32(cVar, 50);
*color = CVar_GetRGB(cVar, (Color_RGB8){ .r = 255, .g = 255, .b = 50});
}
typedef struct {
@ -115,9 +109,7 @@ typedef struct {
void Message_SetCustomOcarinaNoteColor(Color_RGB8* color, s32 btnMap, CustomNoteOptions* flags) {
switch (btnMap) {
case BTN_A:
color->r = CVar_GetS32("gCCABtnPrimR", 80);
color->g = CVar_GetS32("gCCABtnPrimG", 255);
color->b = CVar_GetS32("gCCABtnPrimB", 150);
*color = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 80, .g = 255, .b = 150 });
break;
case BTN_CUP:
Message_SetCustomOrGeneralCColor(color, flags->separateC, 'U');
@ -132,24 +124,24 @@ void Message_SetCustomOcarinaNoteColor(Color_RGB8* color, s32 btnMap, CustomNote
Message_SetCustomOrGeneralCColor(color, flags->separateC, 'R');
break;
case BTN_START:
color->r = CVar_GetS32("gCCStartBtnPrimR", 200);
color->g = CVar_GetS32("gCCStartBtnPrimG", 0);
color->b = CVar_GetS32("gCCStartBtnPrimB", 0);
*color = CVar_GetRGB("gCCStartBtnPrim", (Color_RGB8){ .r = 200, .g = 0, .b = 0 });
break;
case BTN_DUP:
case BTN_DDOWN:
case BTN_DLEFT:
case BTN_DRIGHT:
color->r = CVar_GetS32("gCCDpadPrimR", 255) * 103 / 255;
color->g = CVar_GetS32("gCCDpadPrimG", 255) * 103 / 255;
color->b = CVar_GetS32("gCCDpadPrimB", 255) * 103 / 255;
*color = CVar_GetRGB("gCCDpadPrim", (Color_RGB8){ .r = 255, .g = 255, .b = 255 });
color->r *= 103 / 255;
color->g *= 103 / 255;
color->b *= 103 / 255;
break;
case 0:
if (flags->dpad && !flags->rightStick) {
// D pad is dark gray even when set to white, so emulate that.
color->r = CVar_GetS32("gCCDpadPrimR", 255) * 103 / 255;
color->g = CVar_GetS32("gCCDpadPrimG", 255) * 103 / 255;
color->b = CVar_GetS32("gCCDpadPrimB", 255) * 103 / 255;
*color = CVar_GetRGB("gCCDpadPrim", (Color_RGB8){ .r = 255, .g = 255, .b = 255 });
color->r *= 103 / 255;
color->g *= 103 / 255;
color->b *= 103 / 255;
break;
} // else fall through
default:
@ -184,9 +176,7 @@ void Message_ResetOcarinaNoteState(void) {
sOcarinaNoteA4Prim = sOcarinaNoteCBtnPrim;
sOcarinaNoteF4Prim = sOcarinaNoteCBtnPrim;
} else { // Custom
sOcarinaNoteCBtnPrim.r = CVar_GetS32("gCCCBtnPrimR", 255);
sOcarinaNoteCBtnPrim.g = CVar_GetS32("gCCCBtnPrimG", 255);
sOcarinaNoteCBtnPrim.b = CVar_GetS32("gCCCBtnPrimB", 50);
sOcarinaNoteCBtnPrim = CVar_GetRGB("gCCCBtnPrim", (Color_RGB8){ .r = 255, .g = 255, .b = 50 });
CustomNoteOptions options = (CustomNoteOptions){
.separateC = CVar_GetS32("gCCparated", 0),
@ -205,9 +195,7 @@ void Message_ResetOcarinaNoteState(void) {
Message_SetCustomOrGeneralCColor(&sOcarinaNoteB4Prim, options.separateC, 'L');
Message_SetCustomOrGeneralCColor(&sOcarinaNoteA4Prim, options.separateC, 'R');
Message_SetCustomOrGeneralCColor(&sOcarinaNoteF4Prim, options.separateC, 'D');
sOcarinaNoteD4Prim.r = CVar_GetS32("gCCABtnPrimR", 80);
sOcarinaNoteD4Prim.g = CVar_GetS32("gCCABtnPrimG", 255);
sOcarinaNoteD4Prim.b = CVar_GetS32("gCCABtnPrimB", 150);
sOcarinaNoteD4Prim = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 80, .g = 255, .b = 150 });
}
}
}
@ -583,12 +571,13 @@ void Message_DrawTextboxIcon(GlobalContext* globalCtx, Gfx** p, s16 x, s16 y) {
sIconEnvColors[1][1] = 255;
sIconEnvColors[1][2] = 130;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
sIconPrimColors[0][0] = (CVar_GetS32("gCCABtnPrimR", 0)/255)*95;
sIconPrimColors[0][1] = (CVar_GetS32("gCCABtnPrimG", 200)/255)*95;
sIconPrimColors[0][2] = (CVar_GetS32("gCCABtnPrimB", 80)/255)*95;
sIconPrimColors[1][0] = CVar_GetS32("gCCABtnPrimR", 0);
sIconPrimColors[1][1] = CVar_GetS32("gCCABtnPrimG", 200);
sIconPrimColors[1][2] = CVar_GetS32("gCCABtnPrimB", 80);
Color_RGB8 aBtnColor = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 0, .g = 200, .b = 80 });
sIconPrimColors[0][0] = (aBtnColor.r/255)*95;
sIconPrimColors[0][1] = (aBtnColor.g/255)*95;
sIconPrimColors[0][2] = (aBtnColor.b/255)*95;
sIconPrimColors[1][0] = aBtnColor.r;
sIconPrimColors[1][1] = aBtnColor.g;
sIconPrimColors[1][2] = aBtnColor.b;
sIconEnvColors[0][0] = 0;
sIconEnvColors[0][1] = 0;
sIconEnvColors[0][2] = 0;
@ -2075,12 +2064,13 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
{ 80, 255, 150 },
{ 100, 255, 200 },
};
s16 ABtnR = CVar_GetS32("gCCABtnPrimR", 80);
s16 ABtnG = CVar_GetS32("gCCABtnPrimG", 255);
s16 ABtnB = CVar_GetS32("gCCABtnPrimB", 150);
s16 ABtnR_2 = CVar_GetS32("gCCABtnPrimR", 80)+20;
s16 ABtnG_2 = CVar_GetS32("gCCABtnPrimG", 235)+20;
s16 ABtnB_2 = CVar_GetS32("gCCABtnPrimB", 180)+20;
Color_RGB8 ABtnColor = CVar_GetRGB("gCCABtnPrim", (Color_RGB8){ .r = 80, .g = 255, .b = 150});
s16 ABtnR = ABtnColor.r;
s16 ABtnG = ABtnColor.g;
s16 ABtnB = ABtnColor.b;
s16 ABtnR_2 = ABtnColor.r+20;
s16 ABtnG_2 = ABtnColor.g+20;
s16 ABtnB_2 = ABtnColor.b+20;
if(ABtnR_2 > 255){ABtnR_2=255;};
if(ABtnG_2 > 255){ABtnG_2=255;};
if(ABtnB_2 > 255){ABtnB_2=255;};
@ -2097,24 +2087,31 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
{ 255, 255, 50 },
{ 255, 255, 180 },
};
s16 CBtnR = CVar_GetS32("gCCCBtnPrimR", 255);
s16 CBtnG = CVar_GetS32("gCCCBtnPrimG", 255);
s16 CBtnB = CVar_GetS32("gCCCBtnPrimB", 50);
s16 CBtnR_2 = CVar_GetS32("gCCCBtnPrimR", 255)+20;
s16 CBtnG_2 = CVar_GetS32("gCCCBtnPrimG", 255)+20;
s16 CBtnB_2 = CVar_GetS32("gCCCBtnPrimB", 50)+20;
s16 CBtnRU = CVar_GetS32("gCCCUBtnPrimR", 255);
s16 CBtnGU = CVar_GetS32("gCCCUBtnPrimG", 255);
s16 CBtnBU = CVar_GetS32("gCCCUBtnPrimB", 50);
s16 CBtnRL = CVar_GetS32("gCCCLBtnPrimR", 255);
s16 CBtnGL = CVar_GetS32("gCCCLBtnPrimG", 255);
s16 CBtnBL = CVar_GetS32("gCCCLBtnPrimB", 50);
s16 CBtnRD = CVar_GetS32("gCCCDBtnPrimR", 255);
s16 CBtnGD = CVar_GetS32("gCCCDBtnPrimG", 255);
s16 CBtnBD = CVar_GetS32("gCCCDBtnPrimB", 50);
s16 CBtnRR = CVar_GetS32("gCCCRBtnPrimR", 255);
s16 CBtnGR = CVar_GetS32("gCCCRBtnPrimG", 255);
s16 CBtnBR = CVar_GetS32("gCCCRBtnPrimB", 50);
Color_RGB8 CBtnDefaultColor = {255, 255, 50};
Color_RGB8 CBtnColor = CVar_GetRGB("gCCCBtnPrim", CBtnDefaultColor);
s16 CBtnR = CBtnColor.r;
s16 CBtnG = CBtnColor.g;
s16 CBtnB = CBtnColor.b;
s16 CBtnR_2 = CBtnColor.r+20;
s16 CBtnG_2 = CBtnColor.g+20;
s16 CBtnB_2 = CBtnColor.b+20;
Color_RGB8 CUpColor = CVar_GetRGB("gCCCUBtnPrim", CBtnDefaultColor);
s16 CBtnRU = CUpColor.r;
s16 CBtnGU = CUpColor.g;
s16 CBtnBU = CUpColor.b;
Color_RGB8 CLeftColor = CVar_GetRGB("gCCCLBtnPrim", CBtnDefaultColor);
s16 CBtnRL = CLeftColor.r;
s16 CBtnGL = CLeftColor.g;
s16 CBtnBL = CLeftColor.b;
Color_RGB8 CDownColor = CVar_GetRGB("gCCCDBtnPrim", CBtnDefaultColor);
s16 CBtnRD = CDownColor.r;
s16 CBtnGD = CDownColor.g;
s16 CBtnBD = CDownColor.b;
Color_RGB8 CRightColor = CVar_GetRGB("gCCCRBtnPrim", CBtnDefaultColor);
s16 CBtnRR = CRightColor.r;
s16 CBtnGR = CRightColor.g;
s16 CBtnBR = CRightColor.b;
if(CBtnR_2 > 255){CBtnR_2=255;};
if(CBtnG_2 > 255){CBtnG_2=255;};
if(CBtnB_2 > 255){CBtnB_2=255;};

View file

@ -138,7 +138,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) {
}
this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 3.0f);
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
if (D_8088BFC0 > 0.0f) {
temp_v1 = Math_StepToF(&D_8088BFC0, 20.0f, this->dyna.actor.speedXZ);

View file

@ -388,7 +388,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 3.0f);
this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f);
blockStop = Math_StepToF(&sBgPoEventblockPushDist, 20.0f, this->dyna.actor.speedXZ);
displacement = this->direction * sBgPoEventblockPushDist;
this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x;

View file

@ -260,9 +260,9 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) {
s32 approxFResult;
Actor* actor = &this->dyna.actor;
this->unk_174 = this->unk_174 + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->unk_174 = this->unk_174 + ((CVar_GetS32("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f;
this->unk_174 = CLAMP_MAX(this->unk_174, 3.0f);
this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f);
approxFResult = Math_StepToF(&this->unk_178, 20.0f, this->unk_174);

View file

@ -558,9 +558,9 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) {
f32 pushDistSigned;
s32 stopFlag;
this->pushSpeed = this->pushSpeed + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f;
this->pushSpeed = this->pushSpeed + ((CVar_GetS32("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f;
this->stateFlags |= PUSHBLOCK_PUSH;
this->pushSpeed = CLAMP_MAX(this->pushSpeed, 3.0f);
this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f);
stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed);
pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist;
thisx->world.pos.x = thisx->home.pos.x + (pushDistSigned * this->yawSin);

View file

@ -9434,6 +9434,7 @@ static EffectBlureInit2 D_8085470C = {
static Vec3s D_80854730 = { -57, 3377, 0 };
void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeader* skelHeader) {
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
this->ageProperties = &sAgeProperties[gSaveContext.linkAge];
Actor_ProcessInitChain(&this->actor, sInitChain);
this->swordEffectIndex = TOTAL_EFFECT_COUNT;

View file

@ -365,7 +365,7 @@ void DrawSeedHashSprites(FileChooseContext* this) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileButtonAlpha[this->buttonIndex]);
if (CVar_GetS32("gRandomizer", 0) != 0 && CVar_GetString("gSpoilerLog", "") != "") {
if (CVar_GetS32("gRandomizer", 0) && strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0) {
u16 xStart = 64;
for (u8 i = 0; i < 5; i++) {
SpriteLoad(this, GetSeedTexture(gSaveContext.seedIcons[i]));