mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
[MOD]Visual & audio Stone of agony (#177)
* Visual / Audio Stone of Agony This add Sound and blinking icon for the item Stone of Agony. Useful for peoples that have issues with rumble anything other person that is also blind or deaf. This is made with these second person in mind, home they will like it :) * Adding bool there Yes I do fiels one by one to be sure * Adding the Cvar register 1 file left :D * Adding the main change in func_80848EF8 And that the last file :)
This commit is contained in:
parent
f65486d82d
commit
f05d006479
@ -67,6 +67,9 @@ namespace Game {
|
|||||||
Settings.enhancements.minimal_ui = stob(Conf[EnhancementSection]["minimal_ui"]);
|
Settings.enhancements.minimal_ui = stob(Conf[EnhancementSection]["minimal_ui"]);
|
||||||
CVar_SetS32("gMinimalUI", Settings.enhancements.minimal_ui);
|
CVar_SetS32("gMinimalUI", Settings.enhancements.minimal_ui);
|
||||||
|
|
||||||
|
Settings.enhancements.visualagony = stob(Conf[EnhancementSection]["visualagony"]);
|
||||||
|
CVar_SetS32("gVisualAgony", Settings.enhancements.visualagony);
|
||||||
|
|
||||||
Settings.enhancements.mm_bunny_hood = stob(Conf[EnhancementSection]["mm_bunny_hood"]);
|
Settings.enhancements.mm_bunny_hood = stob(Conf[EnhancementSection]["mm_bunny_hood"]);
|
||||||
CVar_SetS32("gMMBunnyHood", Settings.enhancements.mm_bunny_hood);
|
CVar_SetS32("gMMBunnyHood", Settings.enhancements.mm_bunny_hood);
|
||||||
|
|
||||||
@ -175,8 +178,10 @@ namespace Game {
|
|||||||
Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu);
|
Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu);
|
||||||
Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon);
|
Conf[EnhancementSection]["dynamic_wallet_icon"] = std::to_string(Settings.enhancements.dynamic_wallet_icon);
|
||||||
Conf[EnhancementSection]["minimal_ui"] = std::to_string(Settings.enhancements.minimal_ui);
|
Conf[EnhancementSection]["minimal_ui"] = std::to_string(Settings.enhancements.minimal_ui);
|
||||||
|
Conf[EnhancementSection]["visualagony"] = std::to_string(Settings.enhancements.visualagony);
|
||||||
Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood);
|
Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood);
|
||||||
|
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
Conf[ControllerSection]["gyro_sensitivity"] = std::to_string(Settings.controller.gyro_sensitivity);
|
Conf[ControllerSection]["gyro_sensitivity"] = std::to_string(Settings.controller.gyro_sensitivity);
|
||||||
Conf[ControllerSection]["rumble_strength"] = std::to_string(Settings.controller.rumble_strength);
|
Conf[ControllerSection]["rumble_strength"] = std::to_string(Settings.controller.rumble_strength);
|
||||||
|
@ -26,7 +26,9 @@ struct SoHConfigType {
|
|||||||
bool animated_pause_menu = false;
|
bool animated_pause_menu = false;
|
||||||
bool dynamic_wallet_icon = false;
|
bool dynamic_wallet_icon = false;
|
||||||
bool minimal_ui = false;
|
bool minimal_ui = false;
|
||||||
|
bool visualagony = false;
|
||||||
bool mm_bunny_hood = false;
|
bool mm_bunny_hood = false;
|
||||||
|
|
||||||
} enhancements;
|
} enhancements;
|
||||||
|
|
||||||
// Controller
|
// Controller
|
||||||
|
@ -25,6 +25,7 @@ void BootCommands_Init()
|
|||||||
CVar_RegisterS32("gDebugEnabled", 0);
|
CVar_RegisterS32("gDebugEnabled", 0);
|
||||||
CVar_RegisterS32("gPauseLiveLink", 0);
|
CVar_RegisterS32("gPauseLiveLink", 0);
|
||||||
CVar_RegisterS32("gMinimalUI", 0);
|
CVar_RegisterS32("gMinimalUI", 0);
|
||||||
|
CVar_RegisterS32("gVisualAgony", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void BootCommands_ParseBootArgs(char* str)
|
//void BootCommands_ParseBootArgs(char* str)
|
||||||
|
@ -10274,8 +10274,45 @@ void func_80848EF8(Player* this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->unk_6A0 += temp;
|
this->unk_6A0 += temp;
|
||||||
|
|
||||||
|
/*Prevent it on horse, while jumping and on title screen.
|
||||||
|
If you fly around no stone of agony for you! */
|
||||||
|
if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) {
|
||||||
|
int rectLeft = OTRGetRectDimensionFromLeftEdge(26); //Left X Pos
|
||||||
|
int rectTop = 60; //Top Y Pos
|
||||||
|
int rectWidth = 24; //Texture Width
|
||||||
|
int rectHeight = 24; //Texture Heigh
|
||||||
|
int DefaultIconA= 50; //Default icon alphe (55 on 255)
|
||||||
|
|
||||||
|
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 2824);
|
||||||
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);
|
||||||
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
if (this->unk_6A0 > 4000000.0f) {
|
||||||
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
|
||||||
|
} else {
|
||||||
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);
|
||||||
|
}
|
||||||
|
if (temp == 0 || temp <= 0.1f) {
|
||||||
|
/*Fail check, it is used to draw off the icon when
|
||||||
|
link is standing out range but do not refresh unk_6A0.
|
||||||
|
Also used to make a default value in my case.*/
|
||||||
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);
|
||||||
|
}
|
||||||
|
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
|
||||||
|
gDPSetOtherMode(OVERLAY_DISP++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
|
||||||
|
gDPLoadTextureBlock(OVERLAY_DISP++, gStoneOfAgonyIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 24, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||||
|
gDPSetOtherMode(OVERLAY_DISP++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
|
||||||
|
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||||
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 3500);
|
||||||
|
}
|
||||||
|
|
||||||
if (this->unk_6A0 > 4000000.0f) {
|
if (this->unk_6A0 > 4000000.0f) {
|
||||||
this->unk_6A0 = 0.0f;
|
this->unk_6A0 = 0.0f;
|
||||||
|
if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) {
|
||||||
|
//This audio is placed here and not in previous CVar check to prevent ears ra.. :)
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E0);
|
||||||
|
}
|
||||||
func_8083264C(this, 120, 20, 10, 0);
|
func_8083264C(this, 120, 20, 10, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user