Add Enhancement 3D Dropped Items (#144)

* Add Enhancement 3D Dropped Items  

It will change most of dropped item to there 3D models variant, Exclude Rupee from Hyrule Castle (when you are child and in quest to see Zelda.)

* Fix z_kaleido_scope_PAL.c L and R button color issues

This fix an issue in IF and gDPSetPrimColor for button L & R icon. 
making it with an else to place the on hover and normal color properly in both button so they both have exact same colour

* Fix quite a big logic issue for 3D item drops

In short,case logic required to be different with break; old version make it all fucked up with improper values.

* Clean Const that was present nor not.

* Update z_kaleido_scope_PAL.c

* Update z_kaleido_scope_PAL.c
This commit is contained in:
Baoulettes 2022-04-24 16:50:41 +02:00 committed by GitHub
parent 0ee779f94a
commit b540b7fcfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 293 additions and 46 deletions

View File

@ -73,6 +73,9 @@ namespace Game {
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);
Settings.enhancements.newdrops = stob(Conf[EnhancementSection]["newdrops"]);
CVar_SetS32("gNewDrops", Settings.enhancements.newdrops);
// Audio // Audio
Settings.audio.master = Ship::stof(Conf[AudioSection]["master"]); Settings.audio.master = Ship::stof(Conf[AudioSection]["master"]);
CVar_SetFloat("gGameMasterVolume", Settings.audio.master); CVar_SetFloat("gGameMasterVolume", Settings.audio.master);
@ -178,6 +181,7 @@ 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]["newdrops"] = std::to_string(Settings.enhancements.newdrops);
Conf[EnhancementSection]["visualagony"] = std::to_string(Settings.enhancements.visualagony); 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);

View File

@ -26,6 +26,7 @@ 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 newdrops = false;
bool visualagony = false; bool visualagony = false;
bool mm_bunny_hood = false; bool mm_bunny_hood = false;

View File

@ -431,8 +431,14 @@ namespace SohImGui {
needs_save = true; needs_save = true;
} }
if (ImGui::Checkbox("Enable 3D Dropped items", &Game::Settings.enhancements.newdrops)) {
CVar_SetS32("gNewDrops", Game::Settings.enhancements.newdrops);
needs_save = true;
}
if (ImGui::Checkbox("Dynamic Wallet Icon", &Game::Settings.enhancements.dynamic_wallet_icon)) { if (ImGui::Checkbox("Dynamic Wallet Icon", &Game::Settings.enhancements.dynamic_wallet_icon)) {
CVar_SetS32(const_cast<char*>("gDynamicWalletIcon"), Game::Settings.enhancements.dynamic_wallet_icon); CVar_SetS32(const_cast<char*>("gDynamicWalletIcon"), Game::Settings.enhancements.dynamic_wallet_icon);
needs_save = true; needs_save = true;
} }

View File

@ -25,7 +25,9 @@ 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("gNewDrops", 0);
CVar_RegisterS32("gVisualAgony", 0); CVar_RegisterS32("gVisualAgony", 0);
} }
//void BootCommands_ParseBootArgs(char* str) //void BootCommands_ParseBootArgs(char* str)

View File

@ -5,6 +5,9 @@
#define FLAGS 0 #define FLAGS 0
//Used to force variable to be used in different function, feel free to correct me if you have a better way
static s16 DroppedItemRot = 0;
void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx);
void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx);
@ -355,11 +358,34 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (this->actor.params) { switch (this->actor.params) {
case ITEM00_RUPEE_GREEN: case ITEM00_RUPEE_GREEN:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
yOffset = 50.0f;
shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_RUPEE_BLUE: case ITEM00_RUPEE_BLUE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
yOffset = 50.0f;
shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
}
case ITEM00_RUPEE_RED: case ITEM00_RUPEE_RED:
Actor_SetScale(&this->actor, 0.015f); if (CVar_GetS32("gNewDrops", 0) !=0) {
this->scale = 0.015f; Actor_SetScale(&this->actor, 0.3f);
yOffset = 750.0f; this->scale = 0.3f;
yOffset = 50.0f;
shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.015f);
this->scale = 0.015f;
yOffset = 750.0f;
}
break; break;
case ITEM00_SMALL_KEY: case ITEM00_SMALL_KEY:
this->unk_158 = 0; this->unk_158 = 0;
@ -374,10 +400,18 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->scale = 0.02f; this->scale = 0.02f;
break; break;
case ITEM00_HEART: case ITEM00_HEART:
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); if (CVar_GetS32("gNewDrops", 0) !=0) {
yOffset = 430.0f; this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
Actor_SetScale(&this->actor, 0.02f); yOffset = 25.0f;
this->scale = 0.02f; Actor_SetScale(&this->actor, 0.3f);
this->scale = 0.3f;
shadowScale = 0.5f;
} else {
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
yOffset = 430.0f;
Actor_SetScale(&this->actor, 0.02f);
this->scale = 0.02f;
}
break; break;
case ITEM00_HEART_CONTAINER: case ITEM00_HEART_CONTAINER:
yOffset = 430.0f; yOffset = 430.0f;
@ -386,42 +420,154 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->scale = 0.02f; this->scale = 0.02f;
break; break;
case ITEM00_ARROWS_SINGLE: case ITEM00_ARROWS_SINGLE:
yOffset = 400.0f; if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.02f); Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.02f; this->scale = 0.2f;
break; yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
} else {
yOffset = 400.0f;
Actor_SetScale(&this->actor, 0.02f);
this->scale = 0.02f;
}
break;
case ITEM00_ARROWS_SMALL: case ITEM00_ARROWS_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_ARROWS_MEDIUM: case ITEM00_ARROWS_MEDIUM:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_ARROWS_LARGE: case ITEM00_ARROWS_LARGE:
Actor_SetScale(&this->actor, 0.035f); if (CVar_GetS32("gNewDrops", 0) !=0) {
this->scale = 0.035f; Actor_SetScale(&this->actor, 0.2f);
yOffset = 250.0f; this->scale = 0.2f;
break; yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.035f);
this->scale = 0.035f;
yOffset = 250.0f;
}
break;
case ITEM00_BOMBS_A: case ITEM00_BOMBS_A:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_BOMBS_B: case ITEM00_BOMBS_B:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_NUTS: case ITEM00_NUTS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_STICK: case ITEM00_STICK:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_MAGIC_SMALL: case ITEM00_MAGIC_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_SEEDS: case ITEM00_SEEDS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
Actor_SetScale(&this->actor, 0.2f);
this->scale = 0.2f;
yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
break;
}
case ITEM00_BOMBS_SPECIAL: case ITEM00_BOMBS_SPECIAL:
Actor_SetScale(&this->actor, 0.03f); if (CVar_GetS32("gNewDrops", 0) !=0) {
this->scale = 0.03f; Actor_SetScale(&this->actor, 0.2f);
yOffset = 320.0f; this->scale = 0.2f;
break; yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.03f);
this->scale = 0.03f;
yOffset = 320.0f;
}
break;
case ITEM00_MAGIC_LARGE: case ITEM00_MAGIC_LARGE:
Actor_SetScale(&this->actor, 0.045 - 1e-10); if (CVar_GetS32("gNewDrops", 0) !=0) {
this->scale = 0.045 - 1e-10; Actor_SetScale(&this->actor, 0.2f);
yOffset = 320.0f; this->scale = 0.2f;
break; yOffset = 50.0f;
shadowScale = 0.5f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.045 - 1e-10);
this->scale = 0.045 - 1e-10;
yOffset = 320.0f;
}
break;
case ITEM00_RUPEE_ORANGE: case ITEM00_RUPEE_ORANGE:
Actor_SetScale(&this->actor, 0.045 - 1e-10); if (CVar_GetS32("gNewDrops", 0) !=0) {
this->scale = 0.045 - 1e-10; Actor_SetScale(&this->actor, 0.45f);
yOffset = 750.0f; this->scale = 0.45f;
yOffset = 50.0f;
shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.045 - 1e-10);
this->scale = 0.045 - 1e-10;
yOffset = 750.0f;
}
break; break;
case ITEM00_RUPEE_PURPLE: case ITEM00_RUPEE_PURPLE:
Actor_SetScale(&this->actor, 0.03f); if (CVar_GetS32("gNewDrops", 0) !=0) {
this->scale = 0.03f; Actor_SetScale(&this->actor, 0.4f);
yOffset = 750.0f; this->scale = 0.4f;
yOffset = 50.0f;
shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
} else {
Actor_SetScale(&this->actor, 0.03f);
this->scale = 0.03f;
yOffset = 750.0f;
}
break; break;
case ITEM00_FLEXIBLE: case ITEM00_FLEXIBLE:
yOffset = 500.0f; yOffset = 500.0f;
@ -558,6 +704,19 @@ void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) {
} }
void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) {
if (CVar_GetS32("gNewDrops", 0) !=0) { //set the rotation system on selected model only :)
if ((this->actor.params == ITEM_RUPEE_GOLD) || (this->actor.params == ITEM_RUPEE_PURPLE) ||
(this->actor.params == ITEM00_ARROWS_SINGLE) || (this->actor.params == ITEM00_ARROWS_SMALL) ||
(this->actor.params == ITEM00_ARROWS_MEDIUM) || (this->actor.params == ITEM00_ARROWS_LARGE) ||
(this->actor.params == ITEM00_BOMBS_A) || (this->actor.params == ITEM00_BOMBS_B) ||
(this->actor.params == ITEM00_NUTS) || (this->actor.params == ITEM00_STICK) ||
(this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) ||
(this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL)) {
this->actor.shape.rot.y = DroppedItemRot;
}
}
if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) || if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) ||
(this->actor.params == ITEM00_HEART_PIECE)) { (this->actor.params == ITEM00_HEART_PIECE)) {
this->actor.shape.rot.y += 960; this->actor.shape.rot.y += 960;
@ -731,6 +890,10 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
EnItem00* this = (EnItem00*)thisx; EnItem00* this = (EnItem00*)thisx;
s32 pad; s32 pad;
if (CVar_GetS32("gNewDrops", 0) !=0) { //Update 3D Model rotation on frame update :)
DroppedItemRot += 100;
}
if (this->unk_15A > 0) { if (this->unk_15A > 0) {
this->unk_15A--; this->unk_15A--;
} }
@ -934,15 +1097,35 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnItem00* this = (EnItem00*)thisx; EnItem00* this = (EnItem00*)thisx;
f32 mtxScale; f32 mtxScale;
if (!(this->unk_156 & this->unk_158)) { if (!(this->unk_156 & this->unk_158)) {
switch (this->actor.params) { switch (this->actor.params) {
case ITEM00_RUPEE_GREEN: case ITEM00_RUPEE_GREEN:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_RUPEE_GREEN);
break;
}
case ITEM00_RUPEE_BLUE: case ITEM00_RUPEE_BLUE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_RUPEE_BLUE);
break;
}
case ITEM00_RUPEE_RED: case ITEM00_RUPEE_RED:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_RUPEE_RED);
break;
}
case ITEM00_RUPEE_ORANGE: case ITEM00_RUPEE_ORANGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_RUPEE_GOLD);
break;
}
case ITEM00_RUPEE_PURPLE: case ITEM00_RUPEE_PURPLE:
EnItem00_DrawRupee(this, globalCtx); if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_RUPEE_PURPLE);
} else {
EnItem00_DrawRupee(this, globalCtx);
}
break; break;
case ITEM00_HEART_PIECE: case ITEM00_HEART_PIECE:
EnItem00_DrawHeartPiece(this, globalCtx); EnItem00_DrawHeartPiece(this, globalCtx);
@ -951,34 +1134,85 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnItem00_DrawHeartContainer(this, globalCtx); EnItem00_DrawHeartContainer(this, globalCtx);
break; break;
case ITEM00_HEART: case ITEM00_HEART:
if (this->unk_15A < 0) { if (CVar_GetS32("gNewDrops", 0) !=0) {
if (this->unk_15A == -1) { GetItem_Draw(globalCtx, GID_HEART);
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { break;
this->actor.objBankIndex = bankIndex; } else {
Actor_SetObjectDependency(globalCtx, &this->actor); if (this->unk_15A < 0) {
this->unk_15A = -2; if (this->unk_15A == -1) {
} s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
} else {
mtxScale = 16.0f; if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); this->actor.objBankIndex = bankIndex;
GetItem_Draw(globalCtx, GID_HEART); Actor_SetObjectDependency(globalCtx, &this->actor);
} this->unk_15A = -2;
break; }
} else {
mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
GetItem_Draw(globalCtx, GID_HEART);
}
break;
}
} }
case ITEM00_BOMBS_A: case ITEM00_BOMBS_A:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_BOMB);
break;
}
case ITEM00_BOMBS_B: case ITEM00_BOMBS_B:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_BOMB);
break;
}
case ITEM00_BOMBS_SPECIAL: case ITEM00_BOMBS_SPECIAL:
case ITEM00_ARROWS_SINGLE: case ITEM00_ARROWS_SINGLE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
break;
}
case ITEM00_ARROWS_SMALL: case ITEM00_ARROWS_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_ARROWS_SMALL);
break;
}
case ITEM00_ARROWS_MEDIUM: case ITEM00_ARROWS_MEDIUM:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_ARROWS_MEDIUM);
break;
}
case ITEM00_ARROWS_LARGE: case ITEM00_ARROWS_LARGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_ARROWS_LARGE);
break;
}
case ITEM00_NUTS: case ITEM00_NUTS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_NUTS);
break;
}
case ITEM00_STICK: case ITEM00_STICK:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_STICK);
break;
}
case ITEM00_MAGIC_LARGE: case ITEM00_MAGIC_LARGE:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_MAGIC_LARGE);
break;
}
case ITEM00_MAGIC_SMALL: case ITEM00_MAGIC_SMALL:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_MAGIC_SMALL);
break;
}
case ITEM00_SEEDS: case ITEM00_SEEDS:
if (CVar_GetS32("gNewDrops", 0) !=0) {
GetItem_Draw(globalCtx, GID_SEEDS);
break;
}
case ITEM00_SMALL_KEY: case ITEM00_SMALL_KEY:
EnItem00_DrawCollectible(this, globalCtx); EnItem00_DrawCollectible(this, globalCtx);
break; break;