Added Chests of Agony (#1885)

This commit is contained in:
Dakota Brown 2022-11-06 14:07:58 -07:00 committed by GitHub
parent 11497c393d
commit 328ff0e8c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 10 deletions

View File

@ -147,6 +147,8 @@ namespace GameMenuBar {
CVar_SetS32("gFastChests", 0); CVar_SetS32("gFastChests", 0);
// Chest size & texture matches contents // Chest size & texture matches contents
CVar_SetS32("gChestSizeAndTextureMatchesContents", 0); CVar_SetS32("gChestSizeAndTextureMatchesContents", 0);
// Chest size & texture matches contents only with agony
CVar_SetS32("gChestSizeDependsStoneOfAgony", 0);
// Fast Drops // Fast Drops
CVar_SetS32("gFastDrops", 0); CVar_SetS32("gFastDrops", 0);
// Better Owl // Better Owl
@ -776,7 +778,6 @@ namespace GameMenuBar {
UIWidgets::Tooltip("Kick open every chest"); UIWidgets::Tooltip("Kick open every chest");
UIWidgets::PaddedText("Chest size & texture matches contents", true, false); UIWidgets::PaddedText("Chest size & texture matches contents", true, false);
const char* chestSizeAndTextureMatchesContentsOptions[4] = { "Disabled", "Both", "Texture Only", "Size Only"}; const char* chestSizeAndTextureMatchesContentsOptions[4] = { "Disabled", "Both", "Texture Only", "Size Only"};
UIWidgets::EnhancementCombobox("gChestSizeAndTextureMatchesContents", chestSizeAndTextureMatchesContentsOptions, 4, 0);
UIWidgets::Tooltip( UIWidgets::Tooltip(
"Chest sizes and textures are changed to help identify the item inside.\n" "Chest sizes and textures are changed to help identify the item inside.\n"
" - Major items: Large gold chests\n" " - Major items: Large gold chests\n"
@ -786,6 +787,15 @@ namespace GameMenuBar {
" - Boss keys: Vanilla size and texture\n" " - Boss keys: Vanilla size and texture\n"
" - Skulltula Tokens: Small skulltula chest\n" " - Skulltula Tokens: Small skulltula chest\n"
); );
if (UIWidgets::EnhancementCombobox("gChestSizeAndTextureMatchesContents", chestSizeAndTextureMatchesContentsOptions, 4, 0)) {
if (CVar_GetS32("gChestSizeAndTextureMatchesContents", 0) == 0) {
CVar_SetS32("gChestSizeDependsStoneOfAgony", 0);
}
}
if (CVar_GetS32("gChestSizeAndTextureMatchesContents", 0) > 0) {
UIWidgets::PaddedEnhancementCheckbox("Chests of Agony", "gChestSizeDependsStoneOfAgony", true, false);
UIWidgets::Tooltip("Only change the size/texture of chests if you have the Stone of Agony.");
}
UIWidgets::PaddedEnhancementCheckbox("Skip Pickup Messages", "gFastDrops", true, false); UIWidgets::PaddedEnhancementCheckbox("Skip Pickup Messages", "gFastDrops", true, false);
UIWidgets::Tooltip("Skip pickup messages for new consumable items and bottle swipes"); UIWidgets::Tooltip("Skip pickup messages for new consumable items and bottle swipes");
UIWidgets::PaddedEnhancementCheckbox("Ask to Equip New Items", "gAskToEquip", true, false); UIWidgets::PaddedEnhancementCheckbox("Ask to Equip New Items", "gAskToEquip", true, false);
@ -1289,11 +1299,13 @@ namespace GameMenuBar {
} }
UIWidgets::EnhancementCheckbox("Disable LOD", "gDisableLOD"); UIWidgets::EnhancementCheckbox("Disable LOD", "gDisableLOD");
UIWidgets::Tooltip("Turns off the Level of Detail setting, making models use their higher-poly variants at any distance"); UIWidgets::Tooltip("Turns off the Level of Detail setting, making models use their higher-poly variants at any distance");
UIWidgets::PaddedEnhancementCheckbox("Disable Draw Distance", "gDisableDrawDistance", true, false); if (UIWidgets::PaddedEnhancementCheckbox("Disable Draw Distance", "gDisableDrawDistance", true, false)) {
UIWidgets::Tooltip("Turns off the objects draw distance, making objects being visible from a longer range");
if (CVar_GetS32("gDisableDrawDistance", 0) == 0) { if (CVar_GetS32("gDisableDrawDistance", 0) == 0) {
CVar_SetS32("gDisableKokiriDrawDistance", 0); CVar_SetS32("gDisableKokiriDrawDistance", 0);
} else if (CVar_GetS32("gDisableDrawDistance", 0) == 1) { }
}
UIWidgets::Tooltip("Turns off the objects draw distance, making objects being visible from a longer range");
if (CVar_GetS32("gDisableDrawDistance", 0) == 1) {
UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance", true, false); UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance", true, false);
UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance"); UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance");
} }

View File

@ -227,7 +227,8 @@ namespace UIWidgets {
} }
} }
void EnhancementCombobox(const char* name, const char* ComboArray[], size_t arraySize, uint8_t FirstTimeValue) { bool EnhancementCombobox(const char* name, const char* ComboArray[], size_t arraySize, uint8_t FirstTimeValue) {
bool changed = false;
if (FirstTimeValue <= 0) { if (FirstTimeValue <= 0) {
FirstTimeValue = 0; FirstTimeValue = 0;
} }
@ -240,12 +241,14 @@ namespace UIWidgets {
if (ImGui::Selectable(ComboArray[i], i == selected)) { if (ImGui::Selectable(ComboArray[i], i == selected)) {
CVar_SetS32(name, i); CVar_SetS32(name, i);
selected = i; selected = i;
changed = true;
SohImGui::RequestCvarSaveOnNextTick(); SohImGui::RequestCvarSaveOnNextTick();
} }
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
} }
return changed;
} }
void PaddedText(const char* text, bool padTop, bool padBottom) { void PaddedText(const char* text, bool padTop, bool padBottom) {

View File

@ -36,7 +36,7 @@ namespace UIWidgets {
bool EnhancementCheckbox(const char* text, const char* cvarName, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross); bool EnhancementCheckbox(const char* text, const char* cvarName, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross);
bool PaddedEnhancementCheckbox(const char* text, const char* cvarName, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross); bool PaddedEnhancementCheckbox(const char* text, const char* cvarName, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross);
void EnhancementCombo(const std::string& name, const char* cvarName, const std::vector<std::string>& items, int defaultValue = 0); void EnhancementCombo(const std::string& name, const char* cvarName, const std::vector<std::string>& items, int defaultValue = 0);
void EnhancementCombobox(const char* name, const char* ComboArray[], size_t arraySize, uint8_t FirstTimeValue); bool EnhancementCombobox(const char* name, const char* ComboArray[], size_t arraySize, uint8_t FirstTimeValue);
void PaddedText(const char* text, bool padTop = true, bool padBottom = true); void PaddedText(const char* text, bool padTop = true, bool padBottom = true);
void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false); void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false);
void PaddedEnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false, bool padTop = true, bool padBottom = true); void PaddedEnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false, bool padTop = true, bool padBottom = true);

View File

@ -619,9 +619,11 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) { void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
EnBox_CreateExtraChestTextures(); EnBox_CreateExtraChestTextures();
int cvar = CVar_GetS32("gChestSizeAndTextureMatchesContents", 0); int cvar = CVar_GetS32("gChestSizeAndTextureMatchesContents", 0);
int agonyCVar = CVar_GetS32("gChestSizeDependsStoneOfAgony", 0);
int stoneCheck = CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY);
GetItemCategory getItemCategory; GetItemCategory getItemCategory;
if (play->sceneNum != SCENE_TAKARAYA && cvar > 0) { if (play->sceneNum != SCENE_TAKARAYA && cvar > 0 && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
getItemCategory = this->getItemEntry.getItemCategory; getItemCategory = this->getItemEntry.getItemCategory;
// If they don't have bombchu's yet consider the bombchu item major // If they don't have bombchu's yet consider the bombchu item major
if (this->getItemEntry.gid == GID_BOMBCHU && INV_CONTENT(ITEM_BOMBCHU) != ITEM_BOMBCHU) { if (this->getItemEntry.gid == GID_BOMBCHU && INV_CONTENT(ITEM_BOMBCHU) != ITEM_BOMBCHU) {
@ -637,7 +639,7 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
} }
} }
if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 3)) { if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 3) && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
switch (getItemCategory) { switch (getItemCategory) {
case ITEM_CATEGORY_JUNK: case ITEM_CATEGORY_JUNK:
case ITEM_CATEGORY_SMALL_KEY: case ITEM_CATEGORY_SMALL_KEY:
@ -665,7 +667,7 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) {
} }
} }
if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 2)) { if (play->sceneNum != SCENE_TAKARAYA && (cvar == 1 || cvar == 2) && ((agonyCVar > 0 && stoneCheck) | agonyCVar == 0)) {
switch (getItemCategory) { switch (getItemCategory) {
case ITEM_CATEGORY_MAJOR: case ITEM_CATEGORY_MAJOR:
this->boxBodyDL = gGoldTreasureChestChestFrontDL; this->boxBodyDL = gGoldTreasureChestChestFrontDL;