mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 08:38:52 -05:00
Merge branch 'develop-zhora' of https://github.com/HarbourMasters/Shipwright into custom-messages
This commit is contained in:
commit
dca922ade8
12
.gitignore
vendored
12
.gitignore
vendored
@ -405,4 +405,14 @@ tags
|
||||
oot.otr
|
||||
*.sav
|
||||
shipofharkinian.ini
|
||||
shipofharkinian.json
|
||||
shipofharkinian.json
|
||||
|
||||
# Xcode
|
||||
xcuserdata/
|
||||
*.xcconfig
|
||||
*.xcodeproj/*
|
||||
!*.xcodeproj/project.pbxproj
|
||||
!*.xcodeproj/xcshareddata/
|
||||
!*.xcworkspace/contents.xcworkspacedata
|
||||
/*.gcno
|
||||
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||
|
@ -5,6 +5,7 @@ import shutil
|
||||
from rom_info import Z64Rom
|
||||
import rom_chooser
|
||||
import struct
|
||||
import subprocess
|
||||
|
||||
def BuildOTR(xmlPath, rom):
|
||||
shutil.copytree("assets", "Extract/assets")
|
||||
@ -13,11 +14,13 @@ def BuildOTR(xmlPath, rom):
|
||||
with open("Extract/version", "wb") as f:
|
||||
f.write(struct.pack('<L', checksum))
|
||||
|
||||
execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
|
||||
execStr += " ed -i %s -b %s -fl CFG/filelists -o placeholder -osf placeholder -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, rom)
|
||||
zapd_exe = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
|
||||
exec_cmd = [zapd_exe, "ed", "-i", xmlPath, "-b", rom, "-fl", "CFG/filelists",
|
||||
"-o", "placeholder", "-osf", "placeholder", "-gsf", "1",
|
||||
"-rconf", "CFG/Config.xml", "-se", "OTR"]
|
||||
|
||||
print(execStr)
|
||||
exitValue = os.system(execStr)
|
||||
print(exec_cmd)
|
||||
exitValue = subprocess.call(exec_cmd)
|
||||
if exitValue != 0:
|
||||
print("\n")
|
||||
print("Error when building the OTR file...", file=os.sys.stderr)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "Window.h"
|
||||
#include "Controller.h"
|
||||
#include "DisconnectedController.h"
|
||||
#include "VirtualController.h"
|
||||
#include "KeyboardController.h"
|
||||
#include "SDLController.h"
|
||||
#include <Utils/StringHelper.h>
|
||||
@ -27,8 +27,9 @@ void Ship::ControlDeck::ScanPhysicalDevices() {
|
||||
}
|
||||
}
|
||||
|
||||
physicalDevices.push_back(std::make_shared<VirtualController>("Auto", "Auto", true));
|
||||
physicalDevices.push_back(std::make_shared<KeyboardController>());
|
||||
physicalDevices.push_back(std::make_shared<DisconnectedController>());
|
||||
physicalDevices.push_back(std::make_shared<VirtualController>("Disconnected", "None", false));
|
||||
|
||||
for (const auto& device : physicalDevices) {
|
||||
for (int i = 0; i < MAXCONTROLLERS; i++) {
|
||||
@ -51,7 +52,14 @@ void Ship::ControlDeck::SetPhysicalDevice(int slot, int deviceSlot) {
|
||||
|
||||
void Ship::ControlDeck::WriteToPad(OSContPad* pad) const {
|
||||
for (size_t i = 0; i < virtualDevices.size(); i++) {
|
||||
physicalDevices[virtualDevices[i]]->Read(&pad[i], i);
|
||||
const std::shared_ptr<Controller> backend = physicalDevices[virtualDevices[i]];
|
||||
if (backend->GetGuid() == "Auto") {
|
||||
for (const auto& device : physicalDevices) {
|
||||
device->Read(&pad[i], i);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
backend->Read(&pad[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace Ship {
|
||||
|
||||
Controller::Controller() : isRumbling(false), wStickX(0), wStickY(0), wGyroX(0), wGyroY(0), dwPressedButtons(0){
|
||||
Controller::Controller() : isRumbling(false), wStickX(0), wStickY(0), wGyroX(0), wGyroY(0), wCamX(0), wCamY(0), dwPressedButtons(0){
|
||||
Attachment = nullptr;
|
||||
profiles.resize(MAXCONTROLLERS);
|
||||
for(int slot = 0; slot < MAXCONTROLLERS; slot++) {
|
||||
|
@ -844,6 +844,8 @@ namespace SohImGui {
|
||||
EnhancementCheckbox("D-pad Support for Browsing Shop Items", "gDpadShop");
|
||||
EnhancementCheckbox("D-pad as Equip Items", "gDpadEquips");
|
||||
Tooltip("Allows the D-pad to be used as extra C buttons");
|
||||
EnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
|
||||
Tooltip("Speak to Navi with L but enter first-person camera with C-Up");
|
||||
ImGui::Separator();
|
||||
|
||||
EnhancementCheckbox("Show Inputs", "gInputEnabled");
|
||||
@ -973,7 +975,12 @@ namespace SohImGui {
|
||||
Tooltip("The default response to Kaepora Gaebora is\nalways that you understood what he said");
|
||||
EnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback");
|
||||
Tooltip("Skip the part where the Ocarina playback is called when you play\na song");
|
||||
|
||||
EnhancementCheckbox("Prevent Dropped Ocarina Inputs", "gDpadNoDropOcarinaInput");
|
||||
Tooltip("Prevent dropping inputs when playing the ocarina quickly");
|
||||
EnhancementCheckbox("Instant Putaway", "gInstantPutaway");
|
||||
Tooltip("Allow Link to put items away without having to wait around");
|
||||
EnhancementCheckbox("Mask Select in Inventory", "gMaskSelect");
|
||||
Tooltip("After completing the mask trading sub-quest,\npress A and any direction on the mask slot to change masks");
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
@ -1014,6 +1021,8 @@ namespace SohImGui {
|
||||
Tooltip("Disables random drops, except from the Goron Pot, Dampe, and bosses");
|
||||
EnhancementCheckbox("No Heart Drops", "gNoHeartDrops");
|
||||
Tooltip("Disables heart drops, but not heart placements, like from a Deku Scrub running off\nThis simulates Hero Mode from other games in the series");
|
||||
EnhancementCheckbox("Always Win Goron Pot", "gGoronPot");
|
||||
Tooltip("Always get the heart piece/purple rupee from the spinning Goron pot");
|
||||
|
||||
if (ImGui::BeginMenu("Potion Values"))
|
||||
{
|
||||
@ -1192,6 +1201,14 @@ namespace SohImGui {
|
||||
Tooltip("Correctly centers the Navi text prompt on the HUD's C-Up button");
|
||||
EnhancementCheckbox("Fix Anubis fireballs", "gAnubisFix");
|
||||
Tooltip("Make Anubis fireballs do fire damage when reflected\nback at them with the Mirror Shield");
|
||||
EnhancementCheckbox("Fix Megaton Hammer crouch stab", "gCrouchStabHammerFix");
|
||||
Tooltip("Make the Megaton Hammer's crouch stab able to destroy\nrocks without first swinging it normally");
|
||||
if (CVar_GetS32("gCrouchStabHammerFix", 0) == 0) {
|
||||
CVar_SetS32("gCrouchStabFix", 0);
|
||||
} else {
|
||||
EnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix");
|
||||
Tooltip("Make crouch stabbing always do the same damage as a regular slash");
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
@ -1239,6 +1256,15 @@ namespace SohImGui {
|
||||
|
||||
if (ImGui::SliderInt("##FPSInterpolation", &val, 20, 250, "", ImGuiSliderFlags_AlwaysClamp))
|
||||
{
|
||||
if (val > 250)
|
||||
{
|
||||
val = 250;
|
||||
}
|
||||
else if (val < 20)
|
||||
{
|
||||
val = 20;
|
||||
}
|
||||
|
||||
CVar_SetS32(fps_cvar, val);
|
||||
needs_save = true;
|
||||
}
|
||||
@ -1335,10 +1361,20 @@ namespace SohImGui {
|
||||
EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled");
|
||||
Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip with L + D-pad Right,\nand open the debug menu with L on the pause screen");
|
||||
EnhancementCheckbox("Fast File Select", "gSkipLogoTitle");
|
||||
Tooltip("Load the game to the selected slot below upon launch\nUse slot number 4 to load directly into the game's internal Map Select\n(Does not require the Debug Menu, but you will be unable to save there\nYou can also load the Map Select with OoT Debug Mode + slot 0)\nWith slot 0 you can directly go to the File Select menu\nAttention: loading an empty save file will result in a crash");
|
||||
Tooltip("Load the game to the selected menu or file\n\"Zelda Map Select\" require debug mode else you will fallback to File choose menu\nUsing a file number that don't have save will create a save file only\nif you toggle on \"Create a new save if none ?\" else it will bring you to the\nFile choose menu");
|
||||
if (CVar_GetS32("gSkipLogoTitle", 0)) {
|
||||
EnhancementSliderInt("Loading %d", "##SaveFileID", "gSaveFileID", 0, 4, "");
|
||||
}
|
||||
const char* FastFileSelect[5] = {
|
||||
"File N.1",
|
||||
"File N.2",
|
||||
"File N.3",
|
||||
"File select",
|
||||
"Zelda Map Select (require OoT Debug Mode)"
|
||||
};
|
||||
ImGui::Text("Loading :");
|
||||
EnhancementCombobox("gSaveFileID", FastFileSelect, 5, 0);
|
||||
EnhancementCheckbox("Create a new save if none", "gCreateNewSave");
|
||||
Tooltip("Enable the creation of a new save file\nif none exist in the File number selected\nNo file name will be assigned please do in Save editor once you see the first text\nelse your save file name will be named \"00000000\"\nIf disabled you will fall back in File select menu");
|
||||
};
|
||||
ImGui::Separator();
|
||||
EnhancementCheckbox("Stats", "gStatsEnabled");
|
||||
Tooltip("Shows the stats window, with your FPS and frametimes,\nand the OS you're playing on");
|
||||
|
@ -26,7 +26,7 @@ namespace Ship {
|
||||
|
||||
float size = 40;
|
||||
bool readingMode = BtnReading == n64Btn;
|
||||
bool disabled = BtnReading != -1 && !readingMode || !backend->Connected();
|
||||
bool disabled = (BtnReading != -1 && !readingMode) || !backend->Connected() || backend->GetGuid() == "Auto";
|
||||
ImVec2 len = ImGui::CalcTextSize(label);
|
||||
ImVec2 pos = ImGui::GetCursorPos();
|
||||
ImGui::SetCursorPosY(pos.y + len.y / 4);
|
||||
@ -90,7 +90,7 @@ namespace Ship {
|
||||
std::shared_ptr<Controller> Backend = devices[vDevices[CurrentPort]];
|
||||
DeviceProfile& profile =Backend->profiles[CurrentPort];
|
||||
float sensitivity = profile.Thresholds[SENSITIVITY];
|
||||
bool IsKeyboard = Backend->GetGuid() == "Keyboard" || !Backend->Connected();
|
||||
bool IsKeyboard = Backend->GetGuid() == "Keyboard" || Backend->GetGuid() == "Auto" || !Backend->Connected();
|
||||
const char* ControllerName = Backend->GetControllerName();
|
||||
|
||||
if (ControllerName != nullptr && ImGui::BeginCombo("##ControllerEntries", ControllerName)) {
|
||||
|
@ -4,18 +4,20 @@
|
||||
|
||||
#include "Controller.h"
|
||||
|
||||
class DisconnectedController final : public Ship::Controller {
|
||||
class VirtualController final : public Ship::Controller {
|
||||
public:
|
||||
DisconnectedController() {
|
||||
GUID = "Disconnected";
|
||||
VirtualController(const std::string& CUID, const std::string& KeyName, bool Connected) {
|
||||
GUID = CUID;
|
||||
isConnected = Connected;
|
||||
ButtonName = KeyName;
|
||||
}
|
||||
|
||||
std::map<std::vector<std::string>, int32_t> ReadButtonPress();
|
||||
void ReadFromSource(int32_t slot) override {}
|
||||
const char* GetControllerName() override { return "Disconnected"; }
|
||||
const char* GetButtonName(int slot, int n64Button) override { return "None"; }
|
||||
const char* GetControllerName() override { return GUID.c_str(); }
|
||||
const char* GetButtonName(int slot, int n64Button) override { return ButtonName.c_str(); }
|
||||
void WriteToSource(int32_t slot, ControllerCallback* controller) override { }
|
||||
bool Connected() const override { return false; }
|
||||
bool Connected() const override { return isConnected; }
|
||||
bool CanRumble() const override { return false; }
|
||||
bool CanGyro() const override { return false; }
|
||||
|
||||
@ -25,6 +27,8 @@ public:
|
||||
std::optional<std::string> GetPadConfSection() { return "Unk"; }
|
||||
void CreateDefaultBinding(int32_t slot) override {}
|
||||
protected:
|
||||
std::string ButtonName;
|
||||
bool isConnected = false;
|
||||
std::string GetControllerType() { return "Unk"; }
|
||||
std::string GetConfSection() { return "Unk"; }
|
||||
std::string GetBindingConfSection() { return "Unk"; }
|
@ -344,6 +344,7 @@
|
||||
<ClCompile Include="SDLController.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="VirtualController.h" />
|
||||
<ClInclude Include="Lib\Mercury\Mercury.h" />
|
||||
<ClInclude Include="Lib\nlohmann\json.hpp" />
|
||||
<ClInclude Include="abi.h" />
|
||||
@ -352,7 +353,6 @@
|
||||
<ClInclude Include="Blob.h" />
|
||||
<ClInclude Include="ControlDeck.h" />
|
||||
<ClInclude Include="Cvar.h" />
|
||||
<ClInclude Include="DisconnectedController.h" />
|
||||
<ClInclude Include="Environment.h" />
|
||||
<ClInclude Include="Factories\AudioFactory.h" />
|
||||
<ClInclude Include="InputEditor.h" />
|
||||
|
@ -674,14 +674,14 @@
|
||||
<ClInclude Include="ControlDeck.h">
|
||||
<Filter>Source Files\Controller</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DisconnectedController.h">
|
||||
<Filter>Source Files\Controller</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Lib\nlohmann\json.hpp">
|
||||
<Filter>Source Files\Lib\nlohmann</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Lib\Mercury\Mercury.h">
|
||||
<Filter>Source Files\Lib\Mercury</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="VirtualController.h">
|
||||
<Filter>Source Files\Controller</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -25,8 +25,8 @@ typedef enum {
|
||||
typedef enum {
|
||||
/* 0 */ TEXTBOX_POS_VARIABLE,
|
||||
/* 1 */ TEXTBOX_POS_TOP,
|
||||
/* 2 */ TEXTBOX_POS_BOTTOM,
|
||||
/* 3 */ TEXTBOX_POS_MIDDLE
|
||||
/* 2 */ TEXTBOX_POS_MIDDLE,
|
||||
/* 3 */ TEXTBOX_POS_BOTTOM
|
||||
} TextBoxPosition;
|
||||
|
||||
typedef struct {
|
||||
|
36
soh/macosx/Xcode-Info.plist
Normal file
36
soh/macosx/Xcode-Info.plist
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string></string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string></string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>3.0.0</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>soh</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Ship of Harkinian</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>RACHAEL ALFA</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright 2022 HarbourMasters.</string>
|
||||
</dict>
|
||||
</plist>
|
1019
soh/macosx/otr-outputs.xcfilelist
Normal file
1019
soh/macosx/otr-outputs.xcfilelist
Normal file
File diff suppressed because it is too large
Load Diff
7152
soh/soh.xcodeproj/project.pbxproj
Normal file
7152
soh/soh.xcodeproj/project.pbxproj
Normal file
File diff suppressed because it is too large
Load Diff
7
soh/soh.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
soh/soh.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
@ -22,28 +22,9 @@ static BootCommand sCommands[] = { { "--skiplogo", BootCommands_Command_SkipLogo
|
||||
|
||||
void BootCommands_Init()
|
||||
{
|
||||
CVar_RegisterS32("gDisableLOD", 0);
|
||||
CVar_RegisterS32("gDebugEnabled", 0);
|
||||
CVar_RegisterS32("gPauseLiveLink", 0);
|
||||
CVar_RegisterS32("gMinimalUI", 0);
|
||||
CVar_RegisterS32("gRedGanonBlood", 0);
|
||||
CVar_RegisterS32("gHoverFishing", 0);
|
||||
CVar_RegisterS32("gN64WeirdFrames", 0);
|
||||
CVar_RegisterS32("gBombchusOOB", 0);
|
||||
CVar_RegisterS32("gUniformLR", 0);
|
||||
CVar_RegisterS32("gTwoHandedIdle", 0);
|
||||
CVar_RegisterS32("gDekuNutUpgradeFix", 0);
|
||||
CVar_RegisterS32("gNaviTextFix", 0);
|
||||
CVar_RegisterS32("gNewDrops", 0);
|
||||
CVar_RegisterS32("gVisualAgony", 0);
|
||||
CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French
|
||||
CVar_RegisterS32("gForgeTime", 3);
|
||||
CVar_RegisterS32("gGravediggingTourFix", 1);
|
||||
CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom
|
||||
CVar_RegisterS32("gUseNaviCol", 0);
|
||||
CVar_RegisterS32("gUseTunicsCol", 0);
|
||||
CVar_RegisterS32("gGuardVision", 0);
|
||||
CVar_RegisterS32("gTimeFlowFileSelect", 0);
|
||||
}
|
||||
|
||||
//void BootCommands_ParseBootArgs(char* str)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "CosmeticsEditor.h"
|
||||
#include "../../util.h"
|
||||
#include "../libultraship/ImGuiImpl.h"
|
||||
#include "GameSettings.h"
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
@ -97,6 +98,50 @@ const char* RainbowColorCvarList[] = {
|
||||
"gCCFileChoosePrim", "gCCFileChooseTextPrim", "gCCEquipmentsPrim", "gCCItemsPrim",
|
||||
"gCCMapsPrim", "gCCQuestsPrim", "gCCSavePrim", "gCCGameoverPrim",
|
||||
};
|
||||
const char* MarginCvarList[] {
|
||||
"gHearts", "gMagicBar", "gVSOA", "gBBtn", "gABtn", "gStartBtn",
|
||||
"gCBtnU", "gCBtnD", "gCBtnL", "gCBtnR", "gDPad", "gMinimap",
|
||||
"gSKC", "gRC", "gCarrots", "gTimers", "gAS", "gTCM", "gTCB"
|
||||
};
|
||||
|
||||
void SetMarginAll(const char* ButtonName, bool SetActivated) {
|
||||
if (ImGui::Button(ButtonName)) {
|
||||
u8 arrayLength = sizeof(MarginCvarList) / sizeof(*MarginCvarList);
|
||||
//MarginCvarNonAnchor is an array that list every element that has No anchor by default, because if that the case this function will not touch it with pose type 0.
|
||||
const char* MarginCvarNonAnchor[] { "gCarrots", "gTimers", "gAS", "gTCM","gTCB" };
|
||||
u8 arrayLengthNonMargin = sizeof(MarginCvarNonAnchor) / sizeof(*MarginCvarNonAnchor);
|
||||
for (u8 s = 0; s < arrayLength; s++) {
|
||||
std::string cvarName = MarginCvarList[s];
|
||||
std::string cvarPosType = cvarName+"PosType";
|
||||
std::string cvarNameMargins = cvarName+"UseMargins";
|
||||
if (CVar_GetS32(cvarPosType.c_str(),0) <= 2 && SetActivated) { //Our element is not Hidden or Non anchor
|
||||
for(int i = 0; i < arrayLengthNonMargin; i++){
|
||||
if(MarginCvarNonAnchor[i] == cvarName && CVar_GetS32(cvarPosType.c_str(),0) == 0){ //Our element is both in original position and do not have anchor by default so we skip it.
|
||||
CVar_SetS32(cvarNameMargins.c_str(), false); //force set off
|
||||
} else if(MarginCvarNonAnchor[i] == cvarName && CVar_GetS32(cvarPosType.c_str(),0) != 0){ //Our element is not in original position regarless it has no anchor by default since player made it anchored we can toggle margins
|
||||
CVar_SetS32(cvarNameMargins.c_str(), SetActivated);
|
||||
} else if(MarginCvarNonAnchor[i] != cvarName){ //Our elements has an anchor by default so regarless of it's position right now that okay to toggle margins.
|
||||
CVar_SetS32(cvarNameMargins.c_str(), SetActivated);
|
||||
}
|
||||
}
|
||||
} else { //Since the user requested to turn all margin off no need to do any check there.
|
||||
CVar_SetS32(cvarNameMargins.c_str(), SetActivated);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void ResetPositionAll() {
|
||||
if (ImGui::Button("Reset all positions")) {
|
||||
u8 arrayLength = sizeof(MarginCvarList) / sizeof(*MarginCvarList);
|
||||
for (u8 s = 0; s < arrayLength; s++) {
|
||||
std::string cvarName = MarginCvarList[s];
|
||||
std::string cvarPosType = cvarName+"PosType";
|
||||
std::string cvarNameMargins = cvarName+"UseMargins";
|
||||
CVar_SetS32(cvarPosType.c_str(), 0);
|
||||
CVar_SetS32(cvarNameMargins.c_str(), false); //Turn margin off to everythings as that original position.
|
||||
}
|
||||
}
|
||||
}
|
||||
void LoadRainbowColor(bool& open) {
|
||||
u8 arrayLength = sizeof(RainbowColorCvarList) / sizeof(*RainbowColorCvarList);
|
||||
for (u8 s = 0; s < arrayLength; s++) {
|
||||
@ -140,6 +185,7 @@ void LoadRainbowColor(bool& open) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Table_InitHeader(bool has_header = true) {
|
||||
if (has_header) {
|
||||
ImGui::TableHeadersRow();
|
||||
@ -147,6 +193,7 @@ void Table_InitHeader(bool has_header = true) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::AlignTextToFramePadding(); //This is to adjust Vertical pos of item in a cell to be normlized.
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 2);
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
}
|
||||
void Table_NextCol() {
|
||||
@ -160,8 +207,10 @@ void Table_NextLine() {
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
}
|
||||
|
||||
void Draw_HelpIcon(const std::string& helptext, bool sameline = true, int Pos = 0) {
|
||||
// place the ? button to the most of the right side of the cell it is using.
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x-60);
|
||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 15);
|
||||
ImGui::SmallButton("?");
|
||||
SohImGui::Tooltip(helptext.c_str());
|
||||
@ -169,6 +218,7 @@ void Draw_HelpIcon(const std::string& helptext, bool sameline = true, int Pos =
|
||||
//I do not use ImGui::SameLine(); because it make some element vanish.
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() - 22);
|
||||
}
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
}
|
||||
void Draw_Npcs(){
|
||||
SohImGui::EnhancementCheckbox("Custom colors for Navi", "gUseNaviCol");
|
||||
@ -376,10 +426,18 @@ void Draw_Placements(){
|
||||
if (ImGui::BeginTable("tableMargins", 1, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
|
||||
ImGui::TableSetupColumn("General margins settings", ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort, TablesCellsWidth);
|
||||
Table_InitHeader();
|
||||
SohImGui::EnhancementSliderInt("Top : %dx", "##UIMARGINT", "gHUDMargin_T", (ImGui::GetWindowViewport()->Size.y/2)*-1, 25, "");
|
||||
SohImGui::EnhancementSliderInt("Left: %dx", "##UIMARGINL", "gHUDMargin_L", -25, ImGui::GetWindowViewport()->Size.x, "");
|
||||
SohImGui::EnhancementSliderInt("Right: %dx", "##UIMARGINR", "gHUDMargin_R", (ImGui::GetWindowViewport()->Size.x)*-1, 25, "");
|
||||
SohImGui::EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", "gHUDMargin_B", (ImGui::GetWindowViewport()->Size.y/2)*-1, 25, "");
|
||||
SohImGui::EnhancementSliderInt("Top : %dx", "##UIMARGINT", "gHUDMargin_T", (ImGui::GetWindowViewport()->Size.y/2)*-1, 25, "", 0, true);
|
||||
SohImGui::EnhancementSliderInt("Left: %dx", "##UIMARGINL", "gHUDMargin_L", -25, ImGui::GetWindowViewport()->Size.x, "", 0, true);
|
||||
SohImGui::EnhancementSliderInt("Right: %dx", "##UIMARGINR", "gHUDMargin_R", (ImGui::GetWindowViewport()->Size.x)*-1, 25, "", 0, true);
|
||||
SohImGui::EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", "gHUDMargin_B", (ImGui::GetWindowViewport()->Size.y/2)*-1, 25, "", 0, true);
|
||||
SetMarginAll("All margins on",true);
|
||||
SohImGui::Tooltip("Set most of the element to use margin\nSome elements with default position will not be affected\nElements without Archor or Hidden will not be turned on");
|
||||
ImGui::SameLine();
|
||||
SetMarginAll("All margins off",false);
|
||||
SohImGui::Tooltip("Set all of the element to not use margin");
|
||||
ImGui::SameLine();
|
||||
ResetPositionAll();
|
||||
SohImGui::Tooltip("Revert every element to use their original position and no margins");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
}
|
||||
@ -399,9 +457,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gHeartsCountPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##HeartCountPosY", "gHeartsPosY", -22, ImGui::GetWindowViewport()->Size.y, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##HeartCountPosY", "gHeartsPosY", -22, ImGui::GetWindowViewport()->Size.y, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##HeartCountPosX", "gHeartsPosX", -25, ImGui::GetWindowViewport()->Size.x, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##HeartCountPosX", "gHeartsPosX", -25, ImGui::GetWindowViewport()->Size.x, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -423,9 +481,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gMagicBarPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##MagicBarPosY", "gMagicBarPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##MagicBarPosY", "gMagicBarPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##MagicBarPosX", "gMagicBarPosX", -5, ImGui::GetWindowViewport()->Size.x/2, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##MagicBarPosX", "gMagicBarPosX", -5, ImGui::GetWindowViewport()->Size.x/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -447,7 +505,7 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gVSOAPosType", 4); //in case you want only SFX
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##VSOAPosY", "gVSOAPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##VSOAPosY", "gVSOAPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
s16 Min_X_Dpad = 0;
|
||||
s16 Max_X_Dpad = ImGui::GetWindowViewport()->Size.x/2;
|
||||
@ -456,7 +514,7 @@ void Draw_Placements(){
|
||||
} else if(CVar_GetS32("gVSOAPosType",0) == 4){
|
||||
Min_X_Dpad = (ImGui::GetWindowViewport()->Size.x/2)*-1;
|
||||
}
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##VSOAPosX", "gVSOAPosX", Min_X_Dpad, Max_X_Dpad, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##VSOAPosX", "gVSOAPosX", Min_X_Dpad, Max_X_Dpad, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -478,9 +536,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gBBtnPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##BBtnPosY", "gBBtnPosY", 0, ImGui::GetWindowViewport()->Size.y/4+50, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##BBtnPosY", "gBBtnPosY", 0, ImGui::GetWindowViewport()->Size.y/4+50, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##BBtnPosX", "gBBtnPosX", -1, ImGui::GetWindowViewport()->Size.x-50, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##BBtnPosX", "gBBtnPosX", -1, ImGui::GetWindowViewport()->Size.x-50, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -502,9 +560,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gABtnPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##ABtnPosY", "gABtnPosY", -10, ImGui::GetWindowViewport()->Size.y/4+50, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##ABtnPosY", "gABtnPosY", -10, ImGui::GetWindowViewport()->Size.y/4+50, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##ABtnPosX", "gABtnPosX", -20, ImGui::GetWindowViewport()->Size.x-50, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##ABtnPosX", "gABtnPosX", -20, ImGui::GetWindowViewport()->Size.x-50, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -526,9 +584,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gStartBtnPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##StartBtnPosY", "gStartBtnPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##StartBtnPosY", "gStartBtnPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##StartBtnPosX", "gStartBtnPosX", 0, ImGui::GetWindowViewport()->Size.x/2+70, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##StartBtnPosX", "gStartBtnPosX", 0, ImGui::GetWindowViewport()->Size.x/2+70, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -550,7 +608,7 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gCBtnUPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnUPosY", "gCBtnUPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnUPosY", "gCBtnUPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
s16 Min_X_CU = 0;
|
||||
s16 Max_X_CU = ImGui::GetWindowViewport()->Size.x/2;
|
||||
@ -561,7 +619,7 @@ void Draw_Placements(){
|
||||
} else if(CVar_GetS32("gCBtnUPosType",0) == 4){
|
||||
Min_X_CU = (ImGui::GetWindowViewport()->Size.x/2)*-1;
|
||||
}
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnUPosX", "gCBtnUPosX", Min_X_CU, Max_X_CU, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnUPosX", "gCBtnUPosX", Min_X_CU, Max_X_CU, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -583,7 +641,7 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gCBtnDPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnDPosY", "gCBtnDPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnDPosY", "gCBtnDPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
s16 Min_X_CD = 0;
|
||||
s16 Max_X_CD = ImGui::GetWindowViewport()->Size.x/2;
|
||||
@ -594,7 +652,7 @@ void Draw_Placements(){
|
||||
} else if(CVar_GetS32("gCBtnDPosType",0) == 4){
|
||||
Min_X_CD = (ImGui::GetWindowViewport()->Size.x/2)*-1;
|
||||
}
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnDPosX", "gCBtnDPosX", Min_X_CD, Max_X_CD, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnDPosX", "gCBtnDPosX", Min_X_CD, Max_X_CD, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -616,7 +674,7 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gCBtnLPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnLPosY", "gCBtnLPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnLPosY", "gCBtnLPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
s16 Min_X_CL = 0;
|
||||
s16 Max_X_CL = ImGui::GetWindowViewport()->Size.x/2;
|
||||
@ -627,7 +685,7 @@ void Draw_Placements(){
|
||||
} else if(CVar_GetS32("gCBtnDPosType",0) == 4){
|
||||
Min_X_CL = (ImGui::GetWindowViewport()->Size.x/2)*-1;
|
||||
}
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnLPosX", "gCBtnLPosX", Min_X_CL, Max_X_CL, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnLPosX", "gCBtnLPosX", Min_X_CL, Max_X_CL, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -649,7 +707,7 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gCBtnRPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnRPosY", "gCBtnRPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CBtnRPosY", "gCBtnRPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
s16 Min_X_CR = 0;
|
||||
s16 Max_X_CR = ImGui::GetWindowViewport()->Size.x/2;
|
||||
@ -660,7 +718,7 @@ void Draw_Placements(){
|
||||
} else if(CVar_GetS32("gCBtnRPosType",0) == 4){
|
||||
Min_X_CR = (ImGui::GetWindowViewport()->Size.x/2)*-1;
|
||||
}
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnRPosX", "gCBtnRPosX", Min_X_CR, Max_X_CR, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CBtnRPosX", "gCBtnRPosX", Min_X_CR, Max_X_CR, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -682,7 +740,7 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gDPadPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##DPadPosY", "gDPadPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##DPadPosY", "gDPadPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
s16 Min_X_Dpad = 0;
|
||||
s16 Max_X_Dpad = ImGui::GetWindowViewport()->Size.x/2;
|
||||
@ -691,7 +749,7 @@ void Draw_Placements(){
|
||||
} else if(CVar_GetS32("gDPadPosType",0) == 4){
|
||||
Min_X_Dpad = (ImGui::GetWindowViewport()->Size.x/2)*-1;
|
||||
}
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##DPadPosX", "gDPadPosX", Min_X_Dpad, Max_X_Dpad, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##DPadPosX", "gDPadPosX", Min_X_Dpad, Max_X_Dpad, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -713,9 +771,9 @@ void Draw_Placements(){
|
||||
//SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gMinimapPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##MinimapPosY", "gMinimapPosY", (ImGui::GetWindowViewport()->Size.y/3)*-1, ImGui::GetWindowViewport()->Size.y/3, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##MinimapPosY", "gMinimapPosY", (ImGui::GetWindowViewport()->Size.y/3)*-1, ImGui::GetWindowViewport()->Size.y/3, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##MinimapPosX", "gMinimapPosX", ImGui::GetWindowViewport()->Size.x*-1, ImGui::GetWindowViewport()->Size.x/2, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##MinimapPosX", "gMinimapPosX", ImGui::GetWindowViewport()->Size.x*-1, ImGui::GetWindowViewport()->Size.x/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -737,9 +795,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gSKCPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##SKCPosY", "gSKCPosY", 0, ImGui::GetWindowViewport()->Size.y/3, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##SKCPosY", "gSKCPosY", 0, ImGui::GetWindowViewport()->Size.y/3, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##SKCPosX", "gSKCPosX", -1, ImGui::GetWindowViewport()->Size.x/2, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##SKCPosX", "gSKCPosX", -1, ImGui::GetWindowViewport()->Size.x/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -761,9 +819,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gRCPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##RCPosY", "gRCPosY", -2, ImGui::GetWindowViewport()->Size.y/3, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##RCPosY", "gRCPosY", -2, ImGui::GetWindowViewport()->Size.y/3, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##RCPosX", "gRCPosX", -3, ImGui::GetWindowViewport()->Size.x/2, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##RCPosX", "gRCPosX", -3, ImGui::GetWindowViewport()->Size.x/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -785,9 +843,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gCarrotsPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CarrotsPosY", "gCarrotsPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##CarrotsPosY", "gCarrotsPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CarrotsPosX", "gCarrotsPosX", -50, ImGui::GetWindowViewport()->Size.x/2+25, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##CarrotsPosX", "gCarrotsPosX", -50, ImGui::GetWindowViewport()->Size.x/2+25, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -809,9 +867,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gTimersPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TimersPosY", "gTimersPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TimersPosY", "gTimersPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TimersPosX", "gTimersPosX", -50, ImGui::GetWindowViewport()->Size.x/2-50, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TimersPosX", "gTimersPosX", -50, ImGui::GetWindowViewport()->Size.x/2-50, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -833,9 +891,9 @@ void Draw_Placements(){
|
||||
//SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gASPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##ASPosY", "gASPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##ASPosY", "gASPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##ASPosX", "gASPosX", -50, ImGui::GetWindowViewport()->Size.x/2-50, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##ASPosX", "gASPosX", -50, ImGui::GetWindowViewport()->Size.x/2-50, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -857,9 +915,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gTCMPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TCMPosY", "gTCMPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TCMPosY", "gTCMPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TCMPosX", "gTCMPosX", -50, ImGui::GetWindowViewport()->Size.x/2+10, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TCMPosX", "gTCMPosX", -50, ImGui::GetWindowViewport()->Size.x/2+10, ""), true;
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
@ -881,9 +939,9 @@ void Draw_Placements(){
|
||||
SohImGui::Tooltip("This will make your elements to not follow any side\nBetter used for center elements.");
|
||||
SohImGui::EnhancementRadioButton("Hidden", "gTCBPosType", 4);
|
||||
SohImGui::Tooltip("This will make your elements hidden");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TCBPosY", "gTCBPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "");
|
||||
SohImGui::EnhancementSliderInt("Up <-> Down : %d", "##TCBPosY", "gTCBPosY", 0, ImGui::GetWindowViewport()->Size.y/2, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Up and Down your elements.");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TCBPosX", "gTCBPosX", -50, ImGui::GetWindowViewport()->Size.x/2+10, "");
|
||||
SohImGui::EnhancementSliderInt("Left <-> Right : %d", "##TCBPosX", "gTCBPosX", -50, ImGui::GetWindowViewport()->Size.x/2+10, "", 0, true);
|
||||
SohImGui::Tooltip("This slider is used to move Left and Right your elements.");
|
||||
ImGui::NewLine();
|
||||
ImGui::EndTable();
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
void InitCosmeticsEditor();//Init the menu itself
|
||||
void LoadRainbowColor();
|
||||
void LoadRainbowColor();
|
||||
void NewSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0);
|
@ -42,7 +42,7 @@ static RandomizerHash randomizerHash;
|
||||
static SpoilerData spoilerData;
|
||||
|
||||
void GenerateHash() {
|
||||
for (size_t i = 0; i < Settings::seed.size(); i++) {
|
||||
for (size_t i = 0; i < Settings::hashIconIndexes.size(); i++) {
|
||||
int number = Settings::seed[i] - '0';
|
||||
Settings::hashIconIndexes[i] = number;
|
||||
}
|
||||
@ -371,10 +371,11 @@ static void WriteSettings(const bool printAll = false) {
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// 3drando doesn't have a "skip child zelda" setting, manually add it to the spoilerfile
|
||||
jsonData["settings"]["Skip Child Zelda"] = Settings::skipChildZelda;
|
||||
}
|
||||
|
||||
// 3drando doesn't have a "skip child zelda" setting, manually add it to the spoilerfile
|
||||
jsonData["settings"]["Skip Child Zelda"] = Settings::skipChildZelda;
|
||||
|
||||
// spoilerLog.RootElement()->InsertEndChild(parentNode);
|
||||
|
||||
// for (const uint32_t key : allLocations) {
|
||||
|
@ -869,21 +869,19 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
|
||||
switch (request.type) {
|
||||
case RequestType::SAVE:
|
||||
requests.push(request);
|
||||
break;
|
||||
return SaveStateReturn::SUCCESS;
|
||||
case RequestType::LOAD:
|
||||
if (states.contains(request.slot)) {
|
||||
requests.push(request);
|
||||
return SaveStateReturn::SUCCESS;
|
||||
} else {
|
||||
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
|
||||
SohImGui::overlay->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot);
|
||||
return SaveStateReturn::FAIL_INVALID_SLOT;
|
||||
}
|
||||
break;
|
||||
[[unlikely]] default:
|
||||
SPDLOG_ERROR("Invalid SaveState request type: {}", request.type);
|
||||
return SaveStateReturn::FAIL_BAD_REQUEST;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -517,6 +517,19 @@ void SaveManager::LoadFile(int fileNum) {
|
||||
InitMeta(fileNum);
|
||||
}
|
||||
|
||||
bool SaveManager::SaveFile_Exist(int fileNum) {
|
||||
|
||||
try {
|
||||
std::filesystem::exists(GetFileName(fileNum));
|
||||
printf("File[%d] - exist \n",fileNum);
|
||||
return true;
|
||||
}
|
||||
catch(std::filesystem::filesystem_error const& ex) {
|
||||
printf("File[%d] - do not exist \n",fileNum);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void SaveManager::AddInitFunction(InitFunc func) {
|
||||
initFuncs.emplace_back(func);
|
||||
}
|
||||
@ -1332,3 +1345,7 @@ extern "C" void Save_CopyFile(int from, int to) {
|
||||
extern "C" void Save_DeleteFile(int fileNum) {
|
||||
SaveManager::Instance->DeleteZeldaFile(fileNum);
|
||||
}
|
||||
|
||||
extern "C" bool Save_Exist(int fileNum) {
|
||||
return SaveManager::Instance->SaveFile_Exist(fileNum);
|
||||
}
|
@ -41,6 +41,7 @@ public:
|
||||
void SaveFile(int fileNum);
|
||||
void SaveGlobal();
|
||||
void LoadFile(int fileNum);
|
||||
bool SaveFile_Exist(int fileNum);
|
||||
|
||||
// Adds a function that is called when we are intializing a save, including when we are loading a save.
|
||||
void AddInitFunction(InitFunc func);
|
||||
@ -149,5 +150,5 @@ void Save_AddSaveFunction(char* name, int version, Save_SaveFunc func);
|
||||
SaveFileMetaInfo* Save_GetSaveMetaInfo(int fileNum);
|
||||
void Save_CopyFile(int from, int to);
|
||||
void Save_DeleteFile(int fileNum);
|
||||
|
||||
bool Save_Exist(int fileNum);
|
||||
#endif
|
||||
|
@ -1028,7 +1028,7 @@ s8 D_80131870 = 0;
|
||||
u8 D_80131874 = 0;
|
||||
u8 D_80131878 = 0;
|
||||
u8 D_8013187C = 0;
|
||||
u8 D_80131880 = 0;
|
||||
u8 sOcarinaDropInputTimer = 0;
|
||||
|
||||
OcarinaNote sPierresSong[108] = {
|
||||
{ 0xFF, 0, 0, 0, 0, 0, 0 },
|
||||
@ -1550,9 +1550,11 @@ void func_800ED458(s32 arg0) {
|
||||
u32 phi_v1_2;
|
||||
bool dpad = CVar_GetS32("gDpadOcarinaText", 0);
|
||||
|
||||
if (D_80130F3C != 0 && D_80131880 != 0) {
|
||||
D_80131880--;
|
||||
return;
|
||||
if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) {
|
||||
sOcarinaDropInputTimer--;
|
||||
if (!CVar_GetS32("gDpadNoDropOcarinaInput", 0)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((D_8016BA10 == 0) ||
|
||||
@ -2057,7 +2059,7 @@ void func_800EE6F4(void) {
|
||||
}
|
||||
|
||||
if ((D_80130F3C != 0) && (sPrevOcarinaNoteVal != sCurOcarinaBtnVal)) {
|
||||
D_80131880 = 1;
|
||||
sOcarinaDropInputTimer = 1;
|
||||
}
|
||||
|
||||
sPrevOcarinaNoteVal = sCurOcarinaBtnVal;
|
||||
@ -2110,7 +2112,7 @@ void func_800EE930(void) {
|
||||
sRecordingStaff.noteIdx = OCARINA_NOTE_INVALID;
|
||||
sRecordingStaff.state = 0xFF;
|
||||
sRecordingStaff.pos = 0;
|
||||
D_80131880 = 0;
|
||||
sOcarinaDropInputTimer = 0;
|
||||
}
|
||||
|
||||
f32 D_80131C8C = 0.0f;
|
||||
|
@ -1035,15 +1035,9 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
break;
|
||||
} else {
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
this->actor.shape.yOffset = 430.0f;
|
||||
this->actor.shape.shadowScale = 0.03f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
if (this->unk_15A < 0) {
|
||||
if (this->unk_15A == -1) {
|
||||
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
|
||||
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
|
||||
this->actor.objBankIndex = bankIndex;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
@ -1056,7 +1050,16 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
//Big hearts workaround
|
||||
this->actor.home.rot.z = Rand_CenteredFloat(65535.0f);
|
||||
this->actor.shape.yOffset = 430.0f;
|
||||
this->actor.shape.shadowScale = 6.0f;
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->scale = 0.02f;
|
||||
EnItem00_DrawCollectible(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM00_BOMBS_A:
|
||||
if (CVar_GetS32("gNewDrops", 0)) {
|
||||
Actor_SetScale(&this->actor, 0.2f);
|
||||
|
@ -713,6 +713,11 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
// If any of these CVars are enabled, disable toggling the minimap with L, unless gEnableMapToggle is set
|
||||
bool enableMapToggle =
|
||||
!(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gTurboOnL", 0)) ||
|
||||
CVar_GetS32("gEnableMapToggle", 0);
|
||||
|
||||
if (globalCtx->pauseCtx.state < 4) {
|
||||
//Minimap margins
|
||||
s16 X_Margins_Minimap;
|
||||
@ -781,7 +786,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) {
|
||||
osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx));
|
||||
// clang-format off
|
||||
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
|
||||
@ -948,7 +953,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) {
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) {
|
||||
// clang-format off
|
||||
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
|
||||
&D_801333E0, &D_801333E0, &D_801333E8); }
|
||||
|
@ -520,12 +520,12 @@ 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", 50)/255)*95;
|
||||
sIconPrimColors[0][1] = (CVar_GetS32("gCCABtnPrimG", 255)/255)*95;
|
||||
sIconPrimColors[0][2] = (CVar_GetS32("gCCABtnPrimB", 130)/255)*95;
|
||||
sIconPrimColors[1][0] = CVar_GetS32("gCCABtnPrimR", 50);
|
||||
sIconPrimColors[1][1] = CVar_GetS32("gCCABtnPrimG", 255);
|
||||
sIconPrimColors[1][2] = CVar_GetS32("gCCABtnPrimB", 130);
|
||||
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);
|
||||
sIconEnvColors[0][0] = 0;
|
||||
sIconEnvColors[0][1] = 0;
|
||||
sIconEnvColors[0][2] = 0;
|
||||
@ -3257,13 +3257,13 @@ void Message_Update(GlobalContext* globalCtx) {
|
||||
static s16 sTextboxXPositions[] = {
|
||||
34, 34, 34, 34, 34, 34,
|
||||
};
|
||||
static s16 sTextboxMidYPositions[] = {
|
||||
static s16 sTextboxLowerYPositions[] = {
|
||||
142, 142, 142, 142, 174, 142,
|
||||
};
|
||||
static s16 sTextboxUpperYPositions[] = {
|
||||
38, 38, 38, 38, 174, 38,
|
||||
};
|
||||
static s16 sTextboxLowerYPositions[] = {
|
||||
static s16 sTextboxMidYPositions[] = {
|
||||
90, 90, 90, 90, 174, 90,
|
||||
};
|
||||
static s16 sTextboxEndIconYOffset[] = {
|
||||
@ -3357,20 +3357,20 @@ void Message_Update(GlobalContext* globalCtx) {
|
||||
if (!msgCtx->textBoxPos) { // variable position
|
||||
if (YREG(15) != 0 || globalCtx->sceneNum == SCENE_HAIRAL_NIWA) {
|
||||
if (averageY < XREG(92)) {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
|
||||
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
|
||||
} else {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_MARKET_DAY || globalCtx->sceneNum == SCENE_MARKET_NIGHT ||
|
||||
globalCtx->sceneNum == SCENE_MARKET_RUINS) {
|
||||
if (averageY < XREG(93)) {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
|
||||
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
|
||||
} else {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
|
||||
}
|
||||
} else {
|
||||
if (averageY < XREG(94)) {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxMidYPositions[var];
|
||||
R_TEXTBOX_Y_TARGET = sTextboxLowerYPositions[var];
|
||||
} else {
|
||||
R_TEXTBOX_Y_TARGET = sTextboxUpperYPositions[var];
|
||||
}
|
||||
|
@ -1676,13 +1676,15 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
|
||||
if (item == ITEM_SWORD_BGS) {
|
||||
gSaveContext.swordHealth = 8;
|
||||
|
||||
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) {
|
||||
gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD];
|
||||
if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF
|
||||
||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { // In rando, when buying Giant's Knife, also check
|
||||
gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword
|
||||
if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) {
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS;
|
||||
Interface_LoadItemIcon1(globalCtx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (item == ITEM_SWORD_MASTER) {
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER;
|
||||
gSaveContext.equips.equipment &= 0xFFF0;
|
||||
@ -4796,10 +4798,11 @@ void Interface_Draw(GlobalContext* globalCtx) {
|
||||
PosY_BtnA = CVar_GetS32("gABtnPosY", 0)+Y_Margins_BtnA;
|
||||
rAIconY = 98.0f - PosY_BtnA;
|
||||
if (CVar_GetS32("gABtnPosType", 0) == 1) {//Anchor Left
|
||||
if (CVar_GetS32("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Left_HUD_Margin;};
|
||||
PosX_BtnA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
rAIconX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
} else if (CVar_GetS32("gABtnPosType", 0) == 2) {//Anchor Right
|
||||
X_Margins_BtnA = Right_HUD_Margin;
|
||||
if (CVar_GetS32("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Right_HUD_Margin;};
|
||||
PosX_BtnA = OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
rAIconX= OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA);
|
||||
} else if (CVar_GetS32("gABtnPosType", 0) == 3) {//Anchor None
|
||||
|
@ -1673,7 +1673,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
|
||||
Vec3s* srcTable;
|
||||
s32 i;
|
||||
bool canswitchrnd = false;
|
||||
s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 1);
|
||||
s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 0);
|
||||
MinFrameCount = CVar_GetS32("gMinFrameCount", 200);
|
||||
|
||||
gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800);
|
||||
@ -1699,7 +1699,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
|
||||
};
|
||||
s16 AnimArraySize = ARRAY_COUNT(PauseMenuAnimSet);
|
||||
|
||||
if (CVar_GetS32("gPauseLiveLink", !0) || CVar_GetS32("gPauseTriforce", 0)) {
|
||||
if (CVar_GetS32("gPauseLiveLink", 0) || CVar_GetS32("gPauseTriforce", 0)) {
|
||||
uintptr_t anim = 0; // Initialise anim
|
||||
|
||||
if (CUR_EQUIP_VALUE(EQUIP_SWORD) >= 3) {
|
||||
|
@ -402,6 +402,12 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
|
||||
camera = GET_ACTIVE_CAM(globalCtx);
|
||||
camId = camera->camDataIdx;
|
||||
if (camId == -1 && CVar_GetS32("gNoRestrictItems", 0)) {
|
||||
// This prevents a crash when using items that change the
|
||||
// camera (such as din's fire) on scenes with prerendered backgrounds
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// jfifid
|
||||
camId2 = func_80041C10(&globalCtx->colCtx, camId, BGCHECK_SCENE)[2].y;
|
||||
if (camId2 >= 0) {
|
||||
|
@ -34,6 +34,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Draw(Actor* this, GlobalContext* globalCtx);
|
||||
void BgHakaGate_Reset(void);
|
||||
|
||||
void BgHakaGate_DoNothing(BgHakaGate* this, GlobalContext* globalCtx);
|
||||
void BgHakaGate_StatueInactive(BgHakaGate* this, GlobalContext* globalCtx);
|
||||
@ -62,7 +63,7 @@ const ActorInit Bg_Haka_Gate_InitVars = {
|
||||
(ActorFunc)BgHakaGate_Destroy,
|
||||
(ActorFunc)BgHakaGate_Update,
|
||||
(ActorFunc)BgHakaGate_Draw,
|
||||
NULL,
|
||||
(ActorResetFunc)BgHakaGate_Reset,
|
||||
};
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
@ -378,3 +379,7 @@ void BgHakaGate_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgHakaGate_DrawFlame(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
void BgHakaGate_Reset(void) {
|
||||
sStatueRotY = 0;
|
||||
}
|
||||
|
@ -228,8 +228,8 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) {
|
||||
this->colliderCylinder.dim.pos.z = this->dyna.actor.world.pos.z + sp28.x * sine + sp28.z * cosine;
|
||||
}
|
||||
|
||||
static UNK_TYPE D_80881018 = 0;
|
||||
void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) {
|
||||
static UNK_TYPE D_80881018 = 0;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((D_80880F30 == 0) && (!Player_InCsMode(globalCtx))) {
|
||||
@ -553,4 +553,5 @@ void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void BgHakaTrap_Reset(void) {
|
||||
D_80880F30 = 0;
|
||||
D_80881014 = 0;
|
||||
D_80881018 = 0;
|
||||
}
|
@ -227,7 +227,7 @@ void BgSpot06Objects_GateSpawnBubbles(BgSpot06Objects* this, GlobalContext* glob
|
||||
void BgSpot06Objects_GateWaitForSwitch(BgSpot06Objects* this, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
|
||||
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
if ((CVar_GetS32("gWaterTempleGateFix", 0) == 0 || LINK_IS_ADULT) && Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
this->timer = 100;
|
||||
this->dyna.actor.world.pos.y += 3.0f;
|
||||
this->actionFunc = BgSpot06Objects_GateWaitToOpen;
|
||||
|
@ -297,7 +297,7 @@ void func_808B7F74(BgSpot18Basket* this) {
|
||||
shapeRotY = this->dyna.actor.shape.rot.y;
|
||||
this->actionFunc = func_808B7FC0;
|
||||
|
||||
if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19)) {
|
||||
if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVar_GetS32("gGoronPot", 0)) {
|
||||
this->unk_218 = 2;
|
||||
} else if (shapeRotY < 0x26C2) {
|
||||
this->unk_218 = 1;
|
||||
|
@ -929,7 +929,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f);
|
||||
for (indS1 = 0; indS1 < 40; indS1++) {
|
||||
if (sMorphaTent2->tentSpawnPos) {}
|
||||
if (sMorphaTent2 && sMorphaTent2->tentSpawnPos) {}
|
||||
indT5 = Rand_ZeroFloat(20.9f);
|
||||
indS0 = sTentSpawnIndex[indT5];
|
||||
spFC.x = 0;
|
||||
@ -3604,4 +3604,4 @@ void BossMo_Reset(void) {
|
||||
sBossGanonSeed1 = 0;
|
||||
sBossGanonSeed2 = 0;
|
||||
sBossGanonSeed3 = 0;
|
||||
}
|
||||
}
|
||||
|
@ -290,7 +290,8 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.targetMode = 6;
|
||||
this->unk_1E8.unk_00 = 0;
|
||||
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x10) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) {
|
||||
if (!(gSaveContext.eventChkInf[1] & 0x10) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag) ||
|
||||
(gSaveContext.n64ddFlag && Flags_GetTreasure(globalCtx, 0x1F))) {
|
||||
this->actionFunc = func_80AA0D88;
|
||||
EnMa1_ChangeAnim(this, ENMA1_ANIM_2);
|
||||
} else {
|
||||
|
@ -5191,7 +5191,7 @@ s32 func_8083B644(Player* this, GlobalContext* globalCtx) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_21;
|
||||
}
|
||||
|
||||
if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && !sp28) {
|
||||
if (!CHECK_BTN_ALL(sControlInput->press.button, CVar_GetS32("gNaviOnL", 0) ? BTN_L : BTN_CUP) && !sp28) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -5247,7 +5247,8 @@ s32 func_8083B998(Player* this, GlobalContext* globalCtx) {
|
||||
(CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || (this->unk_664->naviEnemyId != 0xFF))) {
|
||||
this->stateFlags2 |= PLAYER_STATE2_21;
|
||||
}
|
||||
else if ((this->naviTextId == 0) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
|
||||
else if ((this->naviTextId == 0 || CVar_GetS32("gNaviOnL", 0)) &&
|
||||
!func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) &&
|
||||
(YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, globalCtx)) {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
}
|
||||
@ -7138,7 +7139,7 @@ void func_808409CC(GlobalContext* globalCtx, Player* this) {
|
||||
if (sp34 < 4) {
|
||||
if (((sp34 != 0) && (sp34 != 3)) || ((this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) &&
|
||||
((sp34 == 3) || Player_GetSwordHeld(this)))) {
|
||||
if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVar_GetS32("gTwoHandedIdle", 1) == 1) {
|
||||
if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVar_GetS32("gTwoHandedIdle", 0) == 1) {
|
||||
sp34 = 4;
|
||||
}
|
||||
sp38 = sp34 + 9;
|
||||
@ -7846,15 +7847,35 @@ s32 func_8084285C(Player* this, f32 arg1, f32 arg2, f32 arg3) {
|
||||
}
|
||||
|
||||
s32 func_808428D8(Player* this, GlobalContext* globalCtx) {
|
||||
if (!Player_IsChildWithHylianShield(this) && Player_GetSwordHeld(this) && D_80853614) {
|
||||
func_80832264(globalCtx, this, &gPlayerAnim_002EC8);
|
||||
this->unk_84F = 1;
|
||||
this->swordAnimation = 0xC;
|
||||
this->currentYaw = this->actor.shape.rot.y + this->unk_6BE;
|
||||
if (Player_IsChildWithHylianShield(this) || !Player_GetSwordHeld(this) || !D_80853614) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
func_80832264(globalCtx, this, &gPlayerAnim_002EC8);
|
||||
this->unk_84F = 1;
|
||||
this->swordAnimation = 0xC;
|
||||
this->currentYaw = this->actor.shape.rot.y + this->unk_6BE;
|
||||
|
||||
if (!CVar_GetS32("gCrouchStabHammerFix", 0)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
u32 swordId;
|
||||
if (Player_HoldsBrokenKnife(this)) {
|
||||
swordId = 1;
|
||||
} else {
|
||||
swordId = Player_GetSwordHeld(this) - 1;
|
||||
}
|
||||
|
||||
if (swordId != 4 && !CVar_GetS32("gCrouchStabFix", 0)) { // 4 = Megaton Hammer
|
||||
return 1;
|
||||
}
|
||||
|
||||
u32 flags = D_80854488[swordId][0];
|
||||
func_80837918(this, 0, flags);
|
||||
func_80837918(this, 1, flags);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
s32 func_80842964(Player* this, GlobalContext* globalCtx) {
|
||||
@ -9884,8 +9905,15 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) {
|
||||
this->unk_837 = 20;
|
||||
}
|
||||
else if (this->unk_837 != 0) {
|
||||
doAction = DO_ACTION_NONE;
|
||||
this->unk_837--;
|
||||
if (CVar_GetS32("gInstantPutaway", 0) != 0)
|
||||
{
|
||||
this->unk_837 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
doAction = DO_ACTION_NONE;
|
||||
this->unk_837--;
|
||||
}
|
||||
}
|
||||
|
||||
Interface_SetDoAction(globalCtx, doAction);
|
||||
|
@ -11,9 +11,9 @@
|
||||
#include "textures/nintendo_rogo_static/nintendo_rogo_static.h"
|
||||
#include <soh/Enhancements/bootcommands.h>
|
||||
#include "GameVersions.h"
|
||||
#include <soh/SaveManager.h>
|
||||
|
||||
const char* GetGameVersionString();
|
||||
|
||||
char* quote;
|
||||
|
||||
void Title_PrintBuildInfo(Gfx** gfxp) {
|
||||
@ -224,72 +224,6 @@ void Title_Draw(TitleContext* this) {
|
||||
void Title_Main(GameState* thisx) {
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
|
||||
if (CVar_GetS32("gSkipLogoTitle",0)!=0) {
|
||||
gSaveContext.language = CVar_GetS32("gLanguages", 0);
|
||||
Sram_InitSram(&this->state);
|
||||
s16 selectedfile = CVar_GetS32("gSaveFileID", 0);
|
||||
if (selectedfile == 4) {
|
||||
selectedfile = 0xFF;
|
||||
} else if(selectedfile == 0){
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
gSaveContext.gameMode = 0;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, SelectContext);
|
||||
return;
|
||||
} else {
|
||||
selectedfile--;
|
||||
if (selectedfile < 0) {
|
||||
selectedfile = 0xFF;
|
||||
}
|
||||
}
|
||||
if (selectedfile == 0xFF) {
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Select_Init, SelectContext);
|
||||
} else {
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
this->state.running = false;
|
||||
//return;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
}
|
||||
gSaveContext.respawn[0].entranceIndex = -1;
|
||||
gSaveContext.respawnFlag = 0;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.showTitleCard = true;
|
||||
gSaveContext.dogParams = 0;
|
||||
gSaveContext.timer1State = 0;
|
||||
gSaveContext.timer2State = 0;
|
||||
gSaveContext.eventInf[0] = 0;
|
||||
gSaveContext.eventInf[1] = 0;
|
||||
gSaveContext.eventInf[2] = 0;
|
||||
gSaveContext.eventInf[3] = 0;
|
||||
gSaveContext.unk_13EE = 0x32;
|
||||
gSaveContext.nayrusLoveTimer = 0;
|
||||
gSaveContext.healthAccumulator = 0;
|
||||
gSaveContext.unk_13F0 = 0;
|
||||
gSaveContext.unk_13F2 = 0;
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.nextTransition = 0xFF;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.unk_13C3 = 0;
|
||||
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = gSaveContext.unk_13F4 = 0;
|
||||
gSaveContext.unk_13F6 = gSaveContext.magic;
|
||||
gSaveContext.magic = 0;
|
||||
gSaveContext.magicLevel = gSaveContext.magic;
|
||||
gSaveContext.naviTimer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
OPEN_DISPS(this->state.gfxCtx);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0, NULL);
|
||||
@ -330,27 +264,94 @@ void Title_Destroy(GameState* thisx) {
|
||||
void Title_Init(GameState* thisx) {
|
||||
//u32 size = 0;
|
||||
TitleContext* this = (TitleContext*)thisx;
|
||||
FileChooseContext* FileChooseCtx = (FileChooseContext*)thisx;
|
||||
|
||||
quote = SetQuote();
|
||||
if (CVar_GetS32("gSkipLogoTitle",0)) {
|
||||
bool saveloading = false;
|
||||
Sram_InitSram(&this->state.init);
|
||||
gSaveContext.language = CVar_GetS32("gLanguages", 0);
|
||||
s32 selectedfile = CVar_GetS32("gSaveFileID", 0);
|
||||
if (selectedfile == 4) {
|
||||
if (CVar_GetS32("gDebugEnabled",0)) {
|
||||
selectedfile = 0xFF;
|
||||
} else {
|
||||
selectedfile = 3;
|
||||
}
|
||||
}
|
||||
if (selectedfile < 0) {
|
||||
selectedfile = 3; //If somehow the save file number under 0 revert back to 3 to prevent boot error
|
||||
}
|
||||
if(selectedfile == 3){
|
||||
saveloading = true;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.gameMode = 1;
|
||||
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, FileChooseContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else if (selectedfile == 0xFF || selectedfile > 3) {
|
||||
saveloading = true;
|
||||
Sram_InitDebugSave();
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
SET_NEXT_GAMESTATE(&this->state, Select_Init, SelectContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else if (selectedfile >= 0 && selectedfile <= 2) {
|
||||
if (Save_Exist(selectedfile) == true) { //The file exist load it
|
||||
saveloading = true;
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
gSaveContext.magic = gSaveContext.magic;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else {
|
||||
if (CVar_GetS32("gCreateNewSave",0)) {
|
||||
//File do not exist create a new save file
|
||||
saveloading = true;
|
||||
Sram_InitSram(&FileChooseCtx->state.init);
|
||||
gSaveContext.fileNum = selectedfile;
|
||||
Sram_InitSave(FileChooseCtx);
|
||||
Sram_OpenSave();
|
||||
gSaveContext.gameMode = 0;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
} else {
|
||||
//File do not exist but user do not wish to auto create a save file with blank name
|
||||
saveloading = true;
|
||||
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
|
||||
gSaveContext.natureAmbienceId = 0xFF;
|
||||
gSaveContext.gameMode = 1;
|
||||
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, FileChooseContext);
|
||||
this->state.running = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quote = SetQuote();
|
||||
|
||||
//this->staticSegment = GAMESTATE_ALLOC_MC(&this->state, size);
|
||||
osSyncPrintf("z_title.c\n");
|
||||
//ASSERT(this->staticSegment != NULL);
|
||||
//this->staticSegment = GAMESTATE_ALLOC_MC(&this->state, size);
|
||||
osSyncPrintf("z_title.c\n");
|
||||
//ASSERT(this->staticSegment != NULL);
|
||||
|
||||
//ResourceMgr_CacheDirectory("nintendo_rogo_static*");
|
||||
//ResourceMgr_CacheDirectory("nintendo_rogo_static*");
|
||||
|
||||
// Disable vismono
|
||||
D_801614B0.a = 0;
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Title_Main;
|
||||
this->state.destroy = Title_Destroy;
|
||||
this->exit = false;
|
||||
gSaveContext.fileNum = 0xFF;
|
||||
this->ult = 0;
|
||||
this->unk_1D4 = 0x14;
|
||||
this->coverAlpha = 255;
|
||||
this->addAlpha = -3;
|
||||
this->visibleDuration = 0x3C;
|
||||
// Disable vismono
|
||||
D_801614B0.a = 0;
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Title_Main;
|
||||
this->state.destroy = Title_Destroy;
|
||||
this->exit = false;
|
||||
gSaveContext.fileNum = 0xFF;
|
||||
this->ult = 0;
|
||||
this->unk_1D4 = 0x14;
|
||||
this->coverAlpha = 255;
|
||||
this->addAlpha = -3;
|
||||
this->visibleDuration = 0x3C;
|
||||
}
|
||||
}
|
||||
|
@ -637,24 +637,23 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
|
||||
gItemIcons[sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1], 32, 32, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw inventory screen icons
|
||||
for (k = 0, bit = rowStart, point = 4; k < 3; k++, point += 4, temp++, bit++) {
|
||||
|
||||
int itemId = ITEM_SWORD_KOKIRI + temp;
|
||||
bool age_restricted = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge);
|
||||
if (age_restricted) {
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, true);
|
||||
}
|
||||
if (((u32)i == 0) && (k == 2) && (gSaveContext.bgsFlag != 0)) {
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gBiggoronSwordIconTex, 32, 32, point);
|
||||
} else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) {
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gBrokenGiantsKnifeIconTex, 32, 32, point);
|
||||
}
|
||||
if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
|
||||
int itemId = ITEM_SWORD_KOKIRI + temp;
|
||||
bool not_acquired = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge);
|
||||
if (not_acquired) {
|
||||
gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, true);
|
||||
}
|
||||
} else if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
|
||||
KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point);
|
||||
gsSPGrayscale(POLY_KAL_DISP++, false);
|
||||
}
|
||||
gsSPGrayscale(POLY_KAL_DISP++, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ u8 gAmmoItems[] = {
|
||||
static s16 sEquipState = 0;
|
||||
static s16 sEquipAnimTimer = 0;
|
||||
static s16 sEquipMoveTimer = 10;
|
||||
bool gSelectingMask;
|
||||
|
||||
static s16 sAmmoVtxOffset[] = {
|
||||
0, 2, 4, 6, 99, 99, 8, 99, 99, 10, 99, 99, 99, 99, 99, 99, 12,
|
||||
@ -108,7 +109,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
||||
pauseCtx->nameColorSet = 0;
|
||||
|
||||
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM)) {
|
||||
moveCursorResult = 0;
|
||||
moveCursorResult = 0 || gSelectingMask;
|
||||
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
|
||||
|
||||
cursorItem = pauseCtx->cursorItem[PAUSE_ITEM];
|
||||
@ -282,7 +283,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
||||
if (pauseCtx->cursorSpecialPos == 0) {
|
||||
if (cursorItem != PAUSE_ITEM_NONE) {
|
||||
if ((ABS(pauseCtx->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) {
|
||||
moveCursorResult = 0;
|
||||
moveCursorResult = 0 || gSelectingMask;
|
||||
|
||||
cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
|
||||
cursorY = pauseCtx->cursorY[PAUSE_ITEM];
|
||||
@ -350,6 +351,40 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
||||
KaleidoScope_SetCursorVtx(pauseCtx, index, pauseCtx->itemVtx);
|
||||
|
||||
if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) {
|
||||
if (CVar_GetS32("gMaskSelect", 0) && (gSaveContext.eventChkInf[8] & 0x8000) &&
|
||||
cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A)) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
gSelectingMask = !gSelectingMask;
|
||||
}
|
||||
if (gSelectingMask) {
|
||||
pauseCtx->cursorColorSet = 8;
|
||||
if (((pauseCtx->stickRelX > 30 || pauseCtx->stickRelY > 30) ||
|
||||
dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT | BTN_DUP)) &&
|
||||
INV_CONTENT(ITEM_TRADE_CHILD) < ITEM_MASK_TRUTH) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
++INV_CONTENT(ITEM_TRADE_CHILD);
|
||||
} else if (((pauseCtx->stickRelX < -30 || pauseCtx->stickRelY < -30) ||
|
||||
dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DDOWN)) &&
|
||||
INV_CONTENT(ITEM_TRADE_CHILD) > ITEM_MASK_KEATON) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
--INV_CONTENT(ITEM_TRADE_CHILD);
|
||||
} else if ((pauseCtx->stickRelX < -30 || pauseCtx->stickRelX > 30 || pauseCtx->stickRelY < -30 || pauseCtx->stickRelY > 30) ||
|
||||
dpad && CHECK_BTN_ANY(input->press.button, BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT)) {
|
||||
INV_CONTENT(ITEM_TRADE_CHILD) ^= ITEM_MASK_KEATON ^ ITEM_MASK_TRUTH;
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
}
|
||||
for (uint16_t cSlotIndex = 0; cSlotIndex < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); cSlotIndex++) {
|
||||
if (gSaveContext.equips.cButtonSlots[cSlotIndex] == SLOT_TRADE_CHILD) {
|
||||
if (!LINK_IS_ADULT || CVar_GetS32("gNoRestrictAge", 0)) {
|
||||
gSaveContext.equips.buttonItems[cSlotIndex+1] = INV_CONTENT(ITEM_TRADE_CHILD);
|
||||
} else if (INV_CONTENT(ITEM_TRADE_CHILD) != gSaveContext.equips.buttonItems[cSlotIndex+1]) {
|
||||
gSaveContext.equips.cButtonSlots[cSlotIndex] = SLOT_NONE;
|
||||
gSaveContext.equips.buttonItems[cSlotIndex+1] = ITEM_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
gSelectingMask = cursorSlot == SLOT_TRADE_CHILD;
|
||||
}
|
||||
u16 buttonsToCheck = BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT;
|
||||
if (CVar_GetS32("gDpadEquips", 0) && (!CVar_GetS32("gDpadPauseName", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) {
|
||||
buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT;
|
||||
@ -474,6 +509,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
||||
void KaleidoScope_SetupItemEquip(GlobalContext* globalCtx, u16 item, u16 slot, s16 animX, s16 animY) {
|
||||
Input* input = &globalCtx->state.input[0];
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
gSelectingMask = false;
|
||||
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
|
||||
pauseCtx->equipTargetCBtn = 0;
|
||||
|
@ -10,6 +10,7 @@ extern s16 D_8082AB2C[];
|
||||
extern u8 gSlotAgeReqs[];
|
||||
extern u8 gEquipAgeReqs[][4];
|
||||
extern u8 gAreaGsFlags[];
|
||||
extern bool gSelectingMask;
|
||||
|
||||
void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfxCtx);
|
||||
s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point);
|
||||
|
@ -867,6 +867,7 @@ void KaleidoScope_SetDefaultCursor(GlobalContext* globalCtx) {
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
s16 s;
|
||||
s16 i;
|
||||
gSelectingMask = false;
|
||||
|
||||
switch (pauseCtx->pageIndex) {
|
||||
case PAUSE_ITEM:
|
||||
@ -900,6 +901,7 @@ void KaleidoScope_SetDefaultCursor(GlobalContext* globalCtx) {
|
||||
void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) {
|
||||
pauseCtx->unk_1E4 = 1;
|
||||
pauseCtx->unk_1EA = 0;
|
||||
gSelectingMask = false;
|
||||
|
||||
if (!pt) {
|
||||
pauseCtx->mode = pauseCtx->pageIndex * 2 + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user