mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-04 09:29:04 -04:00
refactor: use LUS 1.0 RC
Co-authored-by: kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev>
This commit is contained in:
+35
-35
@@ -347,50 +347,50 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, PlayState* play)
|
||||
}
|
||||
|
||||
void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, PlayState* play) {
|
||||
if (CVar_GetS32("gCosmetics.Navi_IdlePrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PLAYER].inner = CVar_GetRGBA("gCosmetics.Navi_IdlePrimary.Value", defaultIdlePrimaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_IdlePrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PLAYER].inner = CVarGetColor("gCosmetics.Navi_IdlePrimary.Value", defaultIdlePrimaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_PLAYER].inner = defaultIdlePrimaryColor;
|
||||
}
|
||||
if (CVar_GetS32("gCosmetics.Navi_IdleSecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PLAYER].outer = CVar_GetRGBA("gCosmetics.Navi_IdleSecondary.Value", defaultIdleSecondaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_IdleSecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PLAYER].outer = CVarGetColor("gCosmetics.Navi_IdleSecondary.Value", defaultIdleSecondaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_PLAYER].outer = defaultIdleSecondaryColor;
|
||||
}
|
||||
|
||||
if (CVar_GetS32("gCosmetics.Navi_NPCPrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_NPC].inner = CVar_GetRGBA("gCosmetics.Navi_NPCPrimary.Value", defaultNPCPrimaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_NPCPrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_NPC].inner = CVarGetColor("gCosmetics.Navi_NPCPrimary.Value", defaultNPCPrimaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_NPC].inner = defaultNPCPrimaryColor;
|
||||
}
|
||||
if (CVar_GetS32("gCosmetics.Navi_NPCSecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_NPC].outer = CVar_GetRGBA("gCosmetics.Navi_NPCSecondary.Value", defaultNPCSecondaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_NPCSecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_NPC].outer = CVarGetColor("gCosmetics.Navi_NPCSecondary.Value", defaultNPCSecondaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_NPC].outer = defaultNPCSecondaryColor;
|
||||
}
|
||||
|
||||
if (CVar_GetS32("gCosmetics.Navi_EnemyPrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_ENEMY].inner = CVar_GetRGBA("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor);
|
||||
sNaviColorList[ACTORCAT_BOSS].inner = CVar_GetRGBA("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_EnemyPrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_ENEMY].inner = CVarGetColor("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor);
|
||||
sNaviColorList[ACTORCAT_BOSS].inner = CVarGetColor("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_ENEMY].inner = defaultEnemyPrimaryColor;
|
||||
sNaviColorList[ACTORCAT_BOSS].inner = defaultEnemyPrimaryColor;
|
||||
}
|
||||
if (CVar_GetS32("gCosmetics.Navi_EnemySecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_ENEMY].outer = CVar_GetRGBA("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor);
|
||||
sNaviColorList[ACTORCAT_BOSS].outer = CVar_GetRGBA("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_EnemySecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_ENEMY].outer = CVarGetColor("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor);
|
||||
sNaviColorList[ACTORCAT_BOSS].outer = CVarGetColor("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_ENEMY].outer = defaultEnemySecondaryColor;
|
||||
sNaviColorList[ACTORCAT_BOSS].outer = defaultEnemySecondaryColor;
|
||||
}
|
||||
|
||||
if (CVar_GetS32("gCosmetics.Navi_PropsPrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PROP].inner = CVar_GetRGBA("gCosmetics.Navi_PropsPrimary.Value", defaultPropsPrimaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_PropsPrimary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PROP].inner = CVarGetColor("gCosmetics.Navi_PropsPrimary.Value", defaultPropsPrimaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_PROP].inner = defaultPropsPrimaryColor;
|
||||
}
|
||||
if (CVar_GetS32("gCosmetics.Navi_PropsSecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PROP].outer = CVar_GetRGBA("gCosmetics.Navi_PropsSecondary.Value", defaultPropsSecondaryColor);
|
||||
if (CVarGetInteger("gCosmetics.Navi_PropsSecondary.Changed", 0)) {
|
||||
sNaviColorList[ACTORCAT_PROP].outer = CVarGetColor("gCosmetics.Navi_PropsSecondary.Value", defaultPropsSecondaryColor);
|
||||
} else {
|
||||
sNaviColorList[ACTORCAT_PROP].outer = defaultPropsSecondaryColor;
|
||||
}
|
||||
@@ -797,7 +797,7 @@ void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* t
|
||||
u8 height, s16 hasTranslation) {
|
||||
|
||||
if (ResourceMgr_OTRSigCheck(texture))
|
||||
texture = ResourceMgr_LoadTexByName(texture);
|
||||
texture = GetResourceDataByName(texture, false);
|
||||
|
||||
titleCtx->texture = texture;
|
||||
titleCtx->isBossCard = true;
|
||||
@@ -1019,7 +1019,7 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void*
|
||||
texture = newName;
|
||||
}
|
||||
|
||||
titleCtx->texture = ResourceMgr_LoadTexByName(texture);
|
||||
titleCtx->texture = GetResourceDataByName(texture, false);
|
||||
|
||||
//titleCtx->texture = texture;
|
||||
titleCtx->isBossCard = false;
|
||||
@@ -1035,10 +1035,10 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void*
|
||||
void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) {
|
||||
const Color_RGB8 TitleCard_Colors_ori = {255,255,255};
|
||||
Color_RGB8 TitleCard_Colors = {255,255,255};
|
||||
if (titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) {//Bosses cards.
|
||||
TitleCard_Colors = CVar_GetRGB("gCCTC_B_U_Prim", TitleCard_Colors_ori);
|
||||
} else if (!titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) {
|
||||
TitleCard_Colors = CVar_GetRGB("gCCTC_OW_U_Prim", TitleCard_Colors_ori);
|
||||
if (titleCtx->isBossCard && CVarGetInteger("gHudColors", 1) == 2) {//Bosses cards.
|
||||
TitleCard_Colors = CVarGetColor24("gCCTC_B_U_Prim", TitleCard_Colors_ori);
|
||||
} else if (!titleCtx->isBossCard && CVarGetInteger("gHudColors", 1) == 2) {
|
||||
TitleCard_Colors = CVarGetColor24("gCCTC_OW_U_Prim", TitleCard_Colors_ori);
|
||||
} else {
|
||||
TitleCard_Colors = TitleCard_Colors_ori;
|
||||
}
|
||||
@@ -1073,20 +1073,20 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) {
|
||||
if (titleCtx->alpha != 0) {
|
||||
width = titleCtx->width;
|
||||
height = titleCtx->height;
|
||||
s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosX", 0) : CVar_GetS32("gTCMPosX", 0));
|
||||
s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosY", 0) : CVar_GetS32("gTCMPosY", 0));
|
||||
s16 TitleCard_PosType_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosType", 0) : CVar_GetS32("gTCMPosType", 0));
|
||||
s16 TitleCard_Margin_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBUseMargins", 0) : CVar_GetS32("gTCMUseMargins", 0));
|
||||
s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVarGetInteger("gTCBPosX", 0) : CVarGetInteger("gTCMPosX", 0));
|
||||
s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVarGetInteger("gTCBPosY", 0) : CVarGetInteger("gTCMPosY", 0));
|
||||
s16 TitleCard_PosType_Checker = (titleCtx->isBossCard ? CVarGetInteger("gTCBPosType", 0) : CVarGetInteger("gTCMPosType", 0));
|
||||
s16 TitleCard_Margin_Checker = (titleCtx->isBossCard ? CVarGetInteger("gTCBUseMargins", 0) : CVarGetInteger("gTCMUseMargins", 0));
|
||||
s16 TitleCard_MarginX = 0;
|
||||
s16 TitleCard_PosX = titleCtx->x;
|
||||
s16 TitleCard_PosY = titleCtx->y;
|
||||
if (TitleCard_PosType_Checker != 0) {
|
||||
TitleCard_PosY = TitleCard_PosY_Modifier;
|
||||
if (TitleCard_PosType_Checker == 1) {//Anchor Left
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_L", 0)*-1;};
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger("gHUDMargin_L", 0)*-1;};
|
||||
TitleCard_PosX = OTRGetDimensionFromLeftEdge(TitleCard_PosX_Modifier+TitleCard_MarginX)-11;
|
||||
} else if (TitleCard_PosType_Checker == 2) {//Anchor Right
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_R", 0);};
|
||||
if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger("gHUDMargin_R", 0);};
|
||||
TitleCard_PosX = OTRGetDimensionFromRightEdge(TitleCard_PosX_Modifier+TitleCard_MarginX);
|
||||
} else if (TitleCard_PosType_Checker == 3) {//Anchor None
|
||||
TitleCard_PosX = TitleCard_PosX_Modifier;
|
||||
@@ -1212,7 +1212,7 @@ void Actor_Init(Actor* actor, PlayState* play) {
|
||||
actor->uncullZoneForward = 1000.0f;
|
||||
actor->uncullZoneScale = 350.0f;
|
||||
actor->uncullZoneDownward = 700.0f;
|
||||
if (CVar_GetS32("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
||||
if (CVarGetInteger("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
||||
&& actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence
|
||||
&& actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning
|
||||
&& (play->sceneNum != SCENE_DDAN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room
|
||||
@@ -2855,7 +2855,7 @@ s32 func_800314B0(PlayState* play, Actor* actor) {
|
||||
s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) {
|
||||
f32 var;
|
||||
|
||||
if (CVar_GetS32("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
||||
if (CVarGetInteger("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room
|
||||
&& actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence
|
||||
&& actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning
|
||||
&& (play->sceneNum != SCENE_DDAN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room
|
||||
@@ -3160,7 +3160,7 @@ int gMapLoading = 0;
|
||||
Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ,
|
||||
s16 rotX, s16 rotY, s16 rotZ, s16 params, s16 canRandomize) {
|
||||
|
||||
uint8_t tryRandomizeEnemy = CVar_GetS32("gRandomizedEnemies", 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2 && canRandomize;
|
||||
uint8_t tryRandomizeEnemy = CVarGetInteger("gRandomizedEnemies", 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2 && canRandomize;
|
||||
|
||||
if (tryRandomizeEnemy) {
|
||||
if (!GetRandomizedEnemy(play, &actorId, &posX, &posY, &posZ, &rotX, &rotY, &rotZ, ¶ms)) {
|
||||
@@ -3252,7 +3252,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
|
||||
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, actorInit->objectId);
|
||||
|
||||
if (objBankIndex < 0 && (!gMapLoading || CVar_GetS32("gRandomizedEnemies", 0))) {
|
||||
if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger("gRandomizedEnemies", 0))) {
|
||||
objBankIndex = 0;
|
||||
}
|
||||
|
||||
@@ -3331,7 +3331,7 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play
|
||||
// Gohma (z_boss_goma.c), the Stalchildren spawner (z_en_encount1.c) and the falling platform spawning Stalfos in
|
||||
// Forest Temple (z_bg_mori_bigst.c) that normally rely on this behaviour are changed when
|
||||
// Enemy Rando is on so they still work properly even without assigning a parent.
|
||||
if (CVar_GetS32("gRandomizedEnemies", 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) {
|
||||
if (CVarGetInteger("gRandomizedEnemies", 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) {
|
||||
return spawnedActor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user