diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml
index 64c908a37..45cab21d9 100644
--- a/.github/workflows/generate-builds.yml
+++ b/.github/workflows/generate-builds.yml
@@ -6,42 +6,44 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
+
generate-soh-otr:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Git Checkout
+ uses: actions/checkout@v4
with:
submodules: true
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2.14
+ - name: Configure ccache
+ uses: hendrikmuhs/ccache-action@v1.2
with:
+ save: ${{ github.ref_name == github.event.repository.default_branch }}
key: ${{ runner.os }}-otr-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-otr-ccache-${{ github.ref }}
- ${{ runner.os }}-otr-ccache-
+ ${{ runner.os }}-otr-ccache
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt) libzip-dev zipcmp zipmerge ziptool
- - name: Cache build folders
- uses: actions/cache@v4
+ - name: Restore Cached deps folder
+ uses: actions/cache/restore@v4
with:
- key: ${{ runner.os }}-otr-build-${{ github.ref }}-${{ github.sha }}
+ key: ${{ runner.os }}-deps-${{ github.ref }}-${{ github.sha }}
restore-keys: |
- ${{ runner.os }}-otr-build-${{ github.ref }}
- ${{ runner.os }}-otr-build-
- path: |
- build-cmake
- SDL2-2.30.3
- tinyxml2-10.0.0
+ ${{ runner.os }}-deps-${{ github.ref }}-
+ ${{ runner.os }}-deps-
+ path: deps
+ - name: Create deps folder
+ run: mkdir -p deps
- name: Install latest SDL
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- if [ ! -d "SDL2-2.30.3" ]; then
- wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz
- tar -xzf SDL2-2.30.3.tar.gz
+ if [ ! -d "deps/SDL2-2.30.3" ]; then
+ wget https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz
+ tar -xzf SDL2-2.30.3.tar.gz -C deps
fi
- cd SDL2-2.30.3
+ cd deps/SDL2-2.30.3
./configure --enable-hidapi-libusb
make -j 10
sudo make install
@@ -50,11 +52,11 @@ jobs:
run: |
sudo apt-get remove libtinyxml2-dev
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- if [ ! -d "tinyxml2-10.0.0" ]; then
+ if [ ! -d "deps/tinyxml2-10.0.0" ]; then
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
- tar -xzf 10.0.0.tar.gz
+ tar -xzf 10.0.0.tar.gz -C deps
fi
- cd tinyxml2-10.0.0
+ cd deps/tinyxml2-10.0.0
mkdir -p build
cd build
cmake ..
@@ -64,49 +66,57 @@ jobs:
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
- cmake --build build-cmake --config Release --target GenerateSohOtr
- - uses: actions/upload-artifact@v4
+ cmake --build build-cmake --config Release --target GenerateSohOtr -j3
+ - name: Upload soh.otr
+ uses: actions/upload-artifact@v4
with:
name: soh.otr
path: soh.otr
- retention-days: 1
+ retention-days: 3
+
build-macos:
needs: generate-soh-otr
runs-on: macos-14
steps:
- - uses: actions/checkout@v4
+ - name: Git Checkout
+ uses: actions/checkout@v4
with:
submodules: true
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2.14
+ - name: Configure ccache
+ uses: hendrikmuhs/ccache-action@v1.2
with:
create-symlink: true
+ save: ${{ github.ref_name == github.event.repository.default_branch }}
key: ${{ runner.os }}-14-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-14-ccache-${{ github.ref }}
- ${{ runner.os }}-14-ccache-
+ ${{ runner.os }}-14-ccache
+ # Needed to apply sudo for macports cache restore
- name: Install gtar wrapper
run: |
sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig
- sudo cp .github/workflows//gtar /opt/homebrew/bin/gtar
+ sudo cp .github/workflows/gtar /opt/homebrew/bin/gtar
sudo chmod +x /opt/homebrew/bin/gtar
- - name: Cache MacPorts
- id: cache-macports
- uses: actions/cache@v4
+ - name: Restore Cached MacPorts
+ id: restore-cache-macports
+ uses: actions/cache/restore@v4
with:
- path: /opt/local/
- key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
+ key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}-${{ github.sha }}
restore-keys: |
+ ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}-
${{ runner.os }}-14-macports-
+ path: /opt/local/
+ # Updated PATH applies to the next step and onwards
- name: Install MacPorts (if necessary)
run: |
- if [ -d /opt/local/ ]; then
+ if command -v /opt/local/bin/port 2>&1 >/dev/null; then
echo "MacPorts already installed"
else
+ echo "Installing MacPorts"
wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg
sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target /
fi
- echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
+ echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH"
- name: Install dependencies
run: |
brew uninstall --ignore-dependencies libpng
@@ -116,11 +126,12 @@ jobs:
uses: actions/download-artifact@v4
with:
name: soh.otr
+ path: build-cmake/soh
- name: Build SoH
run: |
+ export PATH="/usr/lib/ccache:/opt/homebrew/opt/ccache/libexec:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_REMOTE_CONTROL=1
cmake --build build-cmake --config Release --parallel 10
- mv soh.otr build-cmake/soh
(cd build-cmake && cpack)
mv _packages/*.dmg SoH.dmg
@@ -132,44 +143,52 @@ jobs:
path: |
SoH.dmg
readme.txt
+ - name: Save Cache MacPorts
+ if: ${{ github.ref_name == github.event.repository.default_branch }}
+ uses: actions/cache/save@v4
+ with:
+ key: ${{ steps.restore-cache-macports.outputs.cache-primary-key }}
+ path: /opt/local/
+
build-linux:
needs: generate-soh-otr
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - name: Git Checkout
+ uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2.14
+ - name: Configure ccache
+ uses: hendrikmuhs/ccache-action@v1.2
with:
- key: linux-ccache-${{ github.ref }}-${{ github.sha }}
+ save: ${{ github.ref_name == github.event.repository.default_branch }}
+ key: ${{ runner.os }}-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
- linux-ccache-${{ github.ref }}
- linux-ccache-
- - name: Cache build folders
- uses: actions/cache@v4
+ ${{ runner.os }}-ccache-${{ github.ref }}
+ ${{ runner.os }}-ccache
+ - name: Restore Cached deps folder
+ id: restore-cache-deps
+ uses: actions/cache/restore@v4
with:
- key: linux-build-${{ github.ref }}-${{ github.sha }}
+ key: ${{ runner.os }}-deps-${{ github.ref }}-${{ github.sha }}
restore-keys: |
- linux-build-${{ github.ref }}
- linux-build-
- path: |
- SDL2-2.30.3
- SDL2_net-2.2.0
- tinyxml2-10.0.0
- libzip-1.10.1
+ ${{ runner.os }}-deps-${{ github.ref }}-
+ ${{ runner.os }}-deps-
+ path: deps
+ - name: Create deps folder
+ run: mkdir -p deps
- name: Install latest SDL
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- if [ ! -d "SDL2-2.30.3" ]; then
- wget https://www.libsdl.org/release/SDL2-2.30.3.tar.gz
- tar -xzf SDL2-2.30.3.tar.gz
+ if [ ! -d "deps/SDL2-2.30.3" ]; then
+ wget https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz
+ tar -xzf SDL2-2.30.3.tar.gz -C deps
fi
- cd SDL2-2.30.3
+ cd deps/SDL2-2.30.3
./configure --enable-hidapi-libusb
make -j 10
sudo make install
@@ -177,11 +196,11 @@ jobs:
- name: Install latest SDL_net
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- if [ ! -d "SDL2_net-2.2.0" ]; then
+ if [ ! -d "deps/SDL2_net-2.2.0" ]; then
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
- tar -xzf SDL2_net-2.2.0.tar.gz
+ tar -xzf SDL2_net-2.2.0.tar.gz -C deps
fi
- cd SDL2_net-2.2.0
+ cd deps/SDL2_net-2.2.0
./configure
make -j 10
sudo make install
@@ -190,11 +209,11 @@ jobs:
run: |
sudo apt-get remove libtinyxml2-dev
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- if [ ! -d "tinyxml2-10.0.0" ]; then
+ if [ ! -d "deps/tinyxml2-10.0.0" ]; then
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
- tar -xzf 10.0.0.tar.gz
+ tar -xzf 10.0.0.tar.gz -C deps
fi
- cd tinyxml2-10.0.0
+ cd deps/tinyxml2-10.0.0
mkdir -p build
cd build
cmake ..
@@ -203,11 +222,11 @@ jobs:
- name: Install libzip without crypto
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
- if [ ! -d "libzip-1.10.1" ]; then
+ if [ ! -d "deps/libzip-1.10.1" ]; then
wget https://github.com/nih-at/libzip/releases/download/v1.10.1/libzip-1.10.1.tar.gz
- tar -xzf libzip-1.10.1.tar.gz
+ tar -xzf libzip-1.10.1.tar.gz -C deps
fi
- cd libzip-1.10.1
+ cd deps/libzip-1.10.1
mkdir -p build
cd build
cmake .. -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF
@@ -218,6 +237,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: soh.otr
+ path: build-cmake/soh
- name: Build SoH
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
@@ -237,63 +257,73 @@ jobs:
path: |
soh.appimage
readme.txt
+ - name: Save Cache deps folder
+ if: ${{ github.ref_name == github.event.repository.default_branch }}
+ uses: actions/cache/save@v4
+ with:
+ key: ${{ steps.restore-cache-deps.outputs.cache-primary-key }}
+ path: deps
+
build-windows:
needs: generate-soh-otr
- runs-on: ${{ (vars.WINDOWS_RUNNER && fromJSON(vars.WINDOWS_RUNNER)) || 'windows-latest' }}
+ runs-on: windows-latest
steps:
- name: Install dependencies
- if: ${{ !vars.WINDOWS_RUNNER }}
run: |
- choco install ninja
+ choco install ninja -y
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
- - uses: actions/checkout@v4
+ - name: Git Checkout
+ uses: actions/checkout@v4
with:
submodules: true
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2.14
+ - name: Configure sccache
+ uses: hendrikmuhs/ccache-action@v1.2
with:
variant: sccache
- max-size: "1G"
+ max-size: "2G"
+ evict-old-files: job
+ save: ${{ github.ref_name == github.event.repository.default_branch }}
key: ${{ runner.os }}-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-${{ github.ref }}
- ${{ runner.os }}-ccache-
- - name: Cache build folder
- uses: actions/cache@v4
+ ${{ runner.os }}-ccache
+ - name: Restore Cached VCPKG folder
+ id: restore-cache-vcpkg
+ uses: actions/cache/restore@v4
with:
- key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }}
+ key: ${{ runner.os }}-vcpkg-${{ github.ref }}-${{ github.sha }}
restore-keys: |
- ${{ runner.os }}-build-${{ github.ref }}
- ${{ runner.os }}-build-
- path: |
- build-windows
- vcpkg
+ ${{ runner.os }}-vcpkg-${{ github.ref }}-
+ ${{ runner.os }}-vcpkg-
+ path: vcpkg
- name: Configure Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
+ - name: Download soh.otr
+ uses: actions/download-artifact@v4
+ with:
+ name: soh.otr
+ path: build-windows/soh
- name: Build SoH
- env:
+ env:
VCPKG_ROOT: ${{github.workspace}}/vcpkg
run: |
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DBUILD_REMOTE_CONTROL=1
cmake --build build-windows --config Release --parallel 10
- mkdir soh-windows
- mv ./x64/Release/soh.exe ./soh-windows/soh.exe
- mkdir soh-windows/debug
- mkdir soh-windows/mods
- New-Item soh-windows/mods/custom_otr_files_go_here.txt -type file
- mv ./x64/Release/soh.pdb ./soh-windows/debug/soh.pdb
- mv ./README.md ./soh-windows/readme.txt
- mv ./build-windows/gamecontrollerdb.txt ./soh-windows/gamecontrollerdb.txt
- mv ./x64/Release/assets ./soh-windows
- - name: Download soh.otr
- uses: actions/download-artifact@v4
- with:
- name: soh.otr
- path: soh-windows
+ (cd build-windows && cpack)
+ cd ..
+ mv _packages/*.zip _packages/soh-windows.zip
+ - name: Unzip package
+ run: Expand-Archive -Path _packages/soh-windows.zip -DestinationPath soh-windows
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: soh-windows
path: soh-windows
+ - name: Save Cache VCPKG folder
+ if: ${{ github.ref_name == github.event.repository.default_branch }}
+ uses: actions/cache/save@v4
+ with:
+ key: ${{ steps.restore-cache-vcpkg.outputs.cache-primary-key }}
+ path: vcpkg
diff --git a/CMake/Packaging-2.cmake b/CMake/Packaging-2.cmake
index a29635eac..dc5da1b7e 100644
--- a/CMake/Packaging-2.cmake
+++ b/CMake/Packaging-2.cmake
@@ -1,9 +1,9 @@
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
-set(CPACK_COMPONENTS_ALL "ship" "extractor" "appimage")
+set(CPACK_COMPONENTS_ALL "ship")
-if (NOT CPACK_GENERATOR STREQUAL "External")
- list(REMOVE_ITEM CPACK_COMPONENTS_ALL "appimage")
+if (CPACK_GENERATOR STREQUAL "External")
+ list(APPEND CPACK_COMPONENTS_ALL "extractor" "appimage")
endif()
if (CPACK_GENERATOR MATCHES "DEB|RPM")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3437ef3fd..7aa873c62 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,10 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-set(CMAKE_PROJECT_GIT_COMMIT_HASH "${GIT_COMMIT_HASH}" CACHE STRING "Git commit hash" FORCE)
+# Get only the first 7 characters of the hash
+string(SUBSTRING "${GIT_COMMIT_HASH}" 0 7 SHORT_COMMIT_HASH)
+
+set(CMAKE_PROJECT_GIT_COMMIT_HASH "${SHORT_COMMIT_HASH}" CACHE STRING "Git commit hash" FORCE)
execute_process(
COMMAND git describe --tags --abbrev=0 --exact-match HEAD
@@ -171,7 +174,7 @@ set_property(TARGET soh PROPERTY APPIMAGE_ICON_FILE "${CMAKE_BINARY_DIR}/sohIcon
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
install(PROGRAMS "${CMAKE_BINARY_DIR}/linux/soh.sh" DESTINATION . COMPONENT appimage)
-install(FILES "${CMAKE_SOURCE_DIR}/soh.otr" DESTINATION . COMPONENT ship)
+install(FILES "${CMAKE_BINARY_DIR}/soh/soh.otr" DESTINATION . COMPONENT ship)
install(TARGETS ZAPD DESTINATION ./assets/extractor COMPONENT extractor)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor COMPONENT extractor)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT extractor)
diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt
index b4ee6ed7f..7277b2dfb 100644
--- a/soh/CMakeLists.txt
+++ b/soh/CMakeLists.txt
@@ -440,6 +440,7 @@ if(MSVC)
/Gy;
/W3
>
+ /bigobj;
/sdl-;
/permissive-;
/MP;
diff --git a/soh/assets/custom/fonts/Inconsolata-Regular.ttf b/soh/assets/custom/fonts/Inconsolata-Regular.ttf
new file mode 100644
index 000000000..d1241516b
Binary files /dev/null and b/soh/assets/custom/fonts/Inconsolata-Regular.ttf differ
diff --git a/soh/assets/custom/fonts/Montserrat-Regular.ttf b/soh/assets/custom/fonts/Montserrat-Regular.ttf
new file mode 100644
index 000000000..f4a266dd3
Binary files /dev/null and b/soh/assets/custom/fonts/Montserrat-Regular.ttf differ
diff --git a/soh/assets/custom/objects/object_keyring/Hilite_new.rgba16 b/soh/assets/custom/objects/object_keyring/Hilite_new.rgba16
new file mode 100644
index 000000000..5438695fa
Binary files /dev/null and b/soh/assets/custom/objects/object_keyring/Hilite_new.rgba16 differ
diff --git a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL
index 3552eef1b..7cb17d889 100644
--- a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL
+++ b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL
@@ -1,11 +1,10 @@
+
+
+
+
-
-
-
-
-
diff --git a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_tri_0 b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_tri_0
index 791defa81..c7b29e9c7 100644
--- a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_tri_0
+++ b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_tri_0
@@ -1,213 +1,110 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_0 b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_0
index 1dd0cbb61..5ab0f76ec 100644
--- a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_0
+++ b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_0
@@ -1,233 +1,210 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
-
-
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
-
-
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
-
+
-
-
-
+
+
+
+
+
-
+
+
-
-
-
-
+
+
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
+
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
-
-
-
+
-
+
-
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
+
-
+
-
+
+
+
-
+
-
+
-
+
-
-
+
+
-
+
diff --git a/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_cull b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_cull
new file mode 100644
index 000000000..6ef0139b8
--- /dev/null
+++ b/soh/assets/custom/objects/object_keyring/gKeyringIconGerudoFortressDL_vtx_cull
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/soh/assets/custom/objects/object_keyring/mat_gKeyringIconGerudoFortressDL_f3dlite_IconMetal_GerudoFortress b/soh/assets/custom/objects/object_keyring/mat_gKeyringIconGerudoFortressDL_f3dlite_IconMetal_GerudoFortress
index b5755b4a8..f926de784 100644
--- a/soh/assets/custom/objects/object_keyring/mat_gKeyringIconGerudoFortressDL_f3dlite_IconMetal_GerudoFortress
+++ b/soh/assets/custom/objects/object_keyring/mat_gKeyringIconGerudoFortressDL_f3dlite_IconMetal_GerudoFortress
@@ -1,21 +1,15 @@
+
-
-
-
+
-
-
-
-
-
+
+
-
-
diff --git a/soh/assets/custom/objects/object_keyring/model.xml b/soh/assets/custom/objects/object_keyring/model.xml
new file mode 100644
index 000000000..6ef0139b8
--- /dev/null
+++ b/soh/assets/custom/objects/object_keyring/model.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/soh/include/variables.h b/soh/include/variables.h
index e3408eef6..27ad4584d 100644
--- a/soh/include/variables.h
+++ b/soh/include/variables.h
@@ -45,12 +45,12 @@ extern "C"
extern OSViContext* __osViNext;
extern OSViMode osViModeFpalLan1;
extern u32 __additional_scanline;
- extern u8 gBuildVersion[];
+ extern const char gBuildVersion[];
extern u16 gBuildVersionMajor;
extern u16 gBuildVersionMinor;
extern u16 gBuildVersionPatch;
- extern u8 gGitBranch[];
- extern u8 gGitCommitHash[];
+ extern const char gGitBranch[];
+ extern const char gGitCommitHash[];
extern u8 gGitCommitTag[];
extern u8 gBuildTeam[];
extern u8 gBuildDate[];
diff --git a/soh/soh/AboutWindow.cpp b/soh/soh/AboutWindow.cpp
deleted file mode 100644
index e5d51300c..000000000
--- a/soh/soh/AboutWindow.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-#include "AboutWindow.h"
-#include
-#include
-#include "soh/ResourceManagerHelpers.h"
-
-extern "C" {
-#include "variables.h"
-}
-
-AboutWindow::~AboutWindow() {
- SPDLOG_TRACE("destruct about window");
-}
-
-void AboutWindow::InitElement() {
- mIsTaggedVersion = gGitCommitTag[0] != 0;
-
- strncpy(mGitCommitHashTruncated, (char*)gGitCommitHash, 7);
- mGitCommitHashTruncated[7] = 0;
-}
-
-void AboutWindow::Draw() {
- if (!IsVisible()) {
- return;
- }
-
- ImGuiWindowFlags windowFlags = ImGuiWindowFlags_AlwaysAutoResize |
- ImGuiWindowFlags_NoResize |
- ImGuiWindowFlags_NoDocking |
- ImGuiWindowFlags_NoScrollWithMouse |
- ImGuiWindowFlags_NoScrollbar;
-
- ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(16 * ImGui::GetIO().FontGlobalScale, 8 * ImGui::GetIO().FontGlobalScale));
-
- if (!ImGui::Begin(GetName().c_str(), &mIsVisible, windowFlags)) {
- ImGui::End();
- } else {
- DrawElement();
- ImGui::End();
- }
-
- ImGui::PopStyleVar();
-
- // Sync up the IsVisible flag if it was changed by ImGui
- SyncVisibilityConsoleVariable();
-}
-
-const char* AboutWindow::GetGameVersionString(uint32_t index) {
- uint32_t gameVersion = ResourceMgr_GetGameVersion(index);
- switch (gameVersion) {
- case OOT_NTSC_US_10:
- return "NTSC-U 1.0";
- case OOT_NTSC_US_11:
- return "NTSC-U 1.1";
- case OOT_NTSC_US_12:
- return "NTSC-U 1.2";
- case OOT_PAL_10:
- return "PAL 1.0";
- case OOT_PAL_11:
- return "PAL 1.1";
- case OOT_PAL_GC:
- return "PAL GC";
- case OOT_PAL_MQ:
- return "PAL MQ";
- case OOT_PAL_GC_DBG1:
- case OOT_PAL_GC_DBG2:
- return "PAL GC-D";
- case OOT_PAL_GC_MQ_DBG:
- return "PAL MQ-D";
- case OOT_IQUE_CN:
- return "IQUE CN";
- case OOT_IQUE_TW:
- return "IQUE TW";
- default:
- return "UNKNOWN";
- }
-}
-
-void AboutWindow::DrawElement() {
- // The icon is already padded - adjust for that
- ImVec2 cursorPos = ImGui::GetCursorScreenPos();
- cursorPos.x -= 16 * ImGui::GetIO().FontGlobalScale;
- ImGui::SetCursorScreenPos(cursorPos);
-
- ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon"), ImVec2(64.0f * ImGui::GetIO().FontGlobalScale, 64.0f * ImGui::GetIO().FontGlobalScale));
-
- ImGui::SameLine();
-
- ImGui::BeginGroup();
- ImGui::Text("Ship of Harkinian");
- if (mIsTaggedVersion) {
- ImGui::Text("%s", gBuildVersion);
- } else {
- ImGui::Text("%s", gGitBranch);
- ImGui::Text("%s", mGitCommitHashTruncated);
- }
- ImGui::EndGroup();
-
- ImGui::Dummy(ImVec2(0, 2 * ImGui::GetIO().FontGlobalScale));
- ImGui::Text("Game Archives:");
- for (uint32_t i = 0; i < ResourceMgr_GetNumGameVersions(); i++) {
- ImGui::BulletText(GetGameVersionString(i));
- }
-}
diff --git a/soh/soh/AboutWindow.h b/soh/soh/AboutWindow.h
deleted file mode 100644
index 5a731fdc1..000000000
--- a/soh/soh/AboutWindow.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-
-#include
-
-class AboutWindow : public Ship::GuiWindow {
- public:
- using GuiWindow::GuiWindow;
- ~AboutWindow();
-
- private:
- void InitElement() override;
- void Draw() override;
- void DrawElement() override;
- void UpdateElement() override {};
-
- const char* GetGameVersionString(uint32_t index);
-
- bool mIsTaggedVersion;
- char mGitCommitHashTruncated[8];
-};
diff --git a/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp b/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp
index 20beb193a..37fed1b7d 100644
--- a/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp
+++ b/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp
@@ -10,6 +10,12 @@ void Custom_EnMThunder_Update(Actor* thisx, PlayState* play) {
f32 blueRadius;
s32 redGreen;
+ // If thunder effect doesn't exist (aka player doesn't have magic),
+ // don't do anything.
+ if (enMThunder->actionFunc == nullptr) {
+ return;
+ }
+
enMThunder->actionFunc(enMThunder, play);
// don't call this part, it's what makes the spin attack darkness happen
// func_80A9F314(play, this->unk_1BC);
diff --git a/soh/soh/Enhancements/TimeDisplay/TimeDisplay.h b/soh/soh/Enhancements/TimeDisplay/TimeDisplay.h
index 090ac2901..671577631 100644
--- a/soh/soh/Enhancements/TimeDisplay/TimeDisplay.h
+++ b/soh/soh/Enhancements/TimeDisplay/TimeDisplay.h
@@ -13,20 +13,20 @@ class TimeDisplayWindow : public Ship::GuiWindow {
void TimeDisplayUpdateDisplayOptions();
void TimeDisplayInitSettings();
-typedef enum {
+typedef enum TimerDisplay {
DISPLAY_IN_GAME_TIMER,
DISPLAY_TIME_OF_DAY,
DISPLAY_CONDITIONAL_TIMER,
DISPLAY_NAVI_TIMER
-};
+} TimerDisplay;
-typedef enum {
+typedef enum NaviTimerValues {
NAVI_PREPARE = 600,
NAVI_ACTIVE = 3000,
NAVI_COOLDOWN = 25800,
DAY_BEGINS = 17759,
NIGHT_BEGINS = 49155
-};
+} NaviTimerValues;
typedef struct {
uint32_t timeID;
diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp
index c9a999cb1..ae4236218 100644
--- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp
+++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp
@@ -20,6 +20,11 @@ static bool sEnteredBlueWarp = false;
* should also account for the difference between your first and following visits to the blue warp.
*/
void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_list originalArgs) {
+ // Do nothing when in a boss rush
+ if (IS_BOSS_RUSH) {
+ return;
+ }
+
bool overrideBlueWarpDestinations =
IS_RANDO && (RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF ||
RAND_GET_OPTION(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF);
diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp
index 7d676e6f8..2894cb914 100644
--- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp
+++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp
@@ -65,7 +65,12 @@ void SkipChildRutoInteractions_Register() {
enRu1->action = 42;
Animation_Change(&enRu1->skelAnime, (AnimationHeader*)&gRutoChildWait2Anim, 1.0f, 0,
Animation_GetLastFrame((void*)&gRutoChildWait2Anim), ANIMMODE_LOOP, -8.0f);
- enRu1->unk_28C->cameraSetting = 1;
+ // If we aren't skipping one point cutscenes and BgBdan objects has set the camera setting
+ // to CAM_SET_NORMAL1 (2), don't reset the camera setting to 1. This prevents the One Point
+ // Cutscene of Ruto getting lifted up from getting queued up twice.
+ if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), IS_RANDO) || enRu1->unk_28C->cameraSetting != 2) {
+ enRu1->unk_28C->cameraSetting = 1;
+ }
Actor* sapphire = func_80AEB124(gPlayState);
if (sapphire != NULL) {
Actor_Kill(sapphire);
diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp
index d15bc5f25..caa40c66f 100644
--- a/soh/soh/Enhancements/audio/AudioEditor.cpp
+++ b/soh/soh/Enhancements/audio/AudioEditor.cpp
@@ -12,9 +12,15 @@
#include "soh/cvar_prefixes.h"
#include
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include "AudioCollection.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
+extern "C" {
+ #include "z64save.h"
+ extern SaveContext gSaveContext;
+}
+
Vec3f pos = { 0.0f, 0.0f, 0.0f };
f32 freqScale = 1.0f;
s8 reverbAdd = 0;
@@ -165,13 +171,20 @@ void DrawPreviewButton(uint16_t sequenceId, std::string sfxKey, SeqType sequence
const std::string previewButton = ICON_FA_PLAY + hiddenKey;
if (CVarGetInteger(CVAR_AUDIO("Playing"), 0) == sequenceId) {
- if (ImGui::Button(stopButton.c_str())) {
+ if (UIWidgets::Button(stopButton.c_str(), UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(10.0f, 6.0f))
+ .Tooltip("Stop Preview")
+ .Color(THEME_COLOR))) {
func_800F5C2C();
CVarSetInteger(CVAR_AUDIO("Playing"), 0);
}
- UIWidgets::Tooltip("Stop Preview");
} else {
- if (ImGui::Button(previewButton.c_str())) {
+ if (UIWidgets::Button(previewButton.c_str(), UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(10.0f, 6.0f))
+ .Tooltip("Play Preview")
+ .Color(THEME_COLOR))) {
if (CVarGetInteger(CVAR_AUDIO("Playing"), 0) != 0) {
func_800F5C2C();
CVarSetInteger(CVAR_AUDIO("Playing"), 0);
@@ -188,11 +201,10 @@ void DrawPreviewButton(uint16_t sequenceId, std::string sfxKey, SeqType sequence
}
}
}
- UIWidgets::Tooltip("Play Preview");
}
}
-void Draw_SfxTab(const std::string& tabId, SeqType type) {
+void Draw_SfxTab(const std::string& tabId, SeqType type, const std::string& tabName) {
const std::map& map = AudioCollection::Instance->GetAllSequences();
const std::string hiddenTabId = "##" + tabId;
@@ -200,7 +212,10 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
const std::string randomizeAllButton = "Randomize All" + hiddenTabId;
const std::string lockAllButton = "Lock All" + hiddenTabId;
const std::string unlockAllButton = "Unlock All" + hiddenTabId;
- if (ImGui::Button(resetAllButton.c_str())) {
+
+ ImGui::SeparatorText(tabName.c_str());
+ if (UIWidgets::Button(resetAllButton.c_str(),
+ UIWidgets::ButtonOptions().Size(UIWidgets::Sizes::Inline).Color(THEME_COLOR))) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
ResetGroup(map, type);
@@ -211,7 +226,8 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
}
}
ImGui::SameLine();
- if (ImGui::Button(randomizeAllButton.c_str())) {
+ if (UIWidgets::Button(randomizeAllButton.c_str(),
+ UIWidgets::ButtonOptions().Size(UIWidgets::Sizes::Inline).Color(THEME_COLOR))) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
RandomizeGroup(type);
@@ -222,7 +238,8 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
}
}
ImGui::SameLine();
- if (ImGui::Button(lockAllButton.c_str())) {
+ if (UIWidgets::Button(lockAllButton.c_str(),
+ UIWidgets::ButtonOptions().Size(UIWidgets::Sizes::Inline).Color(THEME_COLOR))) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
LockGroup(map, type);
@@ -233,7 +250,8 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
}
}
ImGui::SameLine();
- if (ImGui::Button(unlockAllButton.c_str())) {
+ if (UIWidgets::Button(unlockAllButton.c_str(),
+ UIWidgets::ButtonOptions().Size(UIWidgets::Sizes::Inline).Color(THEME_COLOR))) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
UnlockGroup(map, type);
@@ -244,10 +262,12 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
}
}
+ // Longest text in Audio Editor
+ ImVec2 columnSize = ImGui::CalcTextSize("Navi - Look/Hey/Watchout (Target Enemy)");
ImGui::BeginTable(tabId.c_str(), 3, ImGuiTableFlags_SizingFixedFit);
- ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
- ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
- ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 100.0f);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, columnSize.x + 30);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, columnSize.x + 30);
+ ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 160.0f);
for (const auto& [defaultValue, seqData] : map) {
if (~(seqData.category) & type) {
continue;
@@ -273,6 +293,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::TableNextColumn();
ImGui::PushItemWidth(-FLT_MIN);
const int initialValue = map.contains(currentValue) ? currentValue : defaultValue;
+ UIWidgets::PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo(hiddenKey.c_str(), map.at(initialValue).label.c_str())) {
for (const auto& [value, seqData] : map) {
// If excluded as a replacement sequence, don't show in other dropdowns except the effect's own dropdown.
@@ -293,22 +314,30 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::EndCombo();
}
+ UIWidgets::PopStyleCombobox();
ImGui::TableNextColumn();
ImGui::PushItemWidth(-FLT_MIN);
DrawPreviewButton((type == SEQ_SFX || type == SEQ_VOICE || type == SEQ_INSTRUMENT) ? defaultValue : currentValue, seqData.sfxKey, type);
auto locked = CVarGetInteger(cvarLockKey.c_str(), 0) == 1;
ImGui::SameLine();
ImGui::PushItemWidth(-FLT_MIN);
- if (ImGui::Button(resetButton.c_str())) {
+ if (UIWidgets::Button(resetButton.c_str(), UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(10.0f, 6.0f))
+ .Tooltip("Reset to default")
+ .Color(THEME_COLOR))) {
CVarClear(cvarKey.c_str());
CVarClear(cvarLockKey.c_str());
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
UpdateCurrentBGM(defaultValue, seqData.category);
}
- UIWidgets::Tooltip("Reset to default");
ImGui::SameLine();
ImGui::PushItemWidth(-FLT_MIN);
- if (ImGui::Button(randomizeButton.c_str())) {
+ if (UIWidgets::Button(randomizeButton.c_str(), UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(10.0f, 6.0f))
+ .Tooltip("Randomize this sound")
+ .Color(THEME_COLOR))) {
std::vector validSequences = {};
for (const auto seqInfo : AudioCollection::Instance->GetIncludedSequences()) {
if (seqInfo->category & type) {
@@ -327,10 +356,14 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
UpdateCurrentBGM(defaultValue, type);
}
}
- UIWidgets::Tooltip("Randomize this sound");
ImGui::SameLine();
ImGui::PushItemWidth(-FLT_MIN);
- if (ImGui::Button(locked ? lockedButton.c_str() : unlockedButton.c_str())) {
+ if (UIWidgets::Button(locked ? lockedButton.c_str() : unlockedButton.c_str(),
+ UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(10.0f, 6.0f))
+ .Tooltip(locked ? "Sound locked" : "Sound unlocked")
+ .Color(THEME_COLOR))) {
if (locked) {
CVarClear(cvarLockKey.c_str());
} else {
@@ -338,7 +371,6 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
}
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
- UIWidgets::Tooltip(locked ? "Sound locked" : "Sound unlocked");
}
ImGui::EndTable();
}
@@ -401,10 +433,11 @@ ImVec4 GetSequenceTypeColor(SeqType type) {
}
}
-void DrawTypeChip(SeqType type) {
+void DrawTypeChip(SeqType type, std::string sequenceName) {
ImGui::BeginDisabled();
ImGui::PushStyleColor(ImGuiCol_Button, GetSequenceTypeColor(type));
- ImGui::SmallButton(GetSequenceTypeName(type).c_str());
+ std::string buttonLabel = GetSequenceTypeName(type) + "##" + sequenceName;
+ ImGui::Button(buttonLabel.c_str());
ImGui::PopStyleColor();
ImGui::EndDisabled();
}
@@ -412,7 +445,7 @@ void DrawTypeChip(SeqType type) {
void AudioEditorRegisterOnSceneInitHook() {
GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) {
- if (CVarGetInteger(CVAR_AUDIO("RandomizeAllOnNewScene"), 0)) {
+ if (gSaveContext.gameMode != GAMEMODE_END_CREDITS && CVarGetInteger(CVAR_AUDIO("RandomizeAllOnNewScene"), 0)) {
AudioEditor_RandomizeAll();
}
});
@@ -425,114 +458,113 @@ void AudioEditor::InitElement() {
void AudioEditor::DrawElement() {
AudioCollection::Instance->InitializeShufflePool();
- float buttonSegments = ImGui::GetContentRegionAvail().x / 4;
- if (ImGui::Button("Randomize All Groups", ImVec2(buttonSegments, 30.0f))) {
+ UIWidgets::Separator();
+ if (UIWidgets::Button("Randomize All Groups",
+ UIWidgets::ButtonOptions()
+ .Size(ImVec2(230.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("Randomizes all unlocked music and sound effects across tab groups"))) {
AudioEditor_RandomizeAll();
}
- UIWidgets::Tooltip("Randomizes all unlocked music and sound effects across tab groups");
ImGui::SameLine();
- if (ImGui::Button("Reset All Groups", ImVec2(buttonSegments, 30.0f))) {
+ if (UIWidgets::Button("Reset All Groups",
+ UIWidgets::ButtonOptions()
+ .Size(ImVec2(230.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("Resets all unlocked music and sound effects across tab groups"))) {
AudioEditor_ResetAll();
}
- UIWidgets::Tooltip("Resets all unlocked music and sound effects across tab groups");
ImGui::SameLine();
- if (ImGui::Button("Lock All Groups", ImVec2(buttonSegments, 30.0f))) {
+ if (UIWidgets::Button("Lock All Groups", UIWidgets::ButtonOptions()
+ .Size(ImVec2(230.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("Locks all music and sound effects across tab groups"))) {
AudioEditor_LockAll();
}
- UIWidgets::Tooltip("Locks all music and sound effects across tab groups");
ImGui::SameLine();
- if (ImGui::Button("Unlock All Groups", ImVec2(buttonSegments, 30.0f))) {
+ if (UIWidgets::Button("Unlock All Groups",
+ UIWidgets::ButtonOptions()
+ .Size(ImVec2(230.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("Unlocks all music and sound effects across tab groups"))) {
AudioEditor_UnlockAll();
}
- UIWidgets::Tooltip("Unlocks all music and sound effects across tab groups");
-
+ UIWidgets::Separator();
+ UIWidgets::PushStyleTabs(THEME_COLOR);
if (ImGui::BeginTabBar("SfxContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
- if (ImGui::BeginTabItem("Background Music")) {
- Draw_SfxTab("backgroundMusic", SEQ_BGM_WORLD);
- ImGui::EndTabItem();
- }
- if (ImGui::BeginTabItem("Fanfares")) {
- Draw_SfxTab("fanfares", SEQ_FANFARE);
- ImGui::EndTabItem();
- }
- if (ImGui::BeginTabItem("Events")) {
- Draw_SfxTab("event", SEQ_BGM_EVENT);
- ImGui::EndTabItem();
- }
- if (ImGui::BeginTabItem("Battle Music")) {
- Draw_SfxTab("battleMusic", SEQ_BGM_BATTLE);
- ImGui::EndTabItem();
- }
- if (ImGui::BeginTabItem("Ocarina")) {
- Draw_SfxTab("instrument", SEQ_INSTRUMENT);
- Draw_SfxTab("ocarina", SEQ_OCARINA);
- ImGui::EndTabItem();
- }
- if (ImGui::BeginTabItem("Sound Effects")) {
- Draw_SfxTab("sfx", SEQ_SFX);
- ImGui::EndTabItem();
- }
- if (ImGui::BeginTabItem("Voices")) {
- Draw_SfxTab("voice", SEQ_VOICE);
- ImGui::EndTabItem();
- }
-
+
static ImVec2 cellPadding(8.0f, 8.0f);
- if (ImGui::BeginTabItem("Options")) {
+ if (ImGui::BeginTabItem("Audio Options")) {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
- ImGui::BeginTable("Options", 1, ImGuiTableFlags_SizingStretchSame);
+ ImGui::BeginTable("Audio Options", 1, ImGuiTableFlags_SizingStretchSame);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthStretch);
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::BeginChild("SfxOptions", ImVec2(0, -8))) {
- ImGui::PushItemWidth(-FLT_MIN);
- UIWidgets::EnhancementCheckbox("Disable Enemy Proximity Music", CVAR_AUDIO("EnemyBGMDisable"));
- UIWidgets::InsertHelpHoverText(
- "Disables the music change when getting close to enemies. Useful for hearing "
- "your custom music for each scene more often.");
- UIWidgets::EnhancementCheckbox("Disable Leading Music in Lost Woods", CVAR_AUDIO("LostWoodsConsistentVolume"));
- UIWidgets::InsertHelpHoverText(
- "Disables the volume shifting in the Lost Woods. Useful for hearing "
- "your custom music in the Lost Woods if you don't need the navigation assitance "
- "the volume changing provides. If toggling this while in the Lost Woods, reload "
- "the area for the effect to kick in."
- );
- UIWidgets::EnhancementCheckbox("Display Sequence Name on Overlay", CVAR_AUDIO("SeqNameOverlay"));
- UIWidgets::InsertHelpHoverText(
- "Displays the name of the current sequence in the corner of the screen whenever a new sequence "
- "is loaded to the main sequence player (does not apply to fanfares or enemy BGM)."
- );
+ UIWidgets::CVarCheckbox(
+ "Mute Low HP Alarm", CVAR_AUDIO("LowHpAlarm"),
+ UIWidgets::CheckboxOptions().Color(THEME_COLOR).Tooltip("Disable the low HP beeping sound."));
+ UIWidgets::CVarCheckbox("Disable Navi Call Audio", CVAR_AUDIO("DisableNaviCallAudio"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Disables the voice audio when Navi calls you."));
+ UIWidgets::CVarCheckbox(
+ "Disable Enemy Proximity Music", CVAR_AUDIO("EnemyBGMDisable"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Disables the music change when getting close to enemies. Useful for hearing "
+ "your custom music for each scene more often."));
+ UIWidgets::CVarCheckbox(
+ "Disable Leading Music in Lost Woods", CVAR_AUDIO("LostWoodsConsistentVolume"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Disables the volume shifting in the Lost Woods. Useful for hearing "
+ "your custom music in the Lost Woods if you don't need the navigation assitance "
+ "the volume changing provides. If toggling this while in the Lost Woods, reload "
+ "the area for the effect to kick in."));
+ UIWidgets::CVarCheckbox(
+ "Display Sequence Name on Overlay", CVAR_AUDIO("SeqNameOverlay"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Displays the name of the current sequence in the corner of the screen whenever a new "
+ "sequence "
+ "is loaded to the main sequence player (does not apply to fanfares or enemy BGM)."));
+ UIWidgets::CVarSliderInt("Overlay Duration: %d seconds", CVAR_AUDIO("SeqNameOverlayDuration"),
+ UIWidgets::IntSliderOptions()
+ .Min(1)
+ .Max(10)
+ .DefaultValue(5)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
+ UIWidgets::CVarSliderFloat("Link's voice pitch multiplier", CVAR_AUDIO("LinkVoiceFreqMultiplier"),
+ UIWidgets::FloatSliderOptions()
+ .IsPercentage()
+ .Min(0.4f)
+ .Max(2.5f)
+ .DefaultValue(1.0f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
ImGui::SameLine();
- ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
- UIWidgets::EnhancementSliderInt("Overlay Duration: %d seconds", "##SeqNameOverlayDuration",
- CVAR_AUDIO("SeqNameOverlayDuration"), 1, 10, "", 5);
- ImGui::PopItemWidth();
- ImGui::NewLine();
- ImGui::PopItemWidth();
- UIWidgets::EnhancementSliderFloat("Link's voice pitch multiplier: %.1f %%", "##linkVoiceFreqMultiplier",
- CVAR_AUDIO("LinkVoiceFreqMultiplier"), 0.4, 2.5, "", 1.0, true, true);
- ImGui::SameLine();
- const std::string resetButton = "Reset##linkVoiceFreqMultiplier";
- if (ImGui::Button(resetButton.c_str())) {
+ ImGui::SetCursorPosY(ImGui::GetCursorPos().y + 40.f);
+ if (UIWidgets::Button("Reset##linkVoiceFreqMultiplier",
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
CVarSetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0f);
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
-
- ImGui::NewLine();
- UIWidgets::EnhancementCheckbox("Randomize All Music and Sound Effects on New Scene", CVAR_AUDIO("RandomizeAllOnNewScene"));
- UIWidgets::Tooltip("Enables randomizing all unlocked music and sound effects when you enter a new scene.");
-
- ImGui::NewLine();
- ImGui::PushItemWidth(-FLT_MIN);
- UIWidgets::PaddedSeparator();
- UIWidgets::PaddedText("The following options are experimental and may cause music\nto sound odd or have other undesireable effects.");
- UIWidgets::EnhancementCheckbox("Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"));
- UIWidgets::InsertHelpHoverText("Some custom sequences may have notes that are too high for the game's audio "
- "engine to play. Enabling this checkbox will cause these notes to drop a "
- "couple of octaves so they can still harmonize with the other notes of the "
- "sequence.");
- ImGui::PopItemWidth();
+ UIWidgets::CVarCheckbox(
+ "Randomize All Music and Sound Effects on New Scene", CVAR_AUDIO("RandomizeAllOnNewScene"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip(
+ "Enables randomizing all unlocked music and sound effects when you enter a new scene."));
+ UIWidgets::CVarCheckbox(
+ "Lower Octaves of Unplayable High Notes", CVAR_AUDIO("ExperimentalOctaveDrop"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Some custom sequences may have notes that are too high for the game's audio "
+ "engine to play. Enabling this checkbox will cause these notes to drop a "
+ "couple of octaves so they can still harmonize with the other notes of the "
+ "sequence."));
}
ImGui::EndChild();
ImGui::EndTable();
@@ -540,6 +572,36 @@ void AudioEditor::DrawElement() {
ImGui::EndTabItem();
}
+ if (ImGui::BeginTabItem("Background Music")) {
+ Draw_SfxTab("backgroundMusic", SEQ_BGM_WORLD, "Background Music");
+ ImGui::EndTabItem();
+ }
+ if (ImGui::BeginTabItem("Fanfares")) {
+ Draw_SfxTab("fanfares", SEQ_FANFARE, "Fanfares");
+ ImGui::EndTabItem();
+ }
+ if (ImGui::BeginTabItem("Events")) {
+ Draw_SfxTab("event", SEQ_BGM_EVENT, "Events");
+ ImGui::EndTabItem();
+ }
+ if (ImGui::BeginTabItem("Battle Music")) {
+ Draw_SfxTab("battleMusic", SEQ_BGM_BATTLE, "Battle Music");
+ ImGui::EndTabItem();
+ }
+ if (ImGui::BeginTabItem("Ocarina")) {
+ Draw_SfxTab("instrument", SEQ_INSTRUMENT, "Instruments");
+ Draw_SfxTab("ocarina", SEQ_OCARINA, "Ocarina");
+ ImGui::EndTabItem();
+ }
+ if (ImGui::BeginTabItem("Sound Effects")) {
+ Draw_SfxTab("sfx", SEQ_SFX, "Sound Effects");
+ ImGui::EndTabItem();
+ }
+ if (ImGui::BeginTabItem("Voices")) {
+ Draw_SfxTab("voice", SEQ_VOICE, "Voices");
+ ImGui::EndTabItem();
+ }
+
static bool excludeTabOpen = false;
if (ImGui::BeginTabItem("Audio Shuffle Pool Management")) {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
@@ -564,9 +626,12 @@ void AudioEditor::DrawElement() {
std::set seqsToExclude = {};
static ImGuiTextFilter sequenceSearch;
+ UIWidgets::PushStyleInput(THEME_COLOR);
sequenceSearch.Draw("Filter (inc,-exc)", 490.0f);
+ UIWidgets::PopStyleInput();
ImGui::SameLine();
- if (ImGui::Button("Exclude All")) {
+ if (UIWidgets::Button("Exclude All",
+ UIWidgets::ButtonOptions().Size(UIWidgets::Sizes::Inline).Color(THEME_COLOR))) {
for (auto seqInfo : AudioCollection::Instance->GetIncludedSequences()) {
if (sequenceSearch.PassFilter(seqInfo->label.c_str()) && showType[seqInfo->category]) {
seqsToExclude.insert(seqInfo);
@@ -574,7 +639,8 @@ void AudioEditor::DrawElement() {
}
}
ImGui::SameLine();
- if (ImGui::Button("Include All")) {
+ if (UIWidgets::Button("Include All",
+ UIWidgets::ButtonOptions().Size(UIWidgets::Sizes::Inline).Color(THEME_COLOR))) {
for (auto seqInfo : AudioCollection::Instance->GetExcludedSequences()) {
if (sequenceSearch.PassFilter(seqInfo->label.c_str()) && showType[seqInfo->category]) {
seqsToInclude.insert(seqInfo);
@@ -643,13 +709,17 @@ void AudioEditor::DrawElement() {
ImGui::BeginChild("ChildIncludedSequences", ImVec2(0, -8));
for (auto seqInfo : AudioCollection::Instance->GetIncludedSequences()) {
if (sequenceSearch.PassFilter(seqInfo->label.c_str()) && showType[seqInfo->category]) {
- if (ImGui::Button(std::string(ICON_FA_TIMES "##" + seqInfo->sfxKey).c_str())) {
+ if (UIWidgets::Button(std::string(ICON_FA_TIMES "##" + seqInfo->sfxKey).c_str(),
+ UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(9.0f, 6.0f))
+ .Color(THEME_COLOR))) {
seqsToExclude.insert(seqInfo);
}
ImGui::SameLine();
DrawPreviewButton(seqInfo->sequenceId, seqInfo->sfxKey, seqInfo->category);
ImGui::SameLine();
- DrawTypeChip(seqInfo->category);
+ DrawTypeChip(seqInfo->category, seqInfo->label);
ImGui::SameLine();
ImGui::Text("%s", seqInfo->label.c_str());
}
@@ -667,13 +737,17 @@ void AudioEditor::DrawElement() {
ImGui::BeginChild("ChildExcludedSequences", ImVec2(0, -8));
for (auto seqInfo : AudioCollection::Instance->GetExcludedSequences()) {
if (sequenceSearch.PassFilter(seqInfo->label.c_str()) && showType[seqInfo->category]) {
- if (ImGui::Button(std::string(ICON_FA_PLUS "##" + seqInfo->sfxKey).c_str())) {
+ if (UIWidgets::Button(std::string(ICON_FA_PLUS "##" + seqInfo->sfxKey).c_str(),
+ UIWidgets::ButtonOptions()
+ .Size(UIWidgets::Sizes::Inline)
+ .Padding(ImVec2(9.0f, 6.0f))
+ .Color(THEME_COLOR))) {
seqsToInclude.insert(seqInfo);
}
ImGui::SameLine();
DrawPreviewButton(seqInfo->sequenceId, seqInfo->sfxKey, seqInfo->category);
ImGui::SameLine();
- DrawTypeChip(seqInfo->category);
+ DrawTypeChip(seqInfo->category, seqInfo->sfxKey);
ImGui::SameLine();
ImGui::Text("%s", seqInfo->label.c_str());
}
@@ -695,6 +769,7 @@ void AudioEditor::DrawElement() {
ImGui::EndTabBar();
}
+ UIWidgets::PopStyleTabs();
}
std::vector allTypes = { SEQ_BGM_WORLD, SEQ_BGM_EVENT, SEQ_BGM_BATTLE, SEQ_OCARINA, SEQ_FANFARE, SEQ_INSTRUMENT, SEQ_SFX, SEQ_VOICE };
diff --git a/soh/soh/Enhancements/controls/InputViewer.cpp b/soh/soh/Enhancements/controls/InputViewer.cpp
index 5f650a25f..d26de6719 100644
--- a/soh/soh/Enhancements/controls/InputViewer.cpp
+++ b/soh/soh/Enhancements/controls/InputViewer.cpp
@@ -10,31 +10,25 @@
#include
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
+
+using namespace UIWidgets;
// Text colors
-static ImVec4 textColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
-static ImVec4 range1Color = ImVec4(1.0f, 0.7f, 0, 1.0f);
-static ImVec4 range2Color = ImVec4(0, 1.0f, 0, 1.0f);
+static Color_RGBA8 textColorDefault = { 255, 255, 255, 255 };
+static Color_RGBA8 range1ColorDefault = { 255, 178, 0, 255 };
+static Color_RGBA8 range2ColorDefault = { 0, 255, 0, 255 };
-static const char* buttonOutlineOptions[4] = { "Always Shown", "Shown Only While Not Pressed",
- "Shown Only While Pressed", "Always Hidden" };
-static const char* buttonOutlineOptionsVerbose[4] = { "Outline Always Shown", "Outline Shown Only While Not Pressed",
- "Outline Shown Only While Pressed", "Outline Always Hidden" };
+static std::unordered_map buttonOutlineOptions =
+ {{ BUTTON_OUTLINE_ALWAYS_SHOWN, "Always Shown" }, { BUTTON_OUTLINE_NOT_PRESSED, "Shown Only While Not Pressed" },
+ { BUTTON_OUTLINE_PRESSED, "Shown Only While Pressed" }, { BUTTON_OUTLINE_ALWAYS_HIDDEN, "Always Hidden" }};
+static std::unordered_map buttonOutlineOptionsVerbose =
+ {{ BUTTON_OUTLINE_ALWAYS_SHOWN, "Outline Always Shown" }, { BUTTON_OUTLINE_NOT_PRESSED, "Outline Shown Only While Not Pressed" },
+ { BUTTON_OUTLINE_PRESSED, "Outline Shown Only While Pressed" }, { BUTTON_OUTLINE_ALWAYS_HIDDEN, "Outline Always Hidden" }};
-static const char* stickModeOptions[3] = { "Always", "While In Use", "Never" };
-
-static Color_RGBA8 vec2Color(ImVec4 vec) {
- Color_RGBA8 color;
- color.r = vec.x * 255.0;
- color.g = vec.y * 255.0;
- color.b = vec.z * 255.0;
- color.a = vec.w * 255.0;
- return color;
-}
-
-static ImVec4 color2Vec(Color_RGBA8 color) {
- return ImVec4(color.r / 255.0, color.g / 255.0, color.b / 255.0, color.a / 255.0);
-}
+static std::unordered_map stickModeOptions =
+ {{ STICK_MODE_ALWAYS_SHOWN, "Always" }, { STICK_MODE_HIDDEN_IN_DEADZONE, "While In Use" }, { STICK_MODE_ALWAYS_HIDDEN, "Never" }};
InputViewer::~InputViewer() {
SPDLOG_TRACE("destruct input viewer");
@@ -399,17 +393,17 @@ void InputViewer::DrawElement() {
(rSquared >= (range1Min * range1Min)) && (rSquared < (range1Max * range1Max))) {
ImGui::PushStyleColor(
ImGuiCol_Text,
- color2Vec(CVarGetColor(CVAR_INPUT_VIEWER("AnalogAngles.Range1.Color"), vec2Color(range1Color))));
+ VecFromRGBA8(CVarGetColor(CVAR_INPUT_VIEWER("AnalogAngles.Range1.Color.Value"), range1ColorDefault)));
}
else if (CVarGetInteger(CVAR_INPUT_VIEWER("AnalogAngles.Range2.Enabled"), 0) &&
(rSquared >= (range2Min * range2Min)) && (rSquared < (range2Max * range2Max))) {
ImGui::PushStyleColor(
ImGuiCol_Text,
- color2Vec(CVarGetColor(CVAR_INPUT_VIEWER("AnalogAngles.Range2.Color"), vec2Color(range2Color))));
+ VecFromRGBA8(CVarGetColor(CVAR_INPUT_VIEWER("AnalogAngles.Range2.Color.Value"), range2ColorDefault)));
}
else {
- ImGui::PushStyleColor(ImGuiCol_Text, color2Vec(CVarGetColor(CVAR_INPUT_VIEWER("AnalogAngles.TextColor"),
- vec2Color(textColor))));
+ ImGui::PushStyleColor(ImGuiCol_Text, VecFromRGBA8(CVarGetColor(CVAR_INPUT_VIEWER("AnalogAngles.TextColor.Value"),
+ textColorDefault)));
}
// Render text
@@ -434,158 +428,139 @@ InputViewerSettingsWindow::~InputViewerSettingsWindow() {
}
void InputViewerSettingsWindow::DrawElement() {
- // gInputViewer.Scale
- UIWidgets::EnhancementSliderFloat("Input Viewer Scale: %.2f", "##Input", CVAR_INPUT_VIEWER("Scale"), 0.1f, 5.0f, "",
- 1.0f, false, true);
- UIWidgets::Tooltip("Sets the on screen size of the input viewer");
+ // gInputViewer.Scale
+ CVarSliderFloat("Input Viewer Scale: %.2f", CVAR_INPUT_VIEWER("Scale"),
+ FloatSliderOptions().Color(THEME_COLOR).DefaultValue(1.0f).Min(0.1f).Max(5.0f).ShowButtons(true).Tooltip("Sets the on screen size of the input viewer"));
// gInputViewer.EnableDragging
- UIWidgets::EnhancementCheckbox("Enable Dragging", CVAR_INPUT_VIEWER("EnableDragging"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Enable Dragging", CVAR_INPUT_VIEWER("EnableDragging"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
UIWidgets::PaddedSeparator(true, true);
// gInputViewer.ShowBackground
- UIWidgets::EnhancementCheckbox("Show Background Layer", CVAR_INPUT_VIEWER("ShowBackground"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show Background Layer", CVAR_INPUT_VIEWER("ShowBackground"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
UIWidgets::PaddedSeparator(true, true);
+ PushStyleHeader(THEME_COLOR);
if (ImGui::CollapsingHeader("Buttons")) {
// gInputViewer.ButtonOutlineMode
- UIWidgets::PaddedText("Button Outlines/Backgrounds", true, false);
- UIWidgets::EnhancementCombobox(
- CVAR_INPUT_VIEWER("ButtonOutlineMode"), buttonOutlineOptions, BUTTON_OUTLINE_NOT_PRESSED,
- !CVarGetInteger(CVAR_INPUT_VIEWER("UseGlobalButtonOutlineMode"), 1), "",
- CVarGetInteger(CVAR_INPUT_VIEWER("ButtonOutlineMode"), BUTTON_OUTLINE_NOT_PRESSED));
- UIWidgets::Tooltip(
- "Sets the desired visibility behavior for the button outline/background layers. Useful for "
- "custom input viewers.");
+ CVarCombobox("Button Outlines/Backgrounds", CVAR_INPUT_VIEWER("ButtonOutlineMode"), buttonOutlineOptions,
+ ComboboxOptions({{ .disabled = !CVarGetInteger(CVAR_INPUT_VIEWER("UseGlobalButtonOutlineMode"), 1), .disabledTooltip = "Disabled because Global Button Outline is off" }})
+ .Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED)
+ .Tooltip("Sets the desired visibility behavior for the button outline/background layers. Useful for "
+ "custom input viewers."));
// gInputViewer.UseGlobalButtonOutlineMode
- UIWidgets::EnhancementCheckbox("Use for all buttons", CVAR_INPUT_VIEWER("UseGlobalButtonOutlineMode"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Use for all buttons", CVAR_INPUT_VIEWER("UseGlobalButtonOutlineMode"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
UIWidgets::PaddedSeparator();
bool useIndividualOutlines = !CVarGetInteger(CVAR_INPUT_VIEWER("UseGlobalButtonOutlineMode"), 1);
// gInputViewer.ABtn
- UIWidgets::EnhancementCheckbox("Show A-Button Layers", CVAR_INPUT_VIEWER("ABtn"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show A-Button Layers", CVAR_INPUT_VIEWER("ABtn"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("ABtn"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("ABtnOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##ABtnOutline", CVAR_INPUT_VIEWER("ABtnOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.BBtn
- UIWidgets::EnhancementCheckbox("Show B-Button Layers", CVAR_INPUT_VIEWER("BBtn"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show B-Button Layers", CVAR_INPUT_VIEWER("BBtn"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("BBtn"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("BBtnOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##BBtnOutline", CVAR_INPUT_VIEWER("BBtnOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.CUp
- UIWidgets::EnhancementCheckbox("Show C-Up Layers", CVAR_INPUT_VIEWER("CUp"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show C-Up Layers", CVAR_INPUT_VIEWER("CUp"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("CUp"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("CUpOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##CUpOutline", CVAR_INPUT_VIEWER("CUpOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.CRight
- UIWidgets::EnhancementCheckbox("Show C-Right Layers", CVAR_INPUT_VIEWER("CRight"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show C-Right Layers", CVAR_INPUT_VIEWER("CRight"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("CRight"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("CRightOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##CRightOutline", CVAR_INPUT_VIEWER("CRightOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.CDown
- UIWidgets::EnhancementCheckbox("Show C-Down Layers", CVAR_INPUT_VIEWER("CDown"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show C-Down Layers", CVAR_INPUT_VIEWER("CDown"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("CDown"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("CDownOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##CDownOutline", CVAR_INPUT_VIEWER("CDownOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.CLeft
- UIWidgets::EnhancementCheckbox("Show C-Left Layers", CVAR_INPUT_VIEWER("CLeft"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show C-Left Layers", CVAR_INPUT_VIEWER("CLeft"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("CLeft"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("CLeftOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##CLeftOutline", CVAR_INPUT_VIEWER("CLeftOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.LBtn
- UIWidgets::EnhancementCheckbox("Show L-Button Layers", CVAR_INPUT_VIEWER("LBtn"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show L-Button Layers", CVAR_INPUT_VIEWER("LBtn"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("LBtn"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("LBtnOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##LBtnOutline", CVAR_INPUT_VIEWER("LBtnOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.RBtn
- UIWidgets::EnhancementCheckbox("Show R-Button Layers", CVAR_INPUT_VIEWER("RBtn"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show R-Button Layers", CVAR_INPUT_VIEWER("RBtn"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("RBtn"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("RBtnOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##RBtnOutline", CVAR_INPUT_VIEWER("RBtnOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.ZBtn
- UIWidgets::EnhancementCheckbox("Show Z-Button Layers", CVAR_INPUT_VIEWER("ZBtn"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show Z-Button Layers", CVAR_INPUT_VIEWER("ZBtn"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("ZBtn"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("ZBtnOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##ZBtnOutline", CVAR_INPUT_VIEWER("ZBtnOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.StartBtn
- UIWidgets::EnhancementCheckbox("Show Start Button Layers", CVAR_INPUT_VIEWER("StartBtn"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, true);
+ CVarCheckbox("Show Start Button Layers", CVAR_INPUT_VIEWER("StartBtn"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("StartBtn"), 1)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("StartBtnOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##StartBtnOutline", CVAR_INPUT_VIEWER("StartBtnOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.Dpad
- UIWidgets::EnhancementCheckbox("Show D-Pad Layers", CVAR_INPUT_VIEWER("Dpad"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, false);
+ CVarCheckbox("Show D-Pad Layers", CVAR_INPUT_VIEWER("Dpad"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("Dpad"), 0)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("DpadOutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##DpadOutline", CVAR_INPUT_VIEWER("DpadOutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.Mod1
- UIWidgets::EnhancementCheckbox("Show Modifier Button 1 Layers", CVAR_INPUT_VIEWER("Mod1"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, false);
+ CVarCheckbox("Show Modifier Button 1 Layers", CVAR_INPUT_VIEWER("Mod1"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("Mod1"), 0)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("Mod1OutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##Mmod1Outline", CVAR_INPUT_VIEWER("Mod1OutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
// gInputViewer.Mod2
- UIWidgets::EnhancementCheckbox("Show Modifier Button 2 Layers", CVAR_INPUT_VIEWER("Mod2"), false, "",
- UIWidgets::CheckboxGraphics::Checkmark, false);
+ CVarCheckbox("Show Modifier Button 2 Layers", CVAR_INPUT_VIEWER("Mod2"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true));
if (useIndividualOutlines && CVarGetInteger(CVAR_INPUT_VIEWER("Mod2"), 0)) {
ImGui::Indent();
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("Mod2OutlineMode"), buttonOutlineOptionsVerbose,
- BUTTON_OUTLINE_NOT_PRESSED);
+ CVarCombobox("##Mod2Outline", CVAR_INPUT_VIEWER("Mod2OutlineMode"), buttonOutlineOptionsVerbose,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(BUTTON_OUTLINE_NOT_PRESSED));
ImGui::Unindent();
}
@@ -594,90 +569,74 @@ void InputViewerSettingsWindow::DrawElement() {
if (ImGui::CollapsingHeader("Analog Stick")) {
// gInputViewer.AnalogStick.VisibilityMode
- UIWidgets::PaddedText("Analog Stick Visibility", true, false);
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("AnalogStick.VisibilityMode"), stickModeOptions,
- STICK_MODE_ALWAYS_SHOWN);
- UIWidgets::Tooltip(
- "Determines the conditions under which the moving layer of the analog stick texture is visible.");
+ CVarCombobox("Analog Stick Visibility", CVAR_INPUT_VIEWER("AnalogStick.VisibilityMode"), stickModeOptions,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(STICK_MODE_ALWAYS_SHOWN)
+ .Tooltip("Determines the conditions under which the moving layer of the analog stick texture is visible."));
// gInputViewer.AnalogStick.OutlineMode
- UIWidgets::PaddedText("Analog Stick Outline/Background Visibility", true, false);
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("AnalogStick.OutlineMode"), stickModeOptions,
- STICK_MODE_ALWAYS_SHOWN);
- UIWidgets::Tooltip(
- "Determines the conditions under which the analog stick outline/background texture is visible.");
+ CVarCombobox("Analog Stick Outline/Background Visibility", CVAR_INPUT_VIEWER("AnalogStick.OutlineMode"), stickModeOptions,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(STICK_MODE_ALWAYS_SHOWN)
+ .Tooltip("Determines the conditions under which the analog stick outline/background texture is visible."));
// gInputViewer.AnalogStick.Movement
- UIWidgets::EnhancementSliderInt("Analog Stick Movement: %dpx", "##AnalogMovement",
- CVAR_INPUT_VIEWER("AnalogStick.Movement"), 0, 200, "", 12, true);
- UIWidgets::Tooltip(
- "Sets the distance to move the analog stick in the input viewer. Useful for custom input viewers.");
+ CVarSliderInt("Analog Stick Movement: %dpx", CVAR_INPUT_VIEWER("AnalogStick.Movement"), IntSliderOptions().Color(THEME_COLOR).Min(0).Max(200).DefaultValue(12).ShowButtons(true)
+ .Tooltip("Sets the distance to move the analog stick in the input viewer. Useful for custom input viewers."));
UIWidgets::PaddedSeparator(true, true);
}
if (ImGui::CollapsingHeader("Additional (\"Right\") Stick")) {
// gInputViewer.RightStick.VisibilityMode
- UIWidgets::PaddedText("Right Stick Visibility", true, false);
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("RightStick.VisibilityMode"), stickModeOptions,
- STICK_MODE_HIDDEN_IN_DEADZONE);
- UIWidgets::Tooltip(
- "Determines the conditions under which the moving layer of the right stick texture is visible.");
+ CVarCombobox("Right Stick Visibility", CVAR_INPUT_VIEWER("RightStick.VisibilityMode"), stickModeOptions,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(STICK_MODE_ALWAYS_SHOWN)
+ .Tooltip("Determines the conditions under which the moving layer of the right stick texture is visible."));
// gInputViewer.RightStick.OutlineMode
- UIWidgets::PaddedText("Right Stick Outline/Background Visibility", true, false);
- UIWidgets::EnhancementCombobox(CVAR_INPUT_VIEWER("RightStick.OutlineMode"), stickModeOptions,
- STICK_MODE_HIDDEN_IN_DEADZONE);
- UIWidgets::Tooltip(
- "Determines the conditions under which the right stick outline/background texture is visible.");
+ CVarCombobox("Right Stick Outline/Background Visibility", CVAR_INPUT_VIEWER("RightStick.OutlineMode"), stickModeOptions,
+ ComboboxOptions().Color(THEME_COLOR).DefaultIndex(STICK_MODE_ALWAYS_SHOWN)
+ .Tooltip("Determines the conditions under which the right stick outline/background texture is visible."));
// gInputViewer.RightStick.Movement
- UIWidgets::EnhancementSliderInt("Right Stick Movement: %dpx", "##RightMovement",
- CVAR_INPUT_VIEWER("RightStick.Movement"), 0, 200, "", 7, true);
- UIWidgets::Tooltip(
- "Sets the distance to move the right stick in the input viewer. Useful for custom input viewers.");
+ CVarSliderInt("Right Stick Movement: %dpx", CVAR_INPUT_VIEWER("RightStick.Movement"), IntSliderOptions().Color(THEME_COLOR).Min(0).Max(200).DefaultValue(7).ShowButtons(true)
+ .Tooltip("Sets the distance to move the right stick in the input viewer. Useful for custom input viewers."));
UIWidgets::PaddedSeparator(true, true);
}
if (ImGui::CollapsingHeader("Analog Angle Values")) {
// gAnalogAngles
- UIWidgets::EnhancementCheckbox("Show Analog Stick Angle Values", CVAR_INPUT_VIEWER("AnalogAngles.Enabled"));
- UIWidgets::Tooltip("Displays analog stick angle values in the input viewer");
+ CVarCheckbox("Show Analog Stick Angle Values", CVAR_INPUT_VIEWER("AnalogAngles.Enabled"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Displays analog stick angle values in the input viewer"));
if (CVarGetInteger(CVAR_INPUT_VIEWER("AnalogAngles.Enabled"), 0)) {
// gInputViewer.AnalogAngles.TextColor
- if (ImGui::ColorEdit4("Text Color", (float*)&textColor)) {
- CVarSetColor(CVAR_INPUT_VIEWER("AnalogAngles.TextColor"), vec2Color(textColor));
- }
+ CVarColorPicker("Text Color", CVAR_INPUT_VIEWER("AnalogAngles.TextColor"), textColorDefault,
+ true, ColorPickerRandomButton | ColorPickerResetButton);
// gAnalogAngleScale
- UIWidgets::EnhancementSliderFloat("Angle Text Scale: %.2f%%", "##AnalogAngleScale",
- CVAR_INPUT_VIEWER("AnalogAngles.Scale"), 0.1f, 5.0f, "", 1.0f, true, true);
+ CVarSliderFloat("Angle Text Scale: %.2f%%", CVAR_INPUT_VIEWER("AnalogAngles.Scale"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.1f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
// gInputViewer.AnalogAngles.Offset
- UIWidgets::EnhancementSliderInt("Angle Text Offset: %dpx", "##AnalogAngleOffset",
- CVAR_INPUT_VIEWER("AnalogAngles.Offset"), 0, 400, "", 0, true);
+ CVarSliderInt("Angle Text Offset: %dpx", CVAR_INPUT_VIEWER("AnalogAngles.Offset"), IntSliderOptions().Color(THEME_COLOR).Min(0).Max(400).DefaultValue(0).ShowButtons(true)
+ .Tooltip("Sets the distance to move the right stick in the input viewer. Useful for custom input viewers."));
UIWidgets::PaddedSeparator(true, true);
// gInputViewer.AnalogAngles.Range1.Enabled
- UIWidgets::EnhancementCheckbox("Highlight ESS Position", CVAR_INPUT_VIEWER("AnalogAngles.Range1.Enabled"));
- UIWidgets::Tooltip(
- "Highlights the angle value text when the analog stick is in ESS position (on flat ground)");
+ CVarCheckbox("Highlight ESS Position", CVAR_INPUT_VIEWER("AnalogAngles.Range1.Enabled"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Highlights the angle value text when the analog stick is in ESS position (on flat ground)"));
if (CVarGetInteger(CVAR_INPUT_VIEWER("AnalogAngles.Range1.Enabled"), 0)) {
// gInputViewer.AnalogAngles.Range1.Color
- if (ImGui::ColorEdit4("ESS Color", (float*)&range1Color)) {
- CVarSetColor(CVAR_INPUT_VIEWER("AnalogAngles.Range1.Color"), vec2Color(range1Color));
- }
+ CVarColorPicker("ESS Color", CVAR_INPUT_VIEWER("AnalogAngles.Range1.Color"), range1ColorDefault,
+ true, ColorPickerRandomButton | ColorPickerResetButton);
}
UIWidgets::PaddedSeparator(true, true);
// gInputViewer.AnalogAngles.Range2.Enabled
- UIWidgets::EnhancementCheckbox("Highlight Walking Speed Angles",
- CVAR_INPUT_VIEWER("AnalogAngles.Range2.Enabled"));
- UIWidgets::Tooltip("Highlights the angle value text when the analog stick is at an angle that would "
+ CVarCheckbox("Highlight Walking Speed Angles", CVAR_INPUT_VIEWER("AnalogAngles.Range2.Enabled"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Highlights the angle value text when the analog stick is at an angle that would "
"produce a walking speed (on flat ground)\n\n"
- "Useful for 1.0 Empty Jumpslash Quick Put Away");
+ "Useful for 1.0 Empty Jumpslash Quick Put Away"));
if (CVarGetInteger(CVAR_INPUT_VIEWER("AnalogAngles.Range2.Enabled"), 0)) {
// gInputViewer.AnalogAngles.Range2.Color
- if (ImGui::ColorEdit4("Walking Speed Color", (float*)&range2Color)) {
- CVarSetColor(CVAR_INPUT_VIEWER("AnalogAngles.Range2.Color"), vec2Color(range2Color));
- }
+ CVarColorPicker("Walking Speed Color", CVAR_INPUT_VIEWER("AnalogAngles.Range2.Color"), range2ColorDefault,
+ true, ColorPickerRandomButton | ColorPickerResetButton);
}
}
}
+ PopStyleHeader();
}
diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp
index 7e4918799..7dbc74a75 100644
--- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp
+++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp
@@ -2,6 +2,7 @@
#include
#include "soh/OTRGlobals.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include "z64.h"
#include "soh/cvar_prefixes.h"
#ifndef __WIIU__
@@ -10,6 +11,8 @@
#define SCALE_IMGUI_SIZE(value) ((value / 13.0f) * ImGui::GetFontSize())
+using namespace UIWidgets;
+
SohInputEditorWindow::~SohInputEditorWindow() {
}
@@ -1062,17 +1065,16 @@ void SohInputEditorWindow::DrawLEDSection(uint8_t port) {
}
// todo: clean this up, probably just hardcode to LED_COLOR_SOURCE_GAME and use SoH options only here
if (mapping->GetColorSource() == LED_COLOR_SOURCE_GAME) {
- static const char* ledSources[] = {
+ static std::vector ledSources = {
"Original Tunic Colors", "Cosmetics Tunic Colors", "Health Colors",
"Original Navi Targeting Colors", "Cosmetics Navi Targeting Colors", "Custom"
};
- UIWidgets::PaddedText("Source");
- UIWidgets::EnhancementCombobox(CVAR_SETTING("LEDColorSource"), ledSources, LED_SOURCE_TUNIC_ORIGINAL);
- UIWidgets::Tooltip("Health\n- Red when health critical (13-20% depending on max health)\n- Yellow when "
+ CVarCombobox("Source", CVAR_SETTING("LEDColorSource"), ledSources, UIWidgets::ComboboxOptions().Color(THEME_COLOR).DefaultIndex(LED_SOURCE_TUNIC_ORIGINAL)
+ .Tooltip("Health\n- Red when health critical (13-20% depending on max health)\n- Yellow when "
"health < 40%. Green otherwise.\n\n"
"Tunics: colors will mirror currently equipped tunic, whether original or the current "
"values in Cosmetics Editor.\n\n"
- "Custom: single, solid color");
+ "Custom: single, solid color"));
if (CVarGetInteger(CVAR_SETTING("LEDColorSource"), 1) == LED_SOURCE_CUSTOM) {
UIWidgets::Spacer(3);
auto port1Color = CVarGetColor24(CVAR_SETTING("LEDPort1Color"), { 255, 255, 255 });
@@ -1090,14 +1092,13 @@ void SohInputEditorWindow::DrawLEDSection(uint8_t port) {
ImGui::SameLine();
ImGui::Text("Custom Color");
}
- UIWidgets::PaddedEnhancementSliderFloat("Brightness: %.1f %%", "##LED_Brightness", CVAR_SETTING("LEDBrightness"), 0.0f,
- 1.0f, "", 1.0f, true, true);
- UIWidgets::Tooltip("Sets the brightness of controller LEDs. 0% brightness = LEDs off.");
- UIWidgets::PaddedEnhancementCheckbox(
- "Critical Health Override", CVAR_SETTING("LEDCriticalOverride"), true, true,
- CVarGetInteger(CVAR_SETTING("LEDColorSource"), LED_SOURCE_TUNIC_ORIGINAL) == LED_SOURCE_HEALTH,
- "Override redundant for health source.", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::Tooltip("Shows red color when health is critical, otherwise displays according to color source.");
+ CVarSliderFloat("Brightness: %.1f %%", CVAR_SETTING("LEDBrightness"),
+ FloatSliderOptions().IsPercentage().Min(0.0f).Max(1.0f).DefaultValue(1.0f).ShowButtons(true)
+ .Tooltip("Sets the brightness of controller LEDs. 0% brightness = LEDs off."));
+ CVarCheckbox("Critical Health Override", CVAR_SETTING("LEDCriticalOverride"),
+ CheckboxOptions({{ .disabled = CVarGetInteger(CVAR_SETTING("LEDColorSource"), LED_SOURCE_TUNIC_ORIGINAL) == LED_SOURCE_HEALTH,
+ .disabledTooltip = "Override redundant for health source."}}).DefaultValue(true)
+ .Tooltip("Shows red color when health is critical, otherwise displays according to color source."));
}
ImGui::TreePop();
}
@@ -1281,7 +1282,6 @@ void SohInputEditorWindow::DrawMapping(CustomButtonMap& mapping, float labelWidt
preview = "Unknown";
}
- UIWidgets::Spacer(0);
ImVec2 cursorPos = ImGui::GetCursorPos();
ImVec2 textSize = ImGui::CalcTextSize(mapping.label);
ImGui::SetCursorPosY(cursorPos.y + textSize.y / 4);
@@ -1303,16 +1303,16 @@ void SohInputEditorWindow::DrawMapping(CustomButtonMap& mapping, float labelWidt
}
ImGui::EndCombo();
}
- UIWidgets::Spacer(0);
}
void SohInputEditorWindow::DrawOcarinaControlPanel() {
ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x, cursor.y + 5));
- UIWidgets::EnhancementCheckbox("Dpad Ocarina Playback", CVAR_SETTING("CustomOcarina.Dpad"));
- UIWidgets::EnhancementCheckbox("Right Stick Ocarina Playback", CVAR_SETTING("CustomOcarina.RightStick"));
- UIWidgets::EnhancementCheckbox("Customize Ocarina Controls", CVAR_SETTING("CustomOcarina.Enabled"));
+ CheckboxOptions checkOpt = CheckboxOptions().Color(THEME_COLOR);
+ CVarCheckbox("Dpad Ocarina Playback", CVAR_SETTING("CustomOcarina.Dpad"), checkOpt);
+ CVarCheckbox("Right Stick Ocarina Playback", CVAR_SETTING("CustomOcarina.RightStick"), checkOpt);
+ CVarCheckbox("Customize Ocarina Controls", CVAR_SETTING("CustomOcarina.Enabled"), checkOpt);
if (!CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
ImGui::BeginDisabled();
@@ -1344,60 +1344,56 @@ void SohInputEditorWindow::DrawCameraControlPanel() {
ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
- UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", CVAR_SETTING("Controls.RightStickAim"));
- UIWidgets::Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming");
+ CVarCheckbox("Right Stick Aiming", CVAR_SETTING("Controls.RightStickAim"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming"));
if (CVarGetInteger(CVAR_SETTING("Controls.RightStickAim"), 0)) {
- UIWidgets::PaddedEnhancementCheckbox("Allow moving while in first person mode", CVAR_SETTING("MoveInFirstPerson"));
- UIWidgets::Tooltip("Changes the left stick to move the player while in first person mode");
+ CVarCheckbox("Allow moving while in first person mode", CVAR_SETTING("MoveInFirstPerson"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Changes the left stick to move the player while in first person mode"));
}
- UIWidgets::PaddedEnhancementCheckbox("Invert Aiming X Axis", CVAR_SETTING("Controls.InvertAimingXAxis"));
- UIWidgets::Tooltip("Inverts the Camera X Axis in:\n-First-Person/C-Up view\n-Weapon Aiming");
- UIWidgets::PaddedEnhancementCheckbox("Invert Aiming Y Axis", CVAR_SETTING("Controls.InvertAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-First-Person/C-Up view\n-Weapon Aiming");
- UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming X Axis", CVAR_SETTING("Controls.InvertShieldAimingXAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::Tooltip("Inverts the Shield Aiming X Axis");
- UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming Y Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis"));
- UIWidgets::Tooltip("Inverts the Shield Aiming Y Axis");
- UIWidgets::PaddedEnhancementCheckbox("Invert Z-Weapon Aiming Y Axis", CVAR_SETTING("Controls.InvertZAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-Z-Weapon Aiming");
- UIWidgets::PaddedEnhancementCheckbox("Disable Auto-Centering in First-Person View", CVAR_SETTING("DisableFirstPersonAutoCenterView"));
- UIWidgets::Tooltip("Prevents the C-Up view from auto-centering, allowing for Gyro Aiming");
- if (UIWidgets::PaddedEnhancementCheckbox("Enable Custom Aiming/First-Person sensitivity", CVAR_SETTING("FirstPersonCameraSensitivity.Enabled"), true, false)) {
+ CVarCheckbox("Invert Aiming X Axis", CVAR_SETTING("Controls.InvertAimingXAxis"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Inverts the Camera X Axis in:\n-First-Person/C-Up view\n-Weapon Aiming"));
+ CVarCheckbox("Invert Aiming Y Axis", CVAR_SETTING("Controls.InvertAimingYAxis"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true)
+ .Tooltip("Inverts the Camera Y Axis in:\n-First-Person/C-Up view\n-Weapon Aiming"));
+ CVarCheckbox("Invert Shield Aiming X Axis", CVAR_SETTING("Controls.InvertShieldAimingXAxis"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true)
+ .Tooltip("Inverts the Shield Aiming X Axis"));
+ CVarCheckbox("Invert Shield Aiming Y Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Inverts the Shield Aiming Y Axis"));
+ CVarCheckbox("Invert Z-Weapon Aiming Y Axis", CVAR_SETTING("Controls.InvertZAimingYAxis"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true)
+ .Tooltip("Inverts the Camera Y Axis in:\n-Z-Weapon Aiming"));
+ CVarCheckbox("Disable Auto-Centering in First-Person View", CVAR_SETTING("DisableFirstPersonAutoCenterView"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Prevents the C-Up view from auto-centering, allowing for Gyro Aiming"));
+ if (CVarCheckbox("Enable Custom Aiming/First-Person sensitivity", CVAR_SETTING("FirstPersonCameraSensitivity.Enabled"), CheckboxOptions().Color(THEME_COLOR))) {
if (!CVarGetInteger(CVAR_SETTING("FirstPersonCameraSensitivity.Enabled"), 0)) {
CVarClear(CVAR_SETTING("FirstPersonCameraSensitivity.X"));
CVarClear(CVAR_SETTING("FirstPersonCameraSensitivity.Y"));
+ Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
}
if (CVarGetInteger(CVAR_SETTING("FirstPersonCameraSensitivity.Enabled"), 0)) {
- UIWidgets::EnhancementSliderFloat("Aiming/First-Person Horizontal Sensitivity: %.0f %%", "##FirstPersonSensitivity Horizontal",
- CVAR_SETTING("FirstPersonCameraSensitivity.X"), 0.01f, 5.0f, "", 1.0f, true);
- UIWidgets::EnhancementSliderFloat("Aiming/First-Person Vertical Sensitivity: %.0f %%", "##FirstPersonSensitivity Vertical",
- CVAR_SETTING("FirstPersonCameraSensitivity.Y"), 0.01f, 5.0f, "", 1.0f, true);
+ CVarSliderFloat("Aiming/First-Person Horizontal Sensitivity: %.0f %%", CVAR_SETTING("FirstPersonCameraSensitivity.X"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.01f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
+ CVarSliderFloat("Aiming/First-Person Vertical Sensitivity: %.0f %%", CVAR_SETTING("FirstPersonCameraSensitivity.Y"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.01f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
}
- UIWidgets::Spacer(0);
Ship::GuiWindow::EndGroupPanel(0);
- UIWidgets::Spacer(0);
cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
Ship::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
- UIWidgets::PaddedEnhancementCheckbox("Free Look", CVAR_SETTING("FreeLook.Enabled"));
- UIWidgets::Tooltip("Enables free look camera control\nNote: You must remap C buttons off of the right stick in the "
- "controller config menu, and map the camera stick to the right stick.");
- UIWidgets::PaddedEnhancementCheckbox("Invert Camera X Axis", CVAR_SETTING("FreeLook.InvertXAxis"));
- UIWidgets::Tooltip("Inverts the Camera X Axis in:\n-Free look");
- UIWidgets::PaddedEnhancementCheckbox("Invert Camera Y Axis", CVAR_SETTING("FreeLook.InvertYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-Free look");
- UIWidgets::Spacer(0);
- UIWidgets::PaddedEnhancementSliderFloat("Third-Person Horizontal Sensitivity: %.0f %%", "##ThirdPersonSensitivity Horizontal",
- CVAR_SETTING("FreeLook.CameraSensitivity.X"), 0.01f, 5.0f, "", 1.0f, true, true, false, true);
- UIWidgets::PaddedEnhancementSliderFloat("Third-Person Vertical Sensitivity: %.0f %%", "##ThirdPersonSensitivity Vertical",
- CVAR_SETTING("FreeLook.CameraSensitivity.Y"), 0.01f, 5.0f, "", 1.0f, true, true, false, true);
- UIWidgets::PaddedEnhancementSliderInt("Camera Distance: %d", "##CamDist",
- CVAR_SETTING("FreeLook.MaxCameraDistance"), 100, 900, "", 185, true, false, true);
- UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed",
- CVAR_SETTING("FreeLook.TransitionSpeed"), 0, 900, "", 25, true, false, true);
+ CVarCheckbox("Free Look", CVAR_SETTING("FreeLook.Enabled"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Enables free look camera control\nNote: You must remap C buttons off of the right stick in the "
+ "controller config menu, and map the camera stick to the right stick."));
+ CVarCheckbox("Invert Camera X Axis", CVAR_SETTING("FreeLook.InvertXAxis"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Inverts the Camera X Axis in:\n-Free look"));
+ CVarCheckbox("Invert Camera Y Axis", CVAR_SETTING("FreeLook.InvertYAxis"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true)
+ .Tooltip("Inverts the Camera Y Axis in:\n-Free look"));
+ CVarSliderFloat("Third-Person Horizontal Sensitivity: %.0f %%", CVAR_SETTING("FreeLook.CameraSensitivity.X"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.01f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
+ CVarSliderFloat("Third-Person Vertical Sensitivity: %.0f %%", CVAR_SETTING("FreeLook.CameraSensitivity.Y"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.01f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
+ CVarSliderInt("Camera Distance: %d", CVAR_SETTING("FreeLook.MaxCameraDistance"), IntSliderOptions().Color(THEME_COLOR).Min(100).Max(900).DefaultValue(185).ShowButtons(true));
+ CVarSliderInt("Camera Transition Speed: %d", CVAR_SETTING("FreeLook.TransitionSpeed"), IntSliderOptions().Color(THEME_COLOR).Min(0).Max(900).DefaultValue(25).ShowButtons(true));
Ship::GuiWindow::EndGroupPanel(0);
}
@@ -1405,17 +1401,17 @@ void SohInputEditorWindow::DrawDpadControlPanel() {
ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
Ship::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
- UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", CVAR_SETTING("DPadOnPause"));
- UIWidgets::Tooltip("Navigate Pause with the D-pad\nIf used with \"D-pad as Equip Items\", you must hold C-Up to equip instead of navigate");
- UIWidgets::PaddedEnhancementCheckbox("D-pad Support in Text Boxes", CVAR_SETTING("DpadInText"));
- UIWidgets::Tooltip("Navigate choices in text boxes, shop item selection, and the file select / name entry screens with the D-pad");
+ CVarCheckbox("D-pad Support on Pause Screen", CVAR_SETTING("DPadOnPause"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Navigate Pause with the D-pad\nIf used with \"D-pad as Equip Items\", you must hold C-Up to equip instead of navigate"));
+ CVarCheckbox("D-pad Support in Text Boxes", CVAR_SETTING("DpadInText"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Navigate choices in text boxes, shop item selection, and the file select / name entry screens with the D-pad"));
if (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CVarGetInteger(CVAR_SETTING("DpadInText"), 0)) {
ImGui::BeginDisabled();
}
- UIWidgets::PaddedEnhancementCheckbox("D-pad hold change", CVAR_SETTING("DpadHoldChange"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::Tooltip("The cursor will only move a single space no matter how long a D-pad direction is held");
+ CVarCheckbox("D-pad hold change", CVAR_SETTING("DpadHoldChange"), CheckboxOptions().Color(THEME_COLOR).DefaultValue(true)
+ .Tooltip("The cursor will only move a single space no matter how long a D-pad direction is held"));
if (!CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0) && !CVarGetInteger(CVAR_SETTING("DpadInText"), 0)) {
ImGui::EndDisabled();
@@ -1505,10 +1501,10 @@ void SohInputEditorWindow::DrawLinkTab() {
}
if (ImGui::CollapsingHeader("D-Pad", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
- DrawButtonLine(StringHelper::Sprintf("%s", ICON_FA_ARROW_UP).c_str(), portIndex, BTN_DUP);
- DrawButtonLine(StringHelper::Sprintf("%s", ICON_FA_ARROW_DOWN).c_str(), portIndex, BTN_DDOWN);
- DrawButtonLine(StringHelper::Sprintf("%s", ICON_FA_ARROW_LEFT).c_str(), portIndex, BTN_DLEFT);
- DrawButtonLine(StringHelper::Sprintf("%s", ICON_FA_ARROW_RIGHT).c_str(), portIndex, BTN_DRIGHT);
+ DrawButtonLine(StringHelper::Sprintf("D %s", ICON_FA_ARROW_UP).c_str(), portIndex, BTN_DUP);
+ DrawButtonLine(StringHelper::Sprintf("D %s", ICON_FA_ARROW_DOWN).c_str(), portIndex, BTN_DDOWN);
+ DrawButtonLine(StringHelper::Sprintf("D %s", ICON_FA_ARROW_LEFT).c_str(), portIndex, BTN_DLEFT);
+ DrawButtonLine(StringHelper::Sprintf("D %s", ICON_FA_ARROW_RIGHT).c_str(), portIndex, BTN_DRIGHT);
}
if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
@@ -1536,30 +1532,24 @@ void SohInputEditorWindow::DrawLinkTab() {
DrawButtonLine("M2", portIndex, BTN_CUSTOM_MODIFIER2);
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
- UIWidgets::PaddedEnhancementCheckbox("Enable speed modifiers", CVAR_SETTING("WalkModifier.Enabled"), true, false);
- UIWidgets::Tooltip("Hold the assigned button to change the maximum walking or swimming speed");
+ CVarCheckbox("Enable speed modifiers", CVAR_SETTING("WalkModifier.Enabled"), CheckboxOptions().Color(THEME_COLOR)
+ .Tooltip("Hold the assigned button to change the maximum walking or swimming speed"));
if (CVarGetInteger(CVAR_SETTING("WalkModifier.Enabled"), 0)) {
UIWidgets::Spacer(5);
Ship::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail());
- UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding",
- CVAR_SETTING("WalkModifier.SpeedToggle"), true, false);
+ CVarCheckbox("Toggle modifier instead of holding", CVAR_SETTING("WalkModifier.SpeedToggle"), CheckboxOptions().Color(THEME_COLOR));
Ship::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
- UIWidgets::PaddedEnhancementCheckbox("Don't affect jump distance/velocity",
- CVAR_SETTING("WalkModifier.DoesntChangeJump"), true, false);
- UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 1: %.0f %%", "##WalkMod1",
- CVAR_SETTING("WalkModifier.Mapping1"), 0.0f, 5.0f, "", 1.0f,
- true, true, false, true);
- UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 2: %.0f %%", "##WalkMod2",
- CVAR_SETTING("WalkModifier.Mapping2"), 0.0f, 5.0f, "", 1.0f,
- true, true, false, true);
+ CVarCheckbox("Don't affect jump distance/velocity", CVAR_SETTING("WalkModifier.DoesntChangeJump"), CheckboxOptions().Color(THEME_COLOR));
+ CVarSliderFloat("Walk Modifier 1: %.0f %%", CVAR_SETTING("WalkModifier.Mapping1"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.0f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
+ CVarSliderFloat("Walk Modifier 2: %.0f %%", CVAR_SETTING("WalkModifier.Mapping2"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.0f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
Ship::GuiWindow::EndGroupPanel(0);
Ship::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail());
- UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 1: %.0f %%", "##SwimMod1",
- CVAR_SETTING("WalkModifier.SwimMapping1"), 0.0f, 5.0f, "", 1.0f,
- true, true, false, true);
- UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 2: %.0f %%", "##SwimMod2",
- CVAR_SETTING("WalkModifier.SwimMapping2"), 0.0f, 5.0f, "", 1.0f,
- true, true, false, true);
+ CVarSliderFloat("Swim Modifier 1: %.0f %%", CVAR_SETTING("WalkModifier.SwimMapping1"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.0f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
+ CVarSliderFloat("Swim Modifier 2: %.0f %%", CVAR_SETTING("WalkModifier.SwimMapping2"),
+ FloatSliderOptions().Color(THEME_COLOR).IsPercentage().Min(0.0f).Max(5.0f).DefaultValue(1.0f).ShowButtons(true));
Ship::GuiWindow::EndGroupPanel(0);
Ship::GuiWindow::EndGroupPanel(0);
}
@@ -1659,9 +1649,7 @@ void SohInputEditorWindow::DrawDebugPortTab(uint8_t portIndex, std::string custo
UpdateBitmaskToMappingIds(portIndex);
UpdateStickDirectionToMappingIds(portIndex);
- ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.133f, 0.133f, 0.133f, 1.0f));
- ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
- ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.0f, 0.0f, 0.0f, 1.0f));
+ PushStyleHeader(THEME_COLOR);
if (ImGui::CollapsingHeader("Buttons", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
DrawButtonLine("A", portIndex, BTN_A, CHIP_COLOR_N64_BLUE);
@@ -1690,19 +1678,20 @@ void SohInputEditorWindow::DrawDebugPortTab(uint8_t portIndex, std::string custo
DrawStickSection(portIndex, Ship::LEFT, 0);
}
- ImGui::PopStyleColor();
- ImGui::PopStyleColor();
- ImGui::PopStyleColor();
+ PopStyleHeader();
ImGui::EndTabItem();
}
}
void SohInputEditorWindow::DrawClearAllButton(uint8_t portIndex) {
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button("Clear All", ImGui::CalcTextSize("Clear All") * 2)) {
ImGui::OpenPopup("Clear All##clearAllPopup");
}
+ PopStyleButton();
if (ImGui::BeginPopupModal("Clear All##clearAllPopup", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text("This will clear all mappings for port %d.\n\nContinue?", portIndex + 1);
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button("Cancel")) {
ImGui::CloseCurrentPopup();
}
@@ -1710,6 +1699,7 @@ void SohInputEditorWindow::DrawClearAllButton(uint8_t portIndex) {
Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->ClearAllMappings();
ImGui::CloseCurrentPopup();
}
+ PopStyleButton();
ImGui::EndPopup();
}
}
@@ -1717,22 +1707,23 @@ void SohInputEditorWindow::DrawClearAllButton(uint8_t portIndex) {
void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
ImGui::SameLine();
auto popupId = StringHelper::Sprintf("setDefaultsPopup##%d", portIndex);
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button(StringHelper::Sprintf("Set Defaults##%d", portIndex).c_str(),
ImVec2(ImGui::CalcTextSize("Set Defaults") * 2))) {
ImGui::OpenPopup(popupId.c_str());
}
+ PopStyleButton();
if (ImGui::BeginPopup(popupId.c_str())) {
bool shouldClose = false;
- ImGui::PushStyleColor(ImGuiCol_Button, BUTTON_COLOR_KEYBOARD_BEIGE);
- ImGui::PushStyleColor(ImGuiCol_ButtonHovered, BUTTON_COLOR_KEYBOARD_BEIGE_HOVERED);
+ PushStyleButton(BUTTON_COLOR_KEYBOARD_BEIGE);
if (ImGui::Button(StringHelper::Sprintf("%s Keyboard", ICON_FA_KEYBOARD_O).c_str())) {
ImGui::OpenPopup("Set Defaults for Keyboard");
}
- ImGui::PopStyleColor();
- ImGui::PopStyleColor();
+ PopStyleButton();
if (ImGui::BeginPopupModal("Set Defaults for Keyboard", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text("This will clear all existing mappings for\nKeyboard on port %d.\n\nContinue?", portIndex + 1);
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button("Cancel")) {
shouldClose = true;
ImGui::CloseCurrentPopup();
@@ -1747,21 +1738,21 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
shouldClose = true;
ImGui::CloseCurrentPopup();
}
+ PopStyleButton();
ImGui::EndPopup();
}
auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
GetButtonColorsForDeviceType(Ship::PhysicalDeviceType::SDLGamepad, buttonColor, buttonHoveredColor);
- ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
- ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
+ PushStyleButton(buttonColor);
if (ImGui::Button(StringHelper::Sprintf("%s %s", ICON_FA_GAMEPAD, "Gamepad (SDL)").c_str())) {
ImGui::OpenPopup("Set Defaults for Gamepad (SDL)");
}
- ImGui::PopStyleColor();
- ImGui::PopStyleColor();
+ PopStyleButton();
if (ImGui::BeginPopupModal("Set Defaults for Gamepad (SDL)", NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text("This will clear all existing mappings for\nGamepad (SDL) on port %d.\n\nContinue?", portIndex + 1);
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button("Cancel")) {
shouldClose = true;
ImGui::CloseCurrentPopup();
@@ -1776,18 +1767,26 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
shouldClose = true;
ImGui::CloseCurrentPopup();
}
+ PopStyleButton();
ImGui::EndPopup();
}
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button("Cancel") || shouldClose) {
ImGui::CloseCurrentPopup();
}
+ PopStyleButton();
ImGui::EndPopup();
}
}
void SohInputEditorWindow::DrawElement() {
+ ImGui::PushFont(OTRGlobals::Instance->fontMonoLarger);
+ ImVec4 themeColor = ColorValues.at(THEME_COLOR);
+ ImGui::PushStyleColor(ImGuiCol_Tab, ImVec4(themeColor.x, themeColor.y, themeColor.z, 0.8f));
+ ImGui::PushStyleColor(ImGuiCol_TabHovered, ImVec4(themeColor.x, themeColor.y, themeColor.z, 0.6f));
+ ImGui::PushStyleColor(ImGuiCol_TabActive, ImVec4(themeColor.x, themeColor.y, themeColor.z, 0.6f));
ImGui::BeginTabBar("##ControllerConfigPortTabs");
DrawLinkTab();
DrawIvanTab();
@@ -1796,4 +1795,6 @@ void SohInputEditorWindow::DrawElement() {
DrawDebugPortTab(3);
}
ImGui::EndTabBar();
+ ImGui::PopStyleColor(3);
+ ImGui::PopFont();
}
diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp
index 16fb2bed4..ddd36fa56 100644
--- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp
+++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp
@@ -11,6 +11,7 @@
#include
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
@@ -92,6 +93,7 @@ std::map groupLabels = {
typedef struct {
const char* cvar;
+ const char* valuesCvar;
const char* rainbowCvar;
const char* lockedCvar;
const char* changedCvar;
@@ -111,7 +113,8 @@ Color_RGBA8 ColorRGBA8(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
#define COSMETIC_OPTION(id, label, group, defaultColor, supportsAlpha, supportsRainbow, advancedOption) \
{ id, { \
- CVAR_COSMETIC(id ".Value"), CVAR_COSMETIC(id ".Rainbow"), CVAR_COSMETIC(id ".Locked"), CVAR_COSMETIC(id ".Changed"), label, group, \
+ CVAR_COSMETIC(id), CVAR_COSMETIC(id ".Value"), CVAR_COSMETIC(id ".Rainbow"), CVAR_COSMETIC(id ".Locked"), \
+ CVAR_COSMETIC(id ".Changed"), label, group, \
ImVec4(defaultColor.r / 255.0f, defaultColor.g / 255.0f, defaultColor.b / 255.0f, defaultColor.a / 255.0f), defaultColor, \
supportsAlpha, supportsRainbow, advancedOption \
} }
@@ -280,13 +283,13 @@ static std::map cosmeticOptions = {
COSMETIC_OPTION("Key.GanonsBossGem", "Ganons Boss Key Gem", COSMETICS_GROUP_BOSS_KEYS, ColorRGBA8(255, 0, 0, 255), false, true, false),
COSMETIC_OPTION("Key.WellSmallBody", "Well Small Key", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 255, 255), false, true, false),
- COSMETIC_OPTION("Key.WellSmallEmblem", "Well Small Key Emblem", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(227, 110, 255, 255), false, true, true),
+ COSMETIC_OPTION("Key.WellSmallEmblem", "Well Small Key Emblem", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(227, 110, 255, 255), false, true, false),
COSMETIC_OPTION("Key.FortSmallBody", "Fortress Small Key", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 255, 255), false, true, false),
- COSMETIC_OPTION("Key.FortSmallEmblem", "Fortress Small Key Emblem",COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 255, 255), false, true, true),
+ COSMETIC_OPTION("Key.FortSmallEmblem", "Fortress Small Key Emblem",COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 255, 255), false, true, false),
COSMETIC_OPTION("Key.GTGSmallBody", "GTG Small Key", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 255, 255), false, true, false),
- COSMETIC_OPTION("Key.GTGSmallEmblem", "GTG Small Key Emblem", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(221, 212, 60, 255), false, true, true),
+ COSMETIC_OPTION("Key.GTGSmallEmblem", "GTG Small Key Emblem", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(221, 212, 60, 255), false, true, false),
//COSMETIC_OPTION("Key.ChestGameSmallBody", "Chest Game Key", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 255, 255), false, true, false),
- //COSMETIC_OPTION("Key.ChestGameEmblem", "Chest Game Key Emblem", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 0, 0, 255), false, true, true),
+ //COSMETIC_OPTION("Key.ChestGameEmblem", "Chest Game Key Emblem", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 0, 0, 255), false, true, false),
COSMETIC_OPTION("Key.Skeleton", "Skeleton Key", COSMETICS_GROUP_SMALL_KEYS, ColorRGBA8(255, 255, 170, 255), false, true, false),
COSMETIC_OPTION("HUD.AButton", "A Button", COSMETICS_GROUP_HUD, ColorRGBA8( 90, 90, 255, 255), false, true, false),
@@ -313,7 +316,7 @@ static std::map cosmeticOptions = {
#define MESSAGE_COSMETIC_OPTION(id, label, r, g, b) COSMETIC_OPTION("Message." id, label, COSMETICS_GROUP_MESSAGE, ColorRGBA8(r, g, b, 255), false, true, true)
MESSAGE_COSMETIC_OPTION("Default.Normal", "Message Default Color", 255, 255, 255),
- MESSAGE_COSMETIC_OPTION("Default.NoneNoShadow", "Message Default (None No Shadow) Color", 0, 0, 0),
+ MESSAGE_COSMETIC_OPTION("Default.NoneNoShadow", "Message Default (None No Shadow)", 0, 0, 0),
MESSAGE_COSMETIC_OPTION("Red.Normal", "Message Red Color", 255, 60, 60),
MESSAGE_COSMETIC_OPTION("Red.Wooden", "Message Red (Wooden) Color", 255, 120, 0),
MESSAGE_COSMETIC_OPTION("Adjustable.Normal", "Message Adjustable Color", 70, 255, 80),
@@ -322,7 +325,7 @@ static std::map cosmeticOptions = {
MESSAGE_COSMETIC_OPTION("Blue.Wooden", "Message Blue (Wooden) Color", 80, 110, 255),
MESSAGE_COSMETIC_OPTION("LightBlue.Normal", "Message Light Blue Color", 100, 180, 255),
MESSAGE_COSMETIC_OPTION("LightBlue.Wooden", "Message Light Blue (Wooden) Color", 90, 180, 255),
- MESSAGE_COSMETIC_OPTION("LightBlue.LightBlue.NoneNoShadow", "Message Light Blue (None No Shadow) Color", 80, 150, 180),
+ MESSAGE_COSMETIC_OPTION("LightBlue.LightBlue.NoneNoShadow", "Message Light Blue (None No Shadow)", 80, 150, 180),
MESSAGE_COSMETIC_OPTION("Purple.Normal", "Message Purple Color", 255, 150, 180),
MESSAGE_COSMETIC_OPTION("Purple.Wooden", "Message Purple (Wooden) Color", 210, 100, 255),
MESSAGE_COSMETIC_OPTION("Yellow.Normal", "Message Yellow Color", 255, 255, 50),
@@ -469,41 +472,38 @@ static const char* MarginCvarNonAnchor[] {
CVAR_COSMETIC("HUD.TitleCard.Boss")
};
-ImVec4 GetRandomValue() {
-#if !defined(__SWITCH__) && !defined(__WIIU__)
- std::random_device rd;
- std::mt19937 rng(rd());
-#else
- size_t seed = std::hash{}(std::to_string(rand()));
- std::mt19937_64 rng(seed);
-#endif
- std::uniform_int_distribution dist(0, 255 - 1);
-
- ImVec4 NewColor;
- NewColor.x = (float)(dist(rng)) / 255.0f;
- NewColor.y = (float)(dist(rng)) / 255.0f;
- NewColor.z = (float)(dist(rng)) / 255.0f;
- return NewColor;
-}
-
-void SetMarginAll(const char* ButtonName, bool SetActivated) {
- if (ImGui::Button(ButtonName)) {
- //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.
+void SetMarginAll(const char* ButtonName, bool SetActivated, const char* tooltip) {
+ if (UIWidgets::Button(ButtonName, UIWidgets::ButtonOptions()
+ .Size(ImVec2(200.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip(tooltip))) {
+ // 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.
u8 arrayLengthNonMargin = sizeof(MarginCvarNonAnchor) / sizeof(*MarginCvarNonAnchor);
for (auto cvarName : MarginCvarList) {
std::string cvarPosType = std::string(cvarName).append(".PosType");
std::string cvarNameMargins = std::string(cvarName).append(".UseMargins");
- if (CVarGetInteger(cvarPosType.c_str(),0) <= ANCHOR_RIGHT && SetActivated) { //Our element is not Hidden or Non anchor
+ if (CVarGetInteger(cvarPosType.c_str(), 0) <= ANCHOR_RIGHT &&
+ SetActivated) { // Our element is not Hidden or Non anchor
for (int i = 0; i < arrayLengthNonMargin; i++) {
- if ((strcmp(cvarName, MarginCvarNonAnchor[i]) == 0) && (CVarGetInteger(cvarPosType.c_str(), 0) == ORIGINAL_LOCATION)) { //Our element is both in original position and do not have anchor by default so we skip it.
- CVarSetInteger(cvarNameMargins.c_str(), false); //force set off
- } else if ((strcmp(cvarName, MarginCvarNonAnchor[i]) == 0) && (CVarGetInteger(cvarPosType.c_str(), 0) != ORIGINAL_LOCATION)) { //Our element is not in original position regarless it has no anchor by default since player made it anchored we can toggle margins
+ if ((strcmp(cvarName, MarginCvarNonAnchor[i]) == 0) &&
+ (CVarGetInteger(cvarPosType.c_str(), 0) ==
+ ORIGINAL_LOCATION)) { // Our element is both in original position and do not have anchor by
+ // default so we skip it.
+ CVarSetInteger(cvarNameMargins.c_str(), false); // force set off
+ } else if ((strcmp(cvarName, MarginCvarNonAnchor[i]) == 0) &&
+ (CVarGetInteger(cvarPosType.c_str(), 0) !=
+ ORIGINAL_LOCATION)) { // Our element is not in original position regarless it has no
+ // anchor by default since player made it anchored we can toggle
+ // margins
CVarSetInteger(cvarNameMargins.c_str(), SetActivated);
- } else if (strcmp(cvarName, MarginCvarNonAnchor[i]) != 0) { //Our elements has an anchor by default so regarless of it's position right now that okay to toggle margins.
+ } else if (strcmp(cvarName, MarginCvarNonAnchor[i]) !=
+ 0) { // Our elements has an anchor by default so regarless of it's position right now
+ // that okay to toggle margins.
CVarSetInteger(cvarNameMargins.c_str(), SetActivated);
}
}
- } else { //Since the user requested to turn all margin off no need to do any check there.
+ } else { // Since the user requested to turn all margin off no need to do any check there.
CVarSetInteger(cvarNameMargins.c_str(), SetActivated);
}
}
@@ -511,12 +511,16 @@ void SetMarginAll(const char* ButtonName, bool SetActivated) {
}
void ResetPositionAll() {
- if (ImGui::Button("Reset all positions")) {
+ if (UIWidgets::Button("Reset all positions",
+ UIWidgets::ButtonOptions()
+ .Size(ImVec2(200.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("Revert every element to use their original position and no margins"))) {
for (auto cvarName : MarginCvarList) {
std::string cvarPosType = std::string(cvarName).append(".PosType");
std::string cvarNameMargins = std::string(cvarName).append(".UseMargins");
CVarSetInteger(cvarPosType.c_str(), 0);
- CVarSetInteger(cvarNameMargins.c_str(), false); //Turn margin off to everythings as that original position.
+ CVarSetInteger(cvarNameMargins.c_str(), false); // Turn margin off to everythings as that original position.
}
}
}
@@ -545,7 +549,7 @@ void CosmeticsUpdateTick() {
cosmeticOption.currentColor.z = newColor.b / 255.0f;
cosmeticOption.currentColor.w = newColor.a / 255.0f;
- CVarSetColor(cosmeticOption.cvar, newColor);
+ CVarSetColor(cosmeticOption.valuesCvar, newColor);
}
// If we don't want the rainbow color on items to be synced, offset the index for each item in the loop.
// Technically this would work if you replaced "60" with 1 but the hue would be so close it's
@@ -573,21 +577,21 @@ void CosmeticsUpdateTick() {
void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& magicFaroresPrimary = cosmeticOptions.at("Magic.FaroresPrimary");
if (manualChange || CVarGetInteger(magicFaroresPrimary.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(magicFaroresPrimary.cvar, magicFaroresPrimary.defaultColor);
+ Color_RGBA8 color = CVarGetColor(magicFaroresPrimary.valuesCvar, magicFaroresPrimary.defaultColor);
PATCH_GFX(sInnerCylinderDL, "Magic_FaroresPrimary1", magicFaroresPrimary.changedCvar, 24, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(sOuterCylinderDL, "Magic_FaroresPrimary2", magicFaroresPrimary.changedCvar, 24, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
}
static CosmeticOption& magicFaroresSecondary = cosmeticOptions.at("Magic.FaroresSecondary");
if (manualChange || CVarGetInteger(magicFaroresSecondary.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(magicFaroresSecondary.cvar, magicFaroresSecondary.defaultColor);
+ Color_RGBA8 color = CVarGetColor(magicFaroresSecondary.valuesCvar, magicFaroresSecondary.defaultColor);
PATCH_GFX(sInnerCylinderDL, "Magic_FaroresSecondary1", magicFaroresSecondary.changedCvar, 25, gsDPSetEnvColor(color.r, color.g, color.b, 255));
PATCH_GFX(sOuterCylinderDL, "Magic_FaroresSecondary2", magicFaroresSecondary.changedCvar, 25, gsDPSetEnvColor(color.r, color.g, color.b, 255));
}
static CosmeticOption& linkGoronTunic = cosmeticOptions.at("Link.GoronTunic");
if (manualChange || CVarGetInteger(linkGoronTunic.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(linkGoronTunic.cvar, linkGoronTunic.defaultColor);
+ Color_RGBA8 color = CVarGetColor(linkGoronTunic.valuesCvar, linkGoronTunic.defaultColor);
PATCH_GFX(gGiGoronTunicColorDL, "Link_GoronTunic1", linkGoronTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiGoronCollarColorDL, "Link_GoronTunic2", linkGoronTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r / 2, color.g / 2, color.b / 2, 255));
PATCH_GFX(gGiGoronTunicColorDL, "Link_GoronTunic3", linkGoronTunic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
@@ -596,7 +600,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& linkZoraTunic = cosmeticOptions.at("Link.ZoraTunic");
if (manualChange || CVarGetInteger(linkZoraTunic.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(linkZoraTunic.cvar, linkZoraTunic.defaultColor);
+ Color_RGBA8 color = CVarGetColor(linkZoraTunic.valuesCvar, linkZoraTunic.defaultColor);
PATCH_GFX(gGiZoraTunicColorDL, "Link_ZoraTunic1", linkZoraTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiZoraCollarColorDL, "Link_ZoraTunic2", linkZoraTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r / 2, color.g / 2, color.b / 2, 255));
PATCH_GFX(gGiZoraTunicColorDL, "Link_ZoraTunic3", linkZoraTunic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
@@ -605,7 +609,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& linkHair = cosmeticOptions.at("Link.Hair");
if (manualChange || CVarGetInteger(linkHair.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(linkHair.cvar, linkHair.defaultColor);
+ Color_RGBA8 color = CVarGetColor(linkHair.valuesCvar, linkHair.defaultColor);
PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair1", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair2", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair3", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
@@ -627,7 +631,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& linkLinen = cosmeticOptions.at("Link.Linen");
if (manualChange || CVarGetInteger(linkLinen.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(linkLinen.cvar, linkLinen.defaultColor);
+ Color_RGBA8 color = CVarGetColor(linkLinen.valuesCvar, linkLinen.defaultColor);
PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen1", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen2", linkLinen.changedCvar, 83, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultLeftArmOutNearDL, "Link_Linen3", linkLinen.changedCvar, 25, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -668,7 +672,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& linkBoots = cosmeticOptions.at("Link.Boots");
if (manualChange || CVarGetInteger(linkBoots.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(linkBoots.cvar, linkBoots.defaultColor);
+ Color_RGBA8 color = CVarGetColor(linkBoots.valuesCvar, linkBoots.defaultColor);
PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots1", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots2", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Boots3", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
@@ -704,7 +708,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& mirrorShieldBody = cosmeticOptions.at("MirrorShield.Body");
if (manualChange || CVarGetInteger(mirrorShieldBody.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(mirrorShieldBody.cvar, mirrorShieldBody.defaultColor);
+ Color_RGBA8 color = CVarGetColor(mirrorShieldBody.valuesCvar, mirrorShieldBody.defaultColor);
PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Body1", mirrorShieldBody.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Body2", mirrorShieldBody.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Body3", mirrorShieldBody.changedCvar, 28, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -716,7 +720,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& mirrorShieldMirror = cosmeticOptions.at("MirrorShield.Mirror");
if (manualChange || CVarGetInteger(mirrorShieldMirror.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(mirrorShieldMirror.cvar, mirrorShieldMirror.defaultColor);
+ Color_RGBA8 color = CVarGetColor(mirrorShieldMirror.valuesCvar, mirrorShieldMirror.defaultColor);
PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Mirror1", mirrorShieldMirror.changedCvar, 47, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Mirror2", mirrorShieldMirror.changedCvar, 48, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Mirror3", mirrorShieldMirror.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -728,7 +732,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& mirrorShieldEmblem = cosmeticOptions.at("MirrorShield.Emblem");
if (manualChange || CVarGetInteger(mirrorShieldEmblem.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(mirrorShieldEmblem.cvar, mirrorShieldEmblem.defaultColor);
+ Color_RGBA8 color = CVarGetColor(mirrorShieldEmblem.valuesCvar, mirrorShieldEmblem.defaultColor);
PATCH_GFX(gGiMirrorShieldSymbolDL, "MirrorShield_Emblem1", mirrorShieldEmblem.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 140));
PATCH_GFX(gGiMirrorShieldSymbolDL, "MirrorShield_Emblem2", mirrorShieldEmblem.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Emblem3", mirrorShieldEmblem.changedCvar, 165, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -741,7 +745,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& swordsKokiriBlade = cosmeticOptions.at("Swords.KokiriBlade");
if (manualChange || CVarGetInteger(swordsKokiriBlade.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(swordsKokiriBlade.cvar, swordsKokiriBlade.defaultColor);
+ Color_RGBA8 color = CVarGetColor(swordsKokiriBlade.valuesCvar, swordsKokiriBlade.defaultColor);
PATCH_GFX(gLinkChildLeftFistAndKokiriSwordNearDL, "Swords_KokiriBlade1", swordsKokiriBlade.changedCvar, 79, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gLinkChildLeftFistAndKokiriSwordFarDL, "Swords_KokiriBlade2", swordsKokiriBlade.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiKokiriSwordDL, "Swords_KokiriBlade3", swordsKokiriBlade.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -750,7 +754,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
/*
static CosmeticOption& swordsKokiriHilt = cosmeticOptions.at("Swords.KokiriHilt");
if (manualChange || CVarGetInteger(swordsKokiriHilt.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(swordsKokiriHilt.cvar, swordsKokiriHilt.defaultColor);
+ Color_RGBA8 color = CVarGetColor(swordsKokiriHilt.valuesCvar, swordsKokiriHilt.defaultColor);
PATCH_GFX(gLinkChildLeftFistAndKokiriSwordNearDL, "Swords_KokiriHilt1", swordsKokiriHilt.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkChildLeftFistAndKokiriSwordFarDL, "Swords_KokiriHilt2", swordsKokiriHilt.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkChildSwordAndSheathNearDL, "Swords_KokiriHilt3", swordsKokiriHilt.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
@@ -791,7 +795,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
*/
static CosmeticOption& swordsMasterBlade = cosmeticOptions.at("Swords.MasterBlade");
if (manualChange || CVarGetInteger(swordsMasterBlade.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(swordsMasterBlade.cvar, swordsMasterBlade.defaultColor);
+ Color_RGBA8 color = CVarGetColor(swordsMasterBlade.valuesCvar, swordsMasterBlade.defaultColor);
PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordFarDL, "Swords_MasterBlade1", swordsMasterBlade.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordNearDL, "Swords_MasterBlade2", swordsMasterBlade.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterBlade3", swordsMasterBlade.changedCvar, 13, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -802,7 +806,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
/*
static CosmeticOption& swordsMasterHilt = cosmeticOptions.at("Swords.MasterHilt");
if (manualChange || CVarGetInteger(swordsMasterHilt.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(swordsMasterHilt.cvar, swordsMasterHilt.defaultColor);
+ Color_RGBA8 color = CVarGetColor(swordsMasterHilt.valuesCvar, swordsMasterHilt.defaultColor);
PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordNearDL, "Swords_MasterHilt1", swordsMasterHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordFarDL, "Swords_MasterHilt2", swordsMasterHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterHilt3", swordsMasterHilt.changedCvar, 16, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
@@ -849,7 +853,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
*/
static CosmeticOption& swordsBiggoronBlade = cosmeticOptions.at("Swords.BiggoronBlade");
if (manualChange || CVarGetInteger(swordsBiggoronBlade.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(swordsBiggoronBlade.cvar, swordsBiggoronBlade.defaultColor);
+ Color_RGBA8 color = CVarGetColor(swordsBiggoronBlade.valuesCvar, swordsBiggoronBlade.defaultColor);
PATCH_GFX(gLinkAdultLeftHandHoldingBgsFarDL, "Swords_BiggoronBlade1", swordsBiggoronBlade.changedCvar, 108, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultLeftHandHoldingBgsNearDL, "Swords_BiggoronBlade2", swordsBiggoronBlade.changedCvar, 63, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronBlade3", swordsBiggoronBlade.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -858,7 +862,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
/*
static CosmeticOption& swordsBiggoronHilt = cosmeticOptions.at("Swords.BiggoronHilt");
if (manualChange || CVarGetInteger(swordsBiggoronHilt.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(swordsBiggoronHilt.cvar, swordsBiggoronHilt.defaultColor);
+ Color_RGBA8 color = CVarGetColor(swordsBiggoronHilt.valuesCvar, swordsBiggoronHilt.defaultColor);
PATCH_GFX(gLinkAdultLeftHandHoldingBgsNearDL, "Swords_BiggoronHilt1", swordsBiggoronHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gLinkAdultLeftHandHoldingBgsFarDL, "Swords_BiggoronHilt2", swordsBiggoronHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronHilt3", swordsBiggoronHilt.changedCvar, 74, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -877,7 +881,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
*/
static CosmeticOption& glovesGoronBracelet = cosmeticOptions.at("Gloves.GoronBracelet");
if (manualChange || CVarGetInteger(glovesGoronBracelet.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(glovesGoronBracelet.cvar, glovesGoronBracelet.defaultColor);
+ Color_RGBA8 color = CVarGetColor(glovesGoronBracelet.valuesCvar, glovesGoronBracelet.defaultColor);
PATCH_GFX(gGiGoronBraceletDL, "Gloves_GoronBracelet1", glovesGoronBracelet.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiGoronBraceletDL, "Gloves_GoronBracelet2", glovesGoronBracelet.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet3", glovesGoronBracelet.changedCvar, 3, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
@@ -889,19 +893,19 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& glovesSilverGauntlets = cosmeticOptions.at("Gloves.SilverGauntlets");
if (manualChange || CVarGetInteger(glovesSilverGauntlets.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(glovesSilverGauntlets.cvar, glovesSilverGauntlets.defaultColor);
+ Color_RGBA8 color = CVarGetColor(glovesSilverGauntlets.valuesCvar, glovesSilverGauntlets.defaultColor);
PATCH_GFX(gGiSilverGauntletsColorDL, "Gloves_SilverGauntlets1", glovesSilverGauntlets.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiSilverGauntletsColorDL, "Gloves_SilverGauntlets2", glovesSilverGauntlets.changedCvar, 4, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
}
static CosmeticOption& glovesGoldenGauntlets = cosmeticOptions.at("Gloves.GoldenGauntlets");
if (manualChange || CVarGetInteger(glovesGoldenGauntlets.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(glovesGoldenGauntlets.cvar, glovesGoldenGauntlets.defaultColor);
+ Color_RGBA8 color = CVarGetColor(glovesGoldenGauntlets.valuesCvar, glovesGoldenGauntlets.defaultColor);
PATCH_GFX(gGiGoldenGauntletsColorDL, "Gloves_GoldenGauntlets1", glovesGoldenGauntlets.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiGoldenGauntletsColorDL, "Gloves_GoldenGauntlets2", glovesGoldenGauntlets.changedCvar, 4, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
}
static CosmeticOption& glovesGauntletsGem = cosmeticOptions.at("Gloves.GauntletsGem");
if (manualChange || CVarGetInteger(glovesGauntletsGem.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(glovesGauntletsGem.cvar, glovesGauntletsGem.defaultColor);
+ Color_RGBA8 color = CVarGetColor(glovesGauntletsGem.valuesCvar, glovesGauntletsGem.defaultColor);
PATCH_GFX(gGiGauntletsDL, "Gloves_GauntletsGem1", glovesGauntletsGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiGauntletsDL, "Gloves_GauntletsGem2", glovesGauntletsGem.changedCvar, 85, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultLeftGauntletPlate2DL, "Gloves_GauntletsGem3", glovesGauntletsGem.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -912,7 +916,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& equipmentBoomerangBody = cosmeticOptions.at("Equipment.BoomerangBody");
if (manualChange || CVarGetInteger(equipmentBoomerangBody.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBoomerangBody.cvar, equipmentBoomerangBody.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBoomerangBody.valuesCvar, equipmentBoomerangBody.defaultColor);
PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangBody1", equipmentBoomerangBody.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangBody2", equipmentBoomerangBody.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkChildLeftFistAndBoomerangNearDL, "Equipment_BoomerangBody3", equipmentBoomerangBody.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -921,7 +925,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& equipmentBoomerangGem = cosmeticOptions.at("Equipment.BoomerangGem");
if (manualChange || CVarGetInteger(equipmentBoomerangGem.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBoomerangGem.cvar, equipmentBoomerangGem.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBoomerangGem.valuesCvar, equipmentBoomerangGem.defaultColor);
PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangGem1", equipmentBoomerangGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangGem2", equipmentBoomerangGem.changedCvar, 85, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkChildLeftFistAndBoomerangNearDL, "Equipment_BoomerangGem3", equipmentBoomerangGem.changedCvar, 16, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -932,7 +936,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
/*
static CosmeticOption& equipmentSlingshotBody = cosmeticOptions.at("Equipment.SlingshotBody");
if (manualChange || CVarGetInteger(equipmentSlingshotBody.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentSlingshotBody.cvar, equipmentSlingshotBody.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentSlingshotBody.valuesCvar, equipmentSlingshotBody.defaultColor);
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotBody1", equipmentSlingshotBody.changedCvar, 10, gsDPSetPrimColor(0, 0, MAX(color.r - 100, 0), MAX(color.g - 100, 0), MAX(color.b - 100, 0), 255));
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotBody2", equipmentSlingshotBody.changedCvar, 12, gsDPSetEnvColor(MAX(color.r - 100, 0) / 3, MAX(color.g - 100, 0) / 3, MAX(color.b - 100, 0) / 3, 255));
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotBody3", equipmentSlingshotBody.changedCvar, 74, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -956,7 +960,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
*/
static CosmeticOption& equipmentSlingshotString = cosmeticOptions.at("Equipment.SlingshotString");
if (manualChange || CVarGetInteger(equipmentSlingshotString.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentSlingshotString.cvar, equipmentSlingshotString.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentSlingshotString.valuesCvar, equipmentSlingshotString.defaultColor);
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString1",equipmentSlingshotString.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString2",equipmentSlingshotString.changedCvar, 76, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
PATCH_GFX(gLinkChildSlingshotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -964,7 +968,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& equipmentBowTips = cosmeticOptions.at("Equipment.BowTips");
if (manualChange || CVarGetInteger(equipmentBowTips.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBowTips.cvar, equipmentBowTips.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBowTips.valuesCvar, equipmentBowTips.defaultColor);
PATCH_GFX(gGiBowDL, "Equipment_BowTips1", equipmentBowTips.changedCvar, 86, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBowDL, "Equipment_BowTips2", equipmentBowTips.changedCvar, 87, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowTips3", equipmentBowTips.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -973,14 +977,14 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& equipmentBowString = cosmeticOptions.at("Equipment.BowString");
if (manualChange || CVarGetInteger(equipmentBowString.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBowString.cvar, equipmentBowString.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBowString.valuesCvar, equipmentBowString.defaultColor);
PATCH_GFX(gGiBowDL, "Equipment_BowString1", equipmentBowString.changedCvar, 105, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBowDL, "Equipment_BowString2", equipmentBowString.changedCvar, 106, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultBowStringDL, "Equipment_BowString3", equipmentBowString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
}
static CosmeticOption& equipmentBowBody = cosmeticOptions.at("Equipment.BowBody");
if (manualChange || CVarGetInteger(equipmentBowBody.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBowBody.cvar, equipmentBowBody.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBowBody.valuesCvar, equipmentBowBody.defaultColor);
PATCH_GFX(gGiBowDL, "Equipment_BowBody1", equipmentBowBody.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBowDL, "Equipment_BowBody2", equipmentBowBody.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowBody3", equipmentBowBody.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -989,7 +993,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& equipmentBowHandle = cosmeticOptions.at("Equipment.BowHandle");
if (manualChange || CVarGetInteger(equipmentBowHandle.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBowHandle.cvar, equipmentBowHandle.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBowHandle.valuesCvar, equipmentBowHandle.defaultColor);
PATCH_GFX(gGiBowDL, "Equipment_BowHandle1", equipmentBowHandle.changedCvar, 51, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBowDL, "Equipment_BowHandle2", equipmentBowHandle.changedCvar, 52, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowHandle3", equipmentBowHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -999,7 +1003,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& equipmentHammerHead = cosmeticOptions.at("Equipment.HammerHead");
if (manualChange || CVarGetInteger(equipmentHammerHead.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentHammerHead.cvar, equipmentHammerHead.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentHammerHead.valuesCvar, equipmentHammerHead.defaultColor);
PATCH_GFX(gGiHammerDL, "Equipment_HammerHead1", equipmentHammerHead.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiHammerDL, "Equipment_HammerHead2", equipmentHammerHead.changedCvar, 6, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255));
PATCH_GFX(gGiHammerDL, "Equipment_HammerHead3", equipmentHammerHead.changedCvar, 68, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -1009,7 +1013,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& equipmentHammerHandle = cosmeticOptions.at("Equipment.HammerHandle");
if (manualChange || CVarGetInteger(equipmentHammerHandle.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentHammerHandle.cvar, equipmentHammerHandle.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentHammerHandle.valuesCvar, equipmentHammerHandle.defaultColor);
PATCH_GFX(gGiHammerDL, "Equipment_HammerHandle1", equipmentHammerHandle.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiHammerDL, "Equipment_HammerHandle2", equipmentHammerHandle.changedCvar, 85, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
PATCH_GFX(gLinkAdultLeftHandHoldingHammerNearDL, "Equipment_HammerHandle5", equipmentHammerHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -1018,13 +1022,13 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& equipmentHookshotChain = cosmeticOptions.at("Equipment.HookshotChain");
if (manualChange || CVarGetInteger(equipmentHookshotChain.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentHookshotChain.cvar, equipmentHookshotChain.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentHookshotChain.valuesCvar, equipmentHookshotChain.defaultColor);
PATCH_GFX(gLinkAdultHookshotChainDL, "Equipment_HookshotChain1", equipmentHookshotChain.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
}
static CosmeticOption& equipmentChuFace = cosmeticOptions.at("Equipment.ChuFace");
if (manualChange || CVarGetInteger(equipmentChuFace.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentChuFace.cvar, equipmentChuFace.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentChuFace.valuesCvar, equipmentChuFace.defaultColor);
PATCH_GFX(gGiBombchuDL, "Equipment_ChuFace1", equipmentChuFace.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBombchuDL, "Equipment_ChuFace2", equipmentChuFace.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gBombchuDL, "Equipment_ChuFace3", equipmentChuFace.changedCvar, 2, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
@@ -1036,7 +1040,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& equipmentChuBody = cosmeticOptions.at("Equipment.ChuBody");
if (manualChange || CVarGetInteger(equipmentChuBody.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentChuBody.cvar, equipmentChuBody.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentChuBody.valuesCvar, equipmentChuBody.defaultColor);
PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody1", equipmentChuBody.changedCvar, 39, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody2", equipmentChuBody.changedCvar, 40, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody3", equipmentChuBody.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -1046,7 +1050,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& equipmentBunnyHood = cosmeticOptions.at("Equipment.BunnyHood");
if (manualChange || CVarGetInteger(equipmentBunnyHood.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(equipmentBunnyHood.cvar, equipmentBunnyHood.defaultColor);
+ Color_RGBA8 color = CVarGetColor(equipmentBunnyHood.valuesCvar, equipmentBunnyHood.defaultColor);
PATCH_GFX(gGiBunnyHoodDL, "Equipment_BunnyHood1", equipmentBunnyHood.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBunnyHoodDL, "Equipment_BunnyHood2", equipmentBunnyHood.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255));
PATCH_GFX(gGiBunnyHoodDL, "Equipment_BunnyHood3", equipmentBunnyHood.changedCvar, 83, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -1065,7 +1069,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& consumableGreenRupee = cosmeticOptions.at("Consumable.GreenRupee");
if (manualChange || CVarGetInteger(consumableGreenRupee.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumableGreenRupee.cvar, consumableGreenRupee.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumableGreenRupee.valuesCvar, consumableGreenRupee.defaultColor);
PATCH_GFX(gGiGreenRupeeInnerColorDL, "Consumable_GreenRupee1", consumableGreenRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiGreenRupeeInnerColorDL, "Consumable_GreenRupee2", consumableGreenRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255));
PATCH_GFX(gGiGreenRupeeOuterColorDL, "Consumable_GreenRupee3", consumableGreenRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255));
@@ -1084,7 +1088,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& consumableBlueRupee = cosmeticOptions.at("Consumable.BlueRupee");
if (manualChange || CVarGetInteger(consumableBlueRupee.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumableBlueRupee.cvar, consumableBlueRupee.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumableBlueRupee.valuesCvar, consumableBlueRupee.defaultColor);
PATCH_GFX(gGiBlueRupeeInnerColorDL, "Consumable_BlueRupee1", consumableBlueRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiBlueRupeeInnerColorDL, "Consumable_BlueRupee2", consumableBlueRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255));
PATCH_GFX(gGiBlueRupeeOuterColorDL, "Consumable_BlueRupee3", consumableBlueRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255));
@@ -1092,7 +1096,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& consumableRedRupee = cosmeticOptions.at("Consumable.RedRupee");
if (manualChange || CVarGetInteger(consumableRedRupee.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumableRedRupee.cvar, consumableRedRupee.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumableRedRupee.valuesCvar, consumableRedRupee.defaultColor);
PATCH_GFX(gGiRedRupeeInnerColorDL, "Consumable_RedRupee1", consumableRedRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiRedRupeeInnerColorDL, "Consumable_RedRupee2", consumableRedRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255));
PATCH_GFX(gGiRedRupeeOuterColorDL, "Consumable_RedRupee3", consumableRedRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255));
@@ -1100,7 +1104,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& consumablePurpleRupee = cosmeticOptions.at("Consumable.PurpleRupee");
if (manualChange || CVarGetInteger(consumablePurpleRupee.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumablePurpleRupee.cvar, consumablePurpleRupee.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumablePurpleRupee.valuesCvar, consumablePurpleRupee.defaultColor);
PATCH_GFX(gGiPurpleRupeeInnerColorDL, "Consumable_PurpleRupee1", consumablePurpleRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiPurpleRupeeInnerColorDL, "Consumable_PurpleRupee2", consumablePurpleRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255));
PATCH_GFX(gGiPurpleRupeeOuterColorDL, "Consumable_PurpleRupee3", consumablePurpleRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255));
@@ -1108,7 +1112,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& consumableGoldRupee = cosmeticOptions.at("Consumable.GoldRupee");
if (manualChange || CVarGetInteger(consumableGoldRupee.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumableGoldRupee.cvar, consumableGoldRupee.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumableGoldRupee.valuesCvar, consumableGoldRupee.defaultColor);
PATCH_GFX(gGiGoldRupeeInnerColorDL, "Consumable_GoldRupee1", consumableGoldRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiGoldRupeeInnerColorDL, "Consumable_GoldRupee2", consumableGoldRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255));
PATCH_GFX(gGiGoldRupeeOuterColorDL, "Consumable_GoldRupee3", consumableGoldRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255));
@@ -1117,7 +1121,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& consumableHearts = cosmeticOptions.at("Consumable.Hearts");
if (manualChange || CVarGetInteger(consumableHearts.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumableHearts.cvar, consumableHearts.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumableHearts.valuesCvar, consumableHearts.defaultColor);
/*
PATCH_GFX(gGiRecoveryHeartDL, "Consumable_Hearts1", consumableHearts.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255));
PATCH_GFX(gGiRecoveryHeartDL, "Consumable_Hearts2", consumableHearts.changedCvar, 26, gsSPGrayscale(true));
@@ -1133,7 +1137,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
}
static CosmeticOption& consumableMagic = cosmeticOptions.at("Consumable.Magic");
if (manualChange || CVarGetInteger(consumableMagic.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(consumableMagic.cvar, consumableMagic.defaultColor);
+ Color_RGBA8 color = CVarGetColor(consumableMagic.valuesCvar, consumableMagic.defaultColor);
PATCH_GFX(gGiMagicJarSmallDL, "Consumable_Magic1", consumableMagic.changedCvar, 31, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gGiMagicJarSmallDL, "Consumable_Magic2", consumableMagic.changedCvar, 32, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
PATCH_GFX(gGiMagicJarLargeDL, "Consumable_Magic3", consumableMagic.changedCvar, 31, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -1144,7 +1148,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& npcGoldenSkulltula = cosmeticOptions.at("NPC.GoldenSkulltula");
if (manualChange || CVarGetInteger(npcGoldenSkulltula.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(npcGoldenSkulltula.cvar, npcGoldenSkulltula.defaultColor);
+ Color_RGBA8 color = CVarGetColor(npcGoldenSkulltula.valuesCvar, npcGoldenSkulltula.defaultColor);
PATCH_GFX(gSkulltulaTokenDL, "NPC_GoldenSkulltula1", npcGoldenSkulltula.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
PATCH_GFX(gSkulltulaTokenDL, "NPC_GoldenSkulltula2", npcGoldenSkulltula.changedCvar, 6, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255));
PATCH_GFX(gSkulltulaTokenFlameDL, "NPC_GoldenSkulltula3", npcGoldenSkulltula.changedCvar, 32, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
@@ -1159,7 +1163,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& npcGerudo = cosmeticOptions.at("NPC.Gerudo");
if (manualChange || CVarGetInteger(npcGerudo.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(npcGerudo.cvar, npcGerudo.defaultColor);
+ Color_RGBA8 color = CVarGetColor(npcGerudo.valuesCvar, npcGerudo.defaultColor);
PATCH_GFX(gGerudoPurpleTorsoDL, "NPC_Gerudo1", npcGerudo.changedCvar, 139, gsDPSetEnvColor( color.r, color.g, color.b, 255));
PATCH_GFX(gGerudoPurpleRightThighDL, "NPC_Gerudo2", npcGerudo.changedCvar, 11, gsDPSetEnvColor(color.r, color.g, color.b, 255));
PATCH_GFX(gGerudoPurpleLeftThighDL, "NPC_Gerudo3", npcGerudo.changedCvar, 11, gsDPSetEnvColor(color.r, color.g, color.b, 255));
@@ -1172,39 +1176,39 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
static CosmeticOption& npcMetalTrap = cosmeticOptions.at("NPC.MetalTrap");
if (manualChange || CVarGetInteger(npcMetalTrap.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(npcMetalTrap.cvar, npcMetalTrap.defaultColor);
+ Color_RGBA8 color = CVarGetColor(npcMetalTrap.valuesCvar, npcMetalTrap.defaultColor);
PATCH_GFX(gSlidingBladeTrapDL, "NPC_MetalTrap1", npcMetalTrap.changedCvar, 59, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
}
static CosmeticOption& n64LogoRed = cosmeticOptions.at("Title.N64LogoRed");
if (manualChange || CVarGetInteger(n64LogoRed.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(n64LogoRed.cvar, n64LogoRed.defaultColor);
+ Color_RGBA8 color = CVarGetColor(n64LogoRed.valuesCvar, n64LogoRed.defaultColor);
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoRed1", n64LogoRed.changedCvar, 17, gsDPSetPrimColor(0, 0, 255, 255, 255, 255))
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoRed2", n64LogoRed.changedCvar, 18, gsDPSetEnvColor(color.r, color.g, color.b, 128));
}
static CosmeticOption& n64LogoBlue = cosmeticOptions.at("Title.N64LogoBlue");
if (manualChange || CVarGetInteger(n64LogoBlue.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(n64LogoBlue.cvar, n64LogoBlue.defaultColor);
+ Color_RGBA8 color = CVarGetColor(n64LogoBlue.valuesCvar, n64LogoBlue.defaultColor);
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoBlue1", n64LogoBlue.changedCvar, 29, gsDPSetPrimColor(0, 0, 255, 255, 255, 255))
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoBlue2", n64LogoBlue.changedCvar, 30, gsDPSetEnvColor(color.r, color.g, color.b, 128));
}
static CosmeticOption& n64LogoGreen = cosmeticOptions.at("Title.N64LogoGreen");
if (manualChange || CVarGetInteger(n64LogoGreen.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(n64LogoGreen.cvar, n64LogoGreen.defaultColor);
+ Color_RGBA8 color = CVarGetColor(n64LogoGreen.valuesCvar, n64LogoGreen.defaultColor);
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoGreen1", n64LogoGreen.changedCvar, 56, gsDPSetPrimColor(0, 0, 255, 255, 255, 255))
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoGreen2", n64LogoGreen.changedCvar, 57, gsDPSetEnvColor(color.r, color.g, color.b, 128));
}
static CosmeticOption& n64LogoYellow = cosmeticOptions.at("Title.N64LogoYellow");
if (manualChange || CVarGetInteger(n64LogoYellow.rainbowCvar, 0)) {
- Color_RGBA8 color = CVarGetColor(n64LogoYellow.cvar, n64LogoYellow.defaultColor);
+ Color_RGBA8 color = CVarGetColor(n64LogoYellow.valuesCvar, n64LogoYellow.defaultColor);
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoYellow1", n64LogoYellow.changedCvar, 81, gsDPSetPrimColor(0, 0, 255, 255, 255, 255))
PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoYellow2", n64LogoYellow.changedCvar, 82, gsDPSetEnvColor(color.r, color.g, color.b, 128));
}
if (gPlayState != nullptr) {
- if (CVarGetInteger(CVAR_COSMETIC("Link.BodyScale.Changed"), 0)) {
+ if (CVarGetInteger(CVAR_COSMETIC("Link.BodySize.Changed"), 0)) {
static Player* player = GET_PLAYER(gPlayState);
- float scale = CVarGetFloat(CVAR_COSMETIC("Link.BodyScale.Value"), 0.01f);
+ float scale = CVarGetFloat(CVAR_COSMETIC("Link.BodySize.Value"), 0.01f);
player->actor.scale.x = scale;
player->actor.scale.y = scale;
player->actor.scale.z = scale;
@@ -1235,24 +1239,36 @@ void Table_InitHeader(bool has_header = true) {
void DrawUseMarginsSlider(const std::string ElementName, const std::string CvarName){
std::string CvarLabel = CvarName + ".UseMargins";
std::string Label = ElementName + " use margins";
- UIWidgets::EnhancementCheckbox(Label.c_str(), CvarLabel.c_str());
- UIWidgets::Tooltip("Using this allow you move the element with General margins sliders");
+ UIWidgets::CVarCheckbox(Label.c_str(), CvarLabel.c_str(),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Using this allow you move the element with General margins sliders"));
}
-void DrawPositionsRadioBoxes(const std::string CvarName, bool NoAnchorEnabled = true){
+void DrawPositionsRadioBoxes(const std::string CvarName, bool NoAnchorEnabled = true) {
std::string CvarLabel = CvarName + ".PosType";
- UIWidgets::EnhancementRadioButton("Original position", CvarLabel.c_str(), 0);
- UIWidgets::Tooltip("This will use original intended elements position");
- UIWidgets::EnhancementRadioButton("Anchor to the left", CvarLabel.c_str(), 1);
- UIWidgets::Tooltip("This will make your elements follow the left side of your game window");
- UIWidgets::EnhancementRadioButton("Anchor to the right", CvarLabel.c_str(), 2);
- UIWidgets::Tooltip("This will make your elements follow the right side of your game window");
+ UIWidgets::CVarRadioButton("Original position", CvarLabel.c_str(), 0,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will use original intended elements position"));
+ UIWidgets::CVarRadioButton("Anchor to the left", CvarLabel.c_str(), 1,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will make your elements follow the left side of your game window"));
+ UIWidgets::CVarRadioButton("Anchor to the right", CvarLabel.c_str(), 2,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will make your elements follow the right side of your game window"));
if (NoAnchorEnabled) {
- UIWidgets::EnhancementRadioButton("No anchors", CvarLabel.c_str(), 3);
- UIWidgets::Tooltip("This will make your elements to not follow any side\nBetter used for center elements");
+ UIWidgets::CVarRadioButton(
+ "No anchors", CvarLabel.c_str(), 3,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will make your elements to not follow any side\nBetter used for center elements"));
}
- UIWidgets::EnhancementRadioButton("Hidden", CvarLabel.c_str(), 4);
- UIWidgets::Tooltip("This will make your elements hidden");
+ UIWidgets::CVarRadioButton(
+ "Hidden", CvarLabel.c_str(), 4,
+ UIWidgets::RadioButtonsOptions().Color(THEME_COLOR).Tooltip("This will make your elements hidden"));
}
void DrawPositionSlider(const std::string CvarName, int MinY, int MaxY, int MinX, int MaxX){
@@ -1260,10 +1276,22 @@ void DrawPositionSlider(const std::string CvarName, int MinY, int MaxY, int MinX
std::string PosYCvar = CvarName + ".PosY";
std::string InvisibleLabelX = "##" + PosXCvar;
std::string InvisibleLabelY = "##" + PosYCvar;
- UIWidgets::EnhancementSliderInt("Up <-> Down : %d", InvisibleLabelY.c_str(), PosYCvar.c_str(), MinY, MaxY, "", 0);
- UIWidgets::Tooltip("This slider is used to move Up and Down your elements.");
- UIWidgets::EnhancementSliderInt("Left <-> Right : %d", InvisibleLabelX.c_str(), PosXCvar.c_str(), MinX, MaxX, "", 0);
- UIWidgets::Tooltip("This slider is used to move Left and Right your elements.");
+ UIWidgets::CVarSliderInt("Up <-> Down : %d", PosYCvar.c_str(),
+ UIWidgets::IntSliderOptions()
+ .Min(MinY)
+ .Max(MaxY)
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("This slider is used to move Up and Down your elements."));
+ UIWidgets::CVarSliderInt("Left <-> Right : %d", PosXCvar.c_str(),
+ UIWidgets::IntSliderOptions()
+ .Min(MinX)
+ .Max(MaxX)
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("This slider is used to move Left and Right your elements."));
}
void DrawScaleSlider(const std::string CvarName, float DefaultValue){
@@ -1274,6 +1302,7 @@ void DrawScaleSlider(const std::string CvarName, float DefaultValue){
}
void Draw_Table_Dropdown(const char* Header_Title, const char* Table_ID, const char* Column_Title, const char* Slider_Title, const char* Slider_ID, int MinY, int MaxY, int MinX, int MaxX, float Default_Value) {
+ UIWidgets::PushStyleHeader(THEME_COLOR);
if (ImGui::CollapsingHeader(Header_Title)) {
if (ImGui::BeginTable(Table_ID, 1, FlagsTable)) {
ImGui::TableSetupColumn(Column_Title, FlagsCell, TablesCellsWidth);
@@ -1282,13 +1311,14 @@ void Draw_Table_Dropdown(const char* Header_Title, const char* Table_ID, const c
DrawPositionsRadioBoxes(Slider_ID);
DrawPositionSlider(Slider_ID, MinY, MaxY, MinX, MaxX);
DrawScaleSlider(Slider_ID, Default_Value);
- ImGui::NewLine();
ImGui::EndTable();
}
}
+ UIWidgets::PopStyleHeader();
}
void C_Button_Dropdown(const char* Header_Title, const char* Table_ID, const char* Column_Title, const char* Slider_Title, const char* Slider_ID, const char* Int_Type, float Slider_Scale_Value) {
+ UIWidgets::PushStyleHeader(THEME_COLOR);
if (ImGui::CollapsingHeader(Header_Title)) {
if (ImGui::BeginTable(Table_ID, 1, FlagsTable)) {
ImGui::TableSetupColumn(Column_Title, FlagsCell, TablesCellsWidth);
@@ -1306,7 +1336,6 @@ void C_Button_Dropdown(const char* Header_Title, const char* Table_ID, const cha
}
DrawPositionSlider(Slider_ID, 0, static_cast(ImGui::GetWindowViewport()->Size.y / 2), Min_X_CU, Max_X_CU);
DrawScaleSlider(Slider_ID, Slider_Scale_Value);
- ImGui::NewLine();
ImGui::EndTable();
}
std::shared_ptr controller = Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0);
@@ -1323,27 +1352,48 @@ void C_Button_Dropdown(const char* Header_Title, const char* Table_ID, const cha
controller->GetButton(BTN_CUSTOM_OCARINA_NOTE_D5)->AddButtonMapping(mapping);
}
}
+ UIWidgets::PopStyleHeader();
}
void Draw_Placements(){
- if (ImGui::BeginTable("tableMargins", 1, FlagsTable)) {
- ImGui::TableSetupColumn("General margins settings", FlagsCell, TablesCellsWidth);
- Table_InitHeader();
- UIWidgets::EnhancementSliderInt("Top : %dx", "##UIMARGINT", CVAR_COSMETIC("HUD.Margin.T"), static_cast(ImGui::GetWindowViewport()->Size.y / 2) * -1, 25, "", 0);
- UIWidgets::EnhancementSliderInt("Left: %dx", "##UIMARGINL", CVAR_COSMETIC("HUD.Margin.L"), -25, static_cast(ImGui::GetWindowViewport()->Size.x), "", 0);
- UIWidgets::EnhancementSliderInt("Right: %dx", "##UIMARGINR", CVAR_COSMETIC("HUD.Margin.R"), static_cast(ImGui::GetWindowViewport()->Size.x) * -1, 25, "", 0);
- UIWidgets::EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", CVAR_COSMETIC("HUD.Margin.B"), static_cast(ImGui::GetWindowViewport()->Size.y / 2) * -1, 25, "", 0);
- SetMarginAll("All margins on",true);
- UIWidgets::Tooltip("Set most of the elements to use margins\nSome elements with default position will not be affected\nElements without Anchor or Hidden will not be turned on");
- ImGui::SameLine();
- SetMarginAll("All margins off",false);
- UIWidgets::Tooltip("Set all of the elements to not use margins");
- ImGui::SameLine();
- ResetPositionAll();
- UIWidgets::Tooltip("Revert every element to use their original position and no margins");
- ImGui::NewLine();
- ImGui::EndTable();
- }
+ UIWidgets::PushStyleHeader(THEME_COLOR);
+ ImGui::SeparatorText("General Margins Settings");
+ UIWidgets::CVarSliderInt("Top: %dpx", CVAR_COSMETIC("HUD.Margin.T"),
+ UIWidgets::IntSliderOptions()
+ .Min(static_cast(ImGui::GetWindowViewport()->Size.y / 2) * -1)
+ .Max(25)
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
+ UIWidgets::CVarSliderInt("Left: %dpx", CVAR_COSMETIC("HUD.Margin.L"),
+ UIWidgets::IntSliderOptions()
+ .Min(-25)
+ .Max(static_cast(ImGui::GetWindowViewport()->Size.x))
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
+ UIWidgets::CVarSliderInt("Right: %dpx", CVAR_COSMETIC("HUD.Margin.R"),
+ UIWidgets::IntSliderOptions()
+ .Min(static_cast(ImGui::GetWindowViewport()->Size.x) * -1)
+ .Max(25)
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
+ UIWidgets::CVarSliderInt("Bottom: %dpx", CVAR_COSMETIC("HUD.Margin.B"),
+ UIWidgets::IntSliderOptions()
+ .Min(static_cast(ImGui::GetWindowViewport()->Size.y / 2) * -1)
+ .Max(25)
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
+ SetMarginAll("All margins on", true,
+ "Set most of the elements to use margins\nSome elements with default position will not be "
+ "affected\nElements without Anchor or Hidden will not be turned on");
+ ImGui::SameLine();
+ SetMarginAll("All margins off", false, "Set all of the elements to not use margins");
+ ImGui::SameLine();
+ ResetPositionAll();
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
if (ImGui::CollapsingHeader("Hearts count position")) {
if (ImGui::BeginTable("tableHeartsCounts", 1, FlagsTable)) {
ImGui::TableSetupColumn("Hearts counts settings", FlagsCell, TablesCellsWidth);
@@ -1352,9 +1402,14 @@ void Draw_Placements(){
DrawPositionsRadioBoxes(CVAR_COSMETIC("HUD.HeartsCount"));
DrawPositionSlider(CVAR_COSMETIC("HUD.HeartsCount"), -22, static_cast(ImGui::GetWindowViewport()->Size.y), -125, static_cast(ImGui::GetWindowViewport()->Size.x));
DrawScaleSlider(CVAR_COSMETIC("HUD.HeartsCount"), 0.7f);
- UIWidgets::EnhancementSliderInt("Heart line length : %d", "##HeartLineLength", CVAR_COSMETIC("HUD.Hearts.LineLength"), 0, 20, "", 10);
- UIWidgets::Tooltip("This will set the length of a row of hearts. Set to 0 for unlimited length.");
- ImGui::NewLine();
+ UIWidgets::CVarSliderInt("Heart line length : %d", CVAR_COSMETIC("HUD.Hearts.LineLength"),
+ UIWidgets::IntSliderOptions()
+ .Min(0)
+ .Max(20)
+ .DefaultValue(0)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("This will set the length of a row of hearts. Set to 0 for unlimited length."));
ImGui::EndTable();
}
}
@@ -1364,11 +1419,13 @@ void Draw_Placements(){
Table_InitHeader(false);
DrawUseMarginsSlider("Magic meter", CVAR_COSMETIC("HUD.MagicBar"));
DrawPositionsRadioBoxes(CVAR_COSMETIC("HUD.MagicBar"));
- UIWidgets::EnhancementRadioButton("Anchor to life bar", CVAR_COSMETIC("HUD.MagicBar.PosType"), 5);
- UIWidgets::Tooltip("This will make your elements follow the bottom of the life meter");
+ UIWidgets::CVarRadioButton(
+ "Anchor to life bar", CVAR_COSMETIC("HUD.MagicBar.PosType"), 5,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will make your elements follow the bottom of the life meter"));
DrawPositionSlider(CVAR_COSMETIC("HUD.MagicBar"), 0, static_cast(ImGui::GetWindowViewport()->Size.y / 2), -5, static_cast(ImGui::GetWindowViewport()->Size.x / 2));
DrawScaleSlider(CVAR_COSMETIC("HUD.MagicBar"), 1.0f);
- ImGui::NewLine();
ImGui::EndTable();
}
}
@@ -1387,7 +1444,6 @@ void Draw_Placements(){
}
DrawPositionSlider(CVAR_COSMETIC("HUD.VisualSoA"), 0, static_cast(ImGui::GetWindowViewport()->Size.y / 2), Min_X_VSOA, Max_X_VSOA);
DrawScaleSlider(CVAR_COSMETIC("HUD.VisualSoA"), 1.0f);
- ImGui::NewLine();
ImGui::EndTable();
}
}
@@ -1413,7 +1469,6 @@ void Draw_Placements(){
}
DrawPositionSlider(CVAR_COSMETIC("HUD.Dpad"), 0, static_cast(ImGui::GetWindowViewport()->Size.y / 2), Min_X_Dpad, Max_X_Dpad);
DrawScaleSlider(CVAR_COSMETIC("HUD.Dpad"), 1.0f);
- ImGui::NewLine();
ImGui::EndTable();
}
}
@@ -1440,66 +1495,94 @@ void Draw_Placements(){
ImGui::TableSetupColumn("Enemy Health Bar settings", FlagsCell, TablesCellsWidth);
Table_InitHeader(false);
std::string posTypeCVar = CVAR_COSMETIC("HUD.EnemyHealthBar.PosType");
- UIWidgets::EnhancementRadioButton("Anchor to Enemy", posTypeCVar.c_str(), ENEMYHEALTH_ANCHOR_ACTOR);
- UIWidgets::Tooltip("This will use enemy on screen position");
- UIWidgets::EnhancementRadioButton("Anchor to the top", posTypeCVar.c_str(), ENEMYHEALTH_ANCHOR_TOP);
- UIWidgets::Tooltip("This will make your elements follow the top edge of your game window");
- UIWidgets::EnhancementRadioButton("Anchor to the bottom", posTypeCVar.c_str(), ENEMYHEALTH_ANCHOR_BOTTOM);
- UIWidgets::Tooltip("This will make your elements follow the bottom edge of your game window");
+ UIWidgets::CVarRadioButton("Anchor to Enemy", CVAR_COSMETIC("HUD.EnemyHealthBar.PosType"),
+ ENEMYHEALTH_ANCHOR_ACTOR,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will use enemy on screen position"));
+ UIWidgets::CVarRadioButton(
+ "Anchor to the top", CVAR_COSMETIC("HUD.EnemyHealthBar.PosType"), ENEMYHEALTH_ANCHOR_TOP,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will make your elements follow the top edge of your game window"));
+ UIWidgets::CVarRadioButton(
+ "Anchor to the bottom", CVAR_COSMETIC("HUD.EnemyHealthBar.PosType"), ENEMYHEALTH_ANCHOR_BOTTOM,
+ UIWidgets::RadioButtonsOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("This will make your elements follow the bottom edge of your game window"));
DrawPositionSlider(CVAR_COSMETIC("HUD.EnemyHealthBar."), -SCREEN_HEIGHT, SCREEN_HEIGHT, -static_cast(ImGui::GetWindowViewport()->Size.x / 2), static_cast(ImGui::GetWindowViewport()->Size.x / 2));
- if (UIWidgets::EnhancementSliderInt("Health Bar Width: %d", "##EnemyHealthBarWidth", CVAR_COSMETIC("HUD.EnemyHealthBar.Width.Value"), 32, 128, "", 64)) {
+ if (UIWidgets::CVarSliderInt(
+ "Health Bar Width: %d", CVAR_COSMETIC("HUD.EnemyHealthBar.Width.Value"),
+ UIWidgets::IntSliderOptions()
+ .Min(32)
+ .Max(128)
+ .DefaultValue(64)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR)
+ .Tooltip("This will change the width of the health bar"))) {
CVarSetInteger(CVAR_COSMETIC("HUD.EnemyHealthBar.Width.Changed"), 1);
}
- UIWidgets::Tooltip("This will change the width of the health bar");
ImGui::SameLine();
- if (ImGui::Button("Reset##EnemyHealthBarWidth")) {
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ImGui::CalcTextSize("g").y * 2));
+ if (UIWidgets::Button("Reset##EnemyHealthBarWidth",
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBar.Width.Value"));
CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBar.Width.Changed"));
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
- ImGui::NewLine();
ImGui::EndTable();
}
}
+ UIWidgets::PopStyleHeader();
}
void Reset_Option_Single(const char* Button_Title, const char* name) {
ImGui::SameLine();
- if (ImGui::Button(Button_Title)) {
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ImGui::CalcTextSize("g").y * 2));
+ if (UIWidgets::Button(Button_Title,
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
CVarClear(name);
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
}
void Reset_Option_Double(const char* Button_Title, const char* name) {
ImGui::SameLine();
- if (ImGui::Button(Button_Title)) {
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ImGui::CalcTextSize("g").y * 2));
+ if (UIWidgets::Button(Button_Title,
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
CVarClear((std::string(name) + ".Value").c_str());
CVarClear((std::string(name) + ".Changed").c_str());
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
}
void DrawSillyTab() {
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- if (UIWidgets::EnhancementCheckbox("Let It Snow", CVAR_GENERAL("LetItSnow"))) {
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
- }
- UIWidgets::Tooltip("Makes snow fall, changes chest texture colors to red and green, etc, for December holidays.\nWill reset on restart outside of December 23-25.");
+ UIWidgets::CVarCheckbox("Let It Snow", CVAR_GENERAL("LetItSnow"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Makes snow fall, changes chest texture colors to red and green, etc, for December holidays.\nWill reset on restart outside of December 23-25."));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %.3fx", "##Link_BodyScale", CVAR_COSMETIC("Link.BodyScale.Value"), 0.001f, 0.025f, "", 0.01f, true)) {
- CVarSetInteger(CVAR_COSMETIC("Link.BodyScale.Changed"), 1);
+ if (UIWidgets::CVarSliderFloat("Link Body Size", CVAR_COSMETIC("Link.BodySize.Value"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.3f")
+ .Min(0.001f)
+ .Max(0.05f)
+ .DefaultValue(0.01f)
+ .Step(0.001f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR))) {
+ CVarSetInteger(CVAR_COSMETIC("Link.BodySize.Changed"), 1);
}
ImGui::SameLine();
- if (ImGui::Button("Reset##Link_BodyScale")) {
- CVarClear(CVAR_COSMETIC("Link.BodyScale.Value"));
- CVarClear(CVAR_COSMETIC("Link.BodyScale.Changed"));
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ImGui::CalcTextSize("g").y * 2));
+ if (UIWidgets::Button("Reset##Link_BodySize",
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 36)).Padding(ImVec2(5.0f, 0.0f)))) {
+ CVarClear(CVAR_COSMETIC("Link.BodySize.Value"));
+ CVarClear(CVAR_COSMETIC("Link.BodySize.Changed"));
if (gPlayState != nullptr) {
static Player* player = GET_PLAYER(gPlayState);
player->actor.scale.x = 0.01f;
@@ -1508,62 +1591,135 @@ void DrawSillyTab() {
}
}
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
-
- if (UIWidgets::EnhancementSliderFloat("Link Head Scale: %.2fx", "##Link_HeadScale", CVAR_COSMETIC("Link.HeadScale.Value"), 0.4f, 4.0f, "", 1.0f, false)) {
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
+ if (UIWidgets::CVarSliderFloat("Link Head Scale", CVAR_COSMETIC("Link.HeadScale.Value"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.1fx")
+ .Min(0.1f)
+ .Max(5.0f)
+ .DefaultValue(1.0f)
+ .Step(0.1f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR))) {
CVarSetInteger(CVAR_COSMETIC("Link.HeadScale.Changed"), 1);
}
Reset_Option_Double("Reset##Link_HeadScale", CVAR_COSMETIC("Link.HeadScale"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- if (UIWidgets::EnhancementSliderFloat("Link Sword Scale: %f", "##Link_SwordScale", CVAR_COSMETIC("Link.SwordScale.Value"), 1.0f, 2.5f, "", 1.0f, false)) {
+ if (UIWidgets::CVarSliderFloat("Link Sword Scale", CVAR_COSMETIC("Link.SwordScale.Value"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.1fx")
+ .Min(0.1f)
+ .Max(5.0f)
+ .DefaultValue(1.0f)
+ .Step(0.1f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR))) {
CVarSetInteger(CVAR_COSMETIC("Link.SwordScale.Changed"), 1);
}
Reset_Option_Double("Reset##Link_SwordScale", CVAR_COSMETIC("Link.SwordScale"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementSliderFloat("Bunny Hood Length: %f", "##BunnyHood_EarLength", CVAR_COSMETIC("BunnyHood.EarLength"), -300.0f, 1000.0f, "", 0.0f, false);
+ UIWidgets::CVarSliderFloat("Bunny Hood Length", CVAR_COSMETIC("BunnyHood.EarLength"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.0f")
+ .Min(-300.0f)
+ .Max(1000.0f)
+ .DefaultValue(0.0f)
+ .Step(10.0f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
Reset_Option_Single("Reset##BunnyHood_EarLength", CVAR_COSMETIC("BunnyHood.EarLength"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", CVAR_COSMETIC("BunnyHood.EarSpread"), -300.0f, 500.0f, "", 0.0f, false);
+ UIWidgets::CVarSliderFloat("Bunny Hood Spread", CVAR_COSMETIC("BunnyHood.EarSpread"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.0f")
+ .Min(-300.0f)
+ .Max(500.0f)
+ .DefaultValue(0.0f)
+ .Step(10.0f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
Reset_Option_Single("Reset##BunnyHood_EarSpread", CVAR_COSMETIC("BunnyHood.EarSpread"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"), 0.0f, 5000.0f, "", 0.0f, false);
+ UIWidgets::CVarSliderFloat("Goron Neck Length", CVAR_COSMETIC("Goron.NeckLength"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.0f")
+ .Min(0.0f)
+ .Max(5000.0f)
+ .DefaultValue(0.0f)
+ .Step(10.0f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
Reset_Option_Single("Reset##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementCheckbox("Unfix Goron Spin", CVAR_COSMETIC("UnfixGoronSpin"));
+ UIWidgets::CVarCheckbox("Unfix Goron Spin", CVAR_COSMETIC("UnfixGoronSpin"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", CVAR_COSMETIC("Fairies.Size"), 0.25f, 5.0f, "", 1.0f, false);
+ UIWidgets::CVarSliderFloat("Fairies Size", CVAR_COSMETIC("Fairies.Size"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.1fx")
+ .Min(0.1f)
+ .Max(5.0f)
+ .DefaultValue(1.0f)
+ .Step(0.1f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
Reset_Option_Single("Reset##Fairies_Size", CVAR_COSMETIC("Fairies.Size"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementSliderFloat("N64 Logo Spin Speed: %f", "##N64Logo_SpinSpeed", CVAR_COSMETIC("N64Logo.SpinSpeed"), 0.25f, 5.0f, "", 1.0f, false);
+ UIWidgets::CVarSliderFloat("N64 Logo Spin Speed", CVAR_COSMETIC("N64Logo.SpinSpeed"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.1fx")
+ .Min(0.1f)
+ .Max(5.0f)
+ .DefaultValue(1.0f)
+ .Step(0.1f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
Reset_Option_Single("Reset##N64Logo_SpinSpeed", CVAR_COSMETIC("N64Logo.SpinSpeed"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- UIWidgets::EnhancementSliderFloat("Moon Size: %f", "##Moon_Size", CVAR_COSMETIC("Moon.Size"), 0.5f, 2.0f, "", 1.0f, false);
+ UIWidgets::CVarSliderFloat("Moon Size", CVAR_COSMETIC("Moon.Size"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.1fx")
+ .Min(0.1f)
+ .Max(5.0f)
+ .DefaultValue(1.0f)
+ .Step(0.1f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
Reset_Option_Single("Reset##Moon_Size", CVAR_COSMETIC("Moon.Size"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- if (UIWidgets::EnhancementSliderFloat("Kak Windmill Speed: %f", "##Kak_Windmill_Speed", CVAR_COSMETIC("Kak.Windmill_Speed.Value"), 100.0f, 6000.0f, "", 100.0f, false)) {
+ if (UIWidgets::CVarSliderFloat("Kak Windmill Speed", CVAR_COSMETIC("Kak.Windmill_Speed.Value"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.0f")
+ .Min(100.0f)
+ .Max(6000.0f)
+ .DefaultValue(100.0f)
+ .Step(10.0f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR))) {
CVarSetInteger(CVAR_COSMETIC("Kak.Windmill_Speed.Changed"), 1);
}
Reset_Option_Double("Reset##Kak_Windmill_Speed", CVAR_COSMETIC("Kak.Windmill_Speed"));
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
ImGui::EndDisabled();
}
@@ -1582,7 +1738,7 @@ void CopyMultipliedColor(CosmeticOption& cosmeticOptionSrc, CosmeticOption& cosm
cosmeticOptionTarget.currentColor.z = newColor.b / 255.0f;
cosmeticOptionTarget.currentColor.w = newColor.a / 255.0f;
- CVarSetColor(cosmeticOptionTarget.cvar, newColor);
+ CVarSetColor(cosmeticOptionTarget.valuesCvar, newColor);
CVarSetInteger((cosmeticOptionTarget.rainbowCvar), 0);
CVarSetInteger((cosmeticOptionTarget.changedCvar), 1);
}
@@ -1642,7 +1798,7 @@ void RandomizeColor(CosmeticOption& cosmeticOption) {
cosmeticOption.currentColor.z = newColor.b / 255.0f;
cosmeticOption.currentColor.w = newColor.a / 255.0f;
- CVarSetColor(cosmeticOption.cvar, newColor);
+ CVarSetColor(cosmeticOption.valuesCvar, newColor);
CVarSetInteger(cosmeticOption.rainbowCvar, 0);
CVarSetInteger(cosmeticOption.changedCvar, 1);
ApplySideEffects(cosmeticOption);
@@ -1658,12 +1814,12 @@ void ResetColor(CosmeticOption& cosmeticOption) {
CVarClear(cosmeticOption.changedCvar);
CVarClear(cosmeticOption.rainbowCvar);
CVarClear(cosmeticOption.lockedCvar);
- CVarClear(cosmeticOption.cvar);
- CVarClear((std::string(cosmeticOption.cvar) + ".R").c_str());
- CVarClear((std::string(cosmeticOption.cvar) + ".G").c_str());
- CVarClear((std::string(cosmeticOption.cvar) + ".B").c_str());
- CVarClear((std::string(cosmeticOption.cvar) + ".A").c_str());
- CVarClear((std::string(cosmeticOption.cvar) + ".Type").c_str());
+ CVarClear(cosmeticOption.valuesCvar);
+ CVarClear((std::string(cosmeticOption.valuesCvar) + ".R").c_str());
+ CVarClear((std::string(cosmeticOption.valuesCvar) + ".G").c_str());
+ CVarClear((std::string(cosmeticOption.valuesCvar) + ".B").c_str());
+ CVarClear((std::string(cosmeticOption.valuesCvar) + ".A").c_str());
+ CVarClear((std::string(cosmeticOption.valuesCvar) + ".Type").c_str());
// This portion should match 1:1 the multiplied colors in `ApplySideEffect()`
if (cosmeticOption.label == "Bow Body") {
@@ -1709,40 +1865,28 @@ void ResetColor(CosmeticOption& cosmeticOption) {
}
void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
- bool colorChanged;
- if (cosmeticOption.supportsAlpha) {
- colorChanged = ImGui::ColorEdit4(cosmeticOption.label.c_str(), (float*)&cosmeticOption.currentColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel);
- } else {
- colorChanged = ImGui::ColorEdit3(cosmeticOption.label.c_str(), (float*)&cosmeticOption.currentColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel);
- }
- if (colorChanged) {
- Color_RGBA8 color;
- color.r = static_cast(cosmeticOption.currentColor.x * 255.0f);
- color.g = static_cast(cosmeticOption.currentColor.y * 255.0f);
- color.b = static_cast(cosmeticOption.currentColor.z * 255.0f);
- color.a = static_cast(cosmeticOption.currentColor.w * 255.0f);
-
- CVarSetColor(cosmeticOption.cvar, color);
+ if (UIWidgets::CVarColorPicker(cosmeticOption.label.c_str(), cosmeticOption.cvar,
+ cosmeticOption.defaultColor,
+ cosmeticOption.supportsAlpha, 0, THEME_COLOR)) {
CVarSetInteger((cosmeticOption.rainbowCvar), 0);
CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplySideEffects(cosmeticOption);
ApplyOrResetCustomGfxPatches();
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
- ImGui::SameLine();
- ImGui::Text("%s", cosmeticOption.label.c_str());
//the longest option name
- ImGui::SameLine((ImGui::CalcTextSize("Message Light Blue (None No Shadow) Color").x * 1.0f) + 60.0f);
- if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) {
+ ImGui::SameLine((ImGui::CalcTextSize("Message Light Blue (None No Shadow)").x * 1.0f) + 60.0f);
+ if (UIWidgets::Button(
+ ("Random##" + cosmeticOption.label).c_str(),
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 31)).Padding(ImVec2(2.0f, 0.0f)).Color(THEME_COLOR))) {
RandomizeColor(cosmeticOption);
ApplyOrResetCustomGfxPatches();
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
if (cosmeticOption.supportsRainbow) {
ImGui::SameLine();
- bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0);
- if (ImGui::Checkbox(("Rainbow##" + cosmeticOption.label).c_str(), &isRainbow)) {
- CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow);
+ if (UIWidgets::CVarCheckbox(("Rainbow##" + cosmeticOption.label).c_str(), cosmeticOption.rainbowCvar,
+ UIWidgets::CheckboxOptions().Color(THEME_COLOR))) {
CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplySideEffects(cosmeticOption);
ApplyOrResetCustomGfxPatches();
@@ -1750,14 +1894,14 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
}
}
ImGui::SameLine();
- bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0);
- if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) {
- CVarSetInteger((cosmeticOption.lockedCvar), isLocked);
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
- }
+
+ UIWidgets::CVarCheckbox(("Locked##" + cosmeticOption.label).c_str(), cosmeticOption.lockedCvar,
+ UIWidgets::CheckboxOptions().Color(THEME_COLOR));
+
if (CVarGetInteger((cosmeticOption.changedCvar), 0)) {
ImGui::SameLine();
- if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) {
+ if (UIWidgets::Button(("Reset##" + cosmeticOption.label).c_str(),
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 31)).Padding(ImVec2(2.0f, 0.0f)))) {
ResetColor(cosmeticOption);
ApplyOrResetCustomGfxPatches();
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
@@ -1769,32 +1913,35 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
std::string label = groupLabels.at(cosmeticGroup);
ImGui::Text("%s", label.c_str());
// the longest option name
- ImGui::SameLine((ImGui::CalcTextSize("Message Light Blue (None No Shadow) Color").x * 1.0f) + 60.0f);
- if (ImGui::Button(("Random##" + label).c_str())) {
+ ImGui::SameLine((ImGui::CalcTextSize("Message Light Blue (None No Shadow)").x * 1.0f) + 60.0f);
+ if (UIWidgets::Button(("Random##" + label).c_str(),
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 31)).Padding(ImVec2(2.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
- if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) && !CVarGetInteger(cosmeticOption.lockedCvar, 0)) {
+ if (cosmeticOption.group == cosmeticGroup &&
+ (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) &&
+ !CVarGetInteger(cosmeticOption.lockedCvar, 0)) {
RandomizeColor(cosmeticOption);
}
}
ApplyOrResetCustomGfxPatches();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
ImGui::SameLine();
- if (ImGui::Button(("Reset##" + label).c_str())) {
+ if (UIWidgets::Button(("Reset##" + label).c_str(),
+ UIWidgets::ButtonOptions().Size(ImVec2(80, 31)).Padding(ImVec2(2.0f, 0.0f)))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.group == cosmeticGroup && !CVarGetInteger(cosmeticOption.lockedCvar, 0)) {
ResetColor(cosmeticOption);
}
}
ApplyOrResetCustomGfxPatches();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
+ UIWidgets::Spacer();
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0))) {
DrawCosmeticRow(cosmeticOption);
}
}
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
}
static const char* colorSchemes[2] = {
@@ -1807,193 +1954,199 @@ void CosmeticsEditorWindow::ApplyDungeonKeyColors() {
ResetColor(cosmeticOptions.at("Key.KeyringRing"));
// Forest Temple
- CVarSetColor(cosmeticOptions["Key.ForestSmallBody"].cvar, { 4, 195, 46, 255 });
+ CVarSetColor(cosmeticOptions["Key.ForestSmallBody"].valuesCvar, { 4, 195, 46, 255 });
CVarSetInteger(cosmeticOptions["Key.ForestSmallBody"].changedCvar, 1);
cosmeticOptions["Key.ForestSmallBody"].currentColor = { 4 / 255.0f, 195 / 255.0f, 46 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.ForestSmallEmblem"));
ResetColor(cosmeticOptions.at("Key.ForestBossBody"));
- CVarSetColor(cosmeticOptions["Key.ForestBossGem"].cvar, { 0, 255, 0, 255 });
+ CVarSetColor(cosmeticOptions["Key.ForestBossGem"].valuesCvar, { 0, 255, 0, 255 });
CVarSetInteger(cosmeticOptions["Key.ForestBossGem"].changedCvar, 1);
cosmeticOptions["Key.ForestBossGem"].currentColor = { 0, 255 / 255.0f, 0, 255 / 255.0f };
// Fire Temple
- CVarSetColor(cosmeticOptions["Key.FireSmallBody"].cvar, { 237, 95, 95, 255 });
+ CVarSetColor(cosmeticOptions["Key.FireSmallBody"].valuesCvar, { 237, 95, 95, 255 });
CVarSetInteger(cosmeticOptions["Key.FireSmallBody"].changedCvar, 1);
cosmeticOptions["Key.FireSmallBody"].currentColor = { 237 / 255.0f, 95 / 255.0f, 95 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.FireSmallEmblem"));
ResetColor(cosmeticOptions.at("Key.FireBossBody"));
- CVarSetColor(cosmeticOptions["Key.FireBossGem"].cvar, { 255, 30, 0, 255 });
+ CVarSetColor(cosmeticOptions["Key.FireBossGem"].valuesCvar, { 255, 30, 0, 255 });
CVarSetInteger(cosmeticOptions["Key.FireBossGem"].changedCvar, 1);
cosmeticOptions["Key.FireBossGem"].currentColor = { 255 / 255.0f, 30 / 255.0f, 0, 255 / 255.0f };
// Water Temple
- CVarSetColor(cosmeticOptions["Key.WaterSmallBody"].cvar, { 85, 180, 223, 255 });
+ CVarSetColor(cosmeticOptions["Key.WaterSmallBody"].valuesCvar, { 85, 180, 223, 255 });
CVarSetInteger(cosmeticOptions["Key.WaterSmallBody"].changedCvar, 1);
cosmeticOptions["Key.WaterSmallBody"].currentColor = { 85 / 255.0f, 180 / 255.0f, 223 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.WaterSmallEmblem"));
ResetColor(cosmeticOptions.at("Key.WaterBossBody"));
- CVarSetColor(cosmeticOptions["Key.WaterBossGem"].cvar, { 0, 137, 255, 255 });
+ CVarSetColor(cosmeticOptions["Key.WaterBossGem"].valuesCvar, { 0, 137, 255, 255 });
CVarSetInteger(cosmeticOptions["Key.WaterBossGem"].changedCvar, 1);
cosmeticOptions["Key.WaterBossGem"].currentColor = { 0, 137 / 255.0f, 255 / 255.0f, 255 / 255.0f };
// Spirit Temple
- CVarSetColor(cosmeticOptions["Key.SpiritSmallBody"].cvar, { 222, 158, 47, 255 });
+ CVarSetColor(cosmeticOptions["Key.SpiritSmallBody"].valuesCvar, { 222, 158, 47, 255 });
CVarSetInteger(cosmeticOptions["Key.SpiritSmallBody"].changedCvar, 1);
cosmeticOptions["Key.SpiritSmallBody"].currentColor = { 222 / 255.0f, 158 / 255.0f, 47 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.SpiritSmallEmblem"));
ResetColor(cosmeticOptions.at("Key.SpiritBossBody"));
- CVarSetColor(cosmeticOptions["Key.SpiritBossGem"].cvar, { 255, 85, 0, 255 });
+ CVarSetColor(cosmeticOptions["Key.SpiritBossGem"].valuesCvar, { 255, 85, 0, 255 });
CVarSetInteger(cosmeticOptions["Key.SpiritBossGem"].changedCvar, 1);
cosmeticOptions["Key.SpiritBossGem"].currentColor = { 255 / 255.0f, 85 / 255.0f, 0, 255 / 255.0f };
// Shadow Temple
- CVarSetColor(cosmeticOptions["Key.ShadowSmallBody"].cvar, { 126, 16, 177, 255 });
+ CVarSetColor(cosmeticOptions["Key.ShadowSmallBody"].valuesCvar, { 126, 16, 177, 255 });
CVarSetInteger(cosmeticOptions["Key.ShadowSmallBody"].changedCvar, 1);
cosmeticOptions["Key.ShadowSmallBody"].currentColor = { 126 / 255.0f, 16 / 255.0f, 177 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.ShadowSmallEmblem"));
ResetColor(cosmeticOptions.at("Key.ShadowBossBody"));
- CVarSetColor(cosmeticOptions["Key.ShadowBossGem"].cvar, { 153, 0, 255, 255 });
+ CVarSetColor(cosmeticOptions["Key.ShadowBossGem"].valuesCvar, { 153, 0, 255, 255 });
CVarSetInteger(cosmeticOptions["Key.ShadowBossGem"].changedCvar, 1);
cosmeticOptions["Key.ShadowBossGem"].currentColor = { 153 / 255.0f, 0, 255 / 255.0f, 255 / 255.0f };
// Ganon's Tower
- CVarSetColor(cosmeticOptions["Key.GanonsSmallBody"].cvar, { 80, 80, 80, 255 });
+ CVarSetColor(cosmeticOptions["Key.GanonsSmallBody"].valuesCvar, { 80, 80, 80, 255 });
CVarSetInteger(cosmeticOptions["Key.GanonsSmallBody"].changedCvar, 1);
cosmeticOptions["Key.GanonsSmallBody"].currentColor = { 80 / 255.0f, 80 / 255.0f, 80 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.GanonsSmallEmblem"));
- CVarSetColor(cosmeticOptions["Key.GanonsBossBody"].cvar, { 80, 80, 80, 255 });
+ CVarSetColor(cosmeticOptions["Key.GanonsBossBody"].valuesCvar, { 80, 80, 80, 255 });
CVarSetInteger(cosmeticOptions["Key.GanonsBossBody"].changedCvar, 1);
cosmeticOptions["Key.GanonsBossBody"].currentColor = { 80 / 255.0f, 80 / 255.0f, 80 / 255.0f, 255 / 255.0f };
- CVarSetColor(cosmeticOptions["Key.GanonsBossGem"].cvar, { 255, 0, 0, 255 });
+ CVarSetColor(cosmeticOptions["Key.GanonsBossGem"].valuesCvar, { 255, 0, 0, 255 });
CVarSetInteger(cosmeticOptions["Key.GanonsBossGem"].changedCvar, 1);
cosmeticOptions["Key.GanonsBossGem"].currentColor = { 255 / 255.0f, 0, 0, 255 / 255.0f };
// Bottom of the Well
- CVarSetColor(cosmeticOptions["Key.WellSmallBody"].cvar, { 227, 110, 255, 255 });
+ CVarSetColor(cosmeticOptions["Key.WellSmallBody"].valuesCvar, { 227, 110, 255, 255 });
CVarSetInteger(cosmeticOptions["Key.WellSmallBody"].changedCvar, 1);
cosmeticOptions["Key.WellSmallBody"].currentColor = { 227 / 255.0f, 110 / 255.0f, 255 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.WellSmallEmblem"));
// Gerudo Training Ground
- CVarSetColor(cosmeticOptions["Key.GTGSmallBody"].cvar, { 221, 212, 60, 255 });
+ CVarSetColor(cosmeticOptions["Key.GTGSmallBody"].valuesCvar, { 221, 212, 60, 255 });
CVarSetInteger(cosmeticOptions["Key.GTGSmallBody"].changedCvar, 1);
cosmeticOptions["Key.GTGSmallBody"].currentColor = { 221 / 255.0f, 212 / 255.0f, 60 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.GTGSmallEmblem"));
// Gerudo Fortress
- CVarSetColor(cosmeticOptions["Key.FortSmallBody"].cvar, { 255, 255, 255, 255 });
+ CVarSetColor(cosmeticOptions["Key.FortSmallBody"].valuesCvar, { 255, 255, 255, 255 });
CVarSetInteger(cosmeticOptions["Key.FortSmallBody"].changedCvar, 1);
cosmeticOptions["Key.FortSmallBody"].currentColor = { 255 / 255.0f, 255 / 255.0f, 255 / 255.0f, 255 / 255.0f };
ResetColor(cosmeticOptions.at("Key.FortSmallEmblem"));
}
void CosmeticsEditorWindow::DrawElement() {
- ImGui::Text("Color Scheme");
- ImGui::SameLine();
- UIWidgets::EnhancementCombobox(CVAR_COSMETIC("DefaultColorScheme"), colorSchemes, COLORSCHEME_N64);
- UIWidgets::EnhancementCheckbox("Advanced Mode", CVAR_COSMETIC("AdvancedMode"));
- UIWidgets::InsertHelpHoverText(
- "Some cosmetic options may not apply if you have any mods that provide custom models for the cosmetic option.\n\n"
- "For example, if you have custom Link model, then the Link's Hair color option will most likely not apply."
- );
-
+ UIWidgets::CVarCombobox("Color Scheme", CVAR_COSMETIC("DefaultColorScheme"), colorSchemes,
+ UIWidgets::ComboboxOptions()
+ .DefaultIndex(COLORSCHEME_N64)
+ .Color(THEME_COLOR)
+ .LabelPosition(UIWidgets::LabelPositions::Near)
+ .ComponentAlignment(UIWidgets::ComponentAlignments::Right));
+ UIWidgets::CVarCheckbox("Sync Rainbow colors", CVAR_COSMETIC("RainbowSync"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR));
+ UIWidgets::CVarSliderFloat("Rainbow Speed", CVAR_COSMETIC("RainbowSpeed"),
+ UIWidgets::FloatSliderOptions()
+ .Format("%.2f")
+ .Min(0.01f)
+ .Max(1.0f)
+ .DefaultValue(0.6f)
+ .Step(0.01f)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR));
+ UIWidgets::CVarCheckbox("Randomize All on New Scene", CVAR_COSMETIC("RandomizeAllOnNewScene"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip("Enables randomizing all unlocked cosmetics when you enter a new scene."));
+ UIWidgets::CVarCheckbox(
+ "Advanced Mode", CVAR_COSMETIC("AdvancedMode"),
+ UIWidgets::CheckboxOptions()
+ .Color(THEME_COLOR)
+ .Tooltip(
+ "Some cosmetic options may not apply if you have any mods that provide custom models for the cosmetic "
+ "option.\n\n"
+ "For example, if you have custom Link model, then the Link's Hair color option will most likely not "
+ "apply."));
if (CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) {
- if (ImGui::Button("Lock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
+ if (UIWidgets::Button("Lock All Advanced",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.advancedOption) {
CVarSetInteger(cosmeticOption.lockedCvar, 1);
}
}
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
ImGui::SameLine();
- if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
+ if (UIWidgets::Button("Unlock All Advanced",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.advancedOption) {
CVarSetInteger(cosmeticOption.lockedCvar, 0);
}
}
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
}
- UIWidgets::EnhancementCheckbox("Sync Rainbow colors", CVAR_COSMETIC("RainbowSync"));
- UIWidgets::EnhancementSliderFloat("Rainbow Speed: %.3f", "##rainbowSpeed", CVAR_COSMETIC("RainbowSpeed"), 0.03f, 1.0f, "", 0.6f, false, true);
- UIWidgets::EnhancementCheckbox("Randomize All on New Scene", CVAR_COSMETIC("RandomizeAllOnNewScene"));
- UIWidgets::Tooltip("Enables randomizing all unlocked cosmetics when you enter a new scene.");
-
- if (ImGui::Button("Randomize All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
+ if (UIWidgets::Button("Randomize All",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
CosmeticsEditor_RandomizeAll();
}
ImGui::SameLine();
- if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
- for (auto& [id, cosmeticOption] : cosmeticOptions) {
- if (!CVarGetInteger(cosmeticOption.lockedCvar, 0)) {
- ResetColor(cosmeticOption);
- }
- }
+ if (UIWidgets::Button("Reset All",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
+ CVarClearBlock("gCosmetics");
ApplyOrResetCustomGfxPatches();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
-
- if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
+ if (UIWidgets::Button("Lock All",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) {
CVarSetInteger(cosmeticOption.lockedCvar, 1);
}
}
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
ImGui::SameLine();
- if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
+ if (UIWidgets::Button("Unlock All",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) {
CVarSetInteger(cosmeticOption.lockedCvar, 0);
}
}
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
- if (ImGui::Button("Rainbow All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
+ if (UIWidgets::Button("Rainbow All",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
- if (
- !CVarGetInteger(cosmeticOption.lockedCvar, 0) &&
- (
- !cosmeticOption.advancedOption ||
- CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)
- )
- ) {
+ if (!CVarGetInteger(cosmeticOption.lockedCvar, 0) &&
+ (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0))) {
CVarSetInteger(cosmeticOption.rainbowCvar, 1);
CVarSetInteger(cosmeticOption.changedCvar, 1);
}
}
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
ImGui::SameLine();
- if (ImGui::Button("Un-Rainbow All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
+ if (UIWidgets::Button("Un-Rainbow All",
+ UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
- if (
- !CVarGetInteger(cosmeticOption.lockedCvar, 0) &&
- (
- !cosmeticOption.advancedOption ||
- CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)
- )
- ) {
+ if (!CVarGetInteger(cosmeticOption.lockedCvar, 0) &&
+ (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0))) {
CVarSetInteger(cosmeticOption.rainbowCvar, 0);
}
}
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
+ UIWidgets::Spacer(3.0f);
+
+ UIWidgets::PushStyleTabs(THEME_COLOR);
if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Link & Items")) {
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_LINK);
DrawCosmeticGroup(COSMETICS_GROUP_GLOVES);
@@ -2006,14 +2159,15 @@ void CosmeticsEditorWindow::DrawElement() {
if (ImGui::BeginTabItem("Keys")) {
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
- if (ImGui::Button("Give all keys dungeon-specific colors", ImVec2(300.0f, 30.0f))) {
+ if (UIWidgets::Button(
+ "Give all keys dungeon-specific colors",
+ UIWidgets::ButtonOptions().Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) {
ApplyDungeonKeyColors();
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_KEYRING);
DrawCosmeticGroup(COSMETICS_GROUP_SMALL_KEYS);
@@ -2024,29 +2178,37 @@ void CosmeticsEditorWindow::DrawElement() {
if (ImGui::BeginTabItem("Effects")) {
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_MAGIC);
DrawCosmeticGroup(COSMETICS_GROUP_ARROWS);
DrawCosmeticGroup(COSMETICS_GROUP_SPIN_ATTACK);
DrawCosmeticGroup(COSMETICS_GROUP_TRAILS);
- if (UIWidgets::EnhancementSliderInt("Trails Duration: %d", "##Trails_Duration", CVAR_COSMETIC("Trails.Duration.Value"), 2, 20, "", 4)) {
+ if (UIWidgets::CVarSliderInt("Trails Duration: %d", CVAR_COSMETIC("Trails.Duration.Value"),
+ UIWidgets::IntSliderOptions()
+ .Min(2)
+ .Max(20)
+ .DefaultValue(4)
+ .Size(ImVec2(300.0f, 0.0f))
+ .Color(THEME_COLOR))) {
CVarSetInteger(CVAR_COSMETIC("Trails.Duration.Changed"), 1);
}
ImGui::SameLine();
- if (ImGui::Button("Reset##Trails_Duration")) {
+ ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (ImGui::CalcTextSize("g").y * 2));
+ if (UIWidgets::Button("Reset##Trails_Duration", UIWidgets::ButtonOptions()
+ .Size(ImVec2(80, 36))
+ .Padding(ImVec2(5.0f, 0.0f)))) {
CVarClear(CVAR_COSMETIC("Trails.Duration.Value"));
CVarClear(CVAR_COSMETIC("Trails.Duration.Changed"));
- Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("World & NPCs")) {
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_WORLD);
DrawCosmeticGroup(COSMETICS_GROUP_NAVI);
@@ -2060,7 +2222,7 @@ void CosmeticsEditorWindow::DrawElement() {
}
if (ImGui::BeginTabItem("HUD")) {
- UIWidgets::PaddedSeparator(true, true, 2.0f, 2.0f);
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_HUD);
DrawCosmeticGroup(COSMETICS_GROUP_TITLE);
@@ -2074,6 +2236,7 @@ void CosmeticsEditorWindow::DrawElement() {
if (CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) {
if (ImGui::BeginTabItem("Pause Menu")) {
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_KALEIDO);
ImGui::EndTabItem();
}
@@ -2081,12 +2244,14 @@ void CosmeticsEditorWindow::DrawElement() {
if (CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0)) {
if (ImGui::BeginTabItem("Message")) {
+ UIWidgets::Separator(true, true, 2.0f, 2.0f);
DrawCosmeticGroup(COSMETICS_GROUP_MESSAGE);
ImGui::EndTabItem();
}
}
ImGui::EndTabBar();
}
+ UIWidgets::PopStyleTabs();
}
void RegisterOnLoadGameHook() {
@@ -2113,7 +2278,7 @@ void CosmeticsEditorWindow::InitElement() {
// Convert the `current color` into the format that the ImGui color picker expects
for (auto& [id, cosmeticOption] : cosmeticOptions) {
Color_RGBA8 defaultColor = {cosmeticOption.defaultColor.r, cosmeticOption.defaultColor.g, cosmeticOption.defaultColor.b, cosmeticOption.defaultColor.a};
- Color_RGBA8 cvarColor = CVarGetColor(cosmeticOption.cvar, defaultColor);
+ Color_RGBA8 cvarColor = CVarGetColor(cosmeticOption.valuesCvar, defaultColor);
cosmeticOption.currentColor.x = cvarColor.r / 255.0f;
cosmeticOption.currentColor.y = cvarColor.g / 255.0f;
diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h
index c9a28ef29..9c3dd76ba 100644
--- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h
+++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h
@@ -52,7 +52,6 @@ static float TablesCellsWidth = 300.0f;
static ImGuiTableColumnFlags FlagsTable = ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV;
static ImGuiTableColumnFlags FlagsCell = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort;
-ImVec4 GetRandomValue();
void CosmeticsEditor_RandomizeAll();
void CosmeticsEditor_RandomizeGroup(CosmeticGroup group);
void CosmeticsEditor_ResetAll();
diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp
index 67547437d..33eed43f9 100644
--- a/soh/soh/Enhancements/debugconsole.cpp
+++ b/soh/soh/Enhancements/debugconsole.cpp
@@ -79,6 +79,7 @@ static bool ActorSpawnHandler(std::shared_ptr Console, const std:
if (args[8][0] != ',') {
spawnPoint.rot.z = std::stoi(args[8]);
}
+ [[fallthrough]];
case 6:
if (args[3][0] != ',') {
spawnPoint.pos.x = std::stoi(args[3]);
diff --git a/soh/soh/Enhancements/debugger/MessageViewer.cpp b/soh/soh/Enhancements/debugger/MessageViewer.cpp
index 589dbaf4a..aabe9ad61 100644
--- a/soh/soh/Enhancements/debugger/MessageViewer.cpp
+++ b/soh/soh/Enhancements/debugger/MessageViewer.cpp
@@ -1,6 +1,9 @@
#include "MessageViewer.h"
-#include
+#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
+#include "soh/OTRGlobals.h"
+
#include
#include "../custom-message/CustomMessageManager.h"
@@ -13,6 +16,8 @@
extern "C" u8 sMessageHasSetSfx;
+using namespace UIWidgets;
+
void MessageViewer::InitElement() {
CustomMessageManager::Instance->AddCustomMessageTable(TABLE_ID);
mTableIdBuf = static_cast(calloc(MAX_STRING_SIZE, sizeof(char)));
@@ -23,6 +28,7 @@ void MessageViewer::InitElement() {
void MessageViewer::DrawElement() {
ImGui::Text("Table ID");
ImGui::SameLine();
+ PushStyleInput(THEME_COLOR);
ImGui::InputText("##TableID", mTableIdBuf, MAX_STRING_SIZE, ImGuiInputTextFlags_CallbackCharFilter, UIWidgets::TextFilters::FilterAlphaNum);
UIWidgets::InsertHelpHoverText("Leave blank for vanilla table");
ImGui::Text("Text ID");
@@ -38,6 +44,8 @@ void MessageViewer::DrawElement() {
UIWidgets::InsertHelpHoverText("Hexadecimal Text ID of the message to load. Hexadecimal digits only (0-9/A-F).");
break;
}
+ PopStyleInput();
+ PushStyleCheckbox(THEME_COLOR);
if (ImGui::RadioButton("Hexadecimal", &mTextIdBase, HEXADECIMAL)) {
memset(mTextIdBuf, 0, sizeof(char) * MAX_STRING_SIZE);
}
@@ -45,8 +53,10 @@ void MessageViewer::DrawElement() {
if (ImGui::RadioButton("Decimal", &mTextIdBase, DECIMAL)) {
memset(mTextIdBuf, 0, sizeof(char) * MAX_STRING_SIZE);
}
+ PopStyleCheckbox();
ImGui::Text("Language");
ImGui::SameLine();
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("##Language", mLanguages[mLanguage])) {
// ReSharper disable CppDFAUnreachableCode
for (size_t i = 0; i < mLanguages.size(); i++) {
@@ -58,7 +68,9 @@ void MessageViewer::DrawElement() {
}
ImGui::EndCombo();
}
+ PopStyleCombobox();
UIWidgets::InsertHelpHoverText("Which language to load from the selected text ID");
+ PushStyleButton(THEME_COLOR);
if (ImGui::Button("Display Message##ExistingMessage")) {
mDisplayExistingMessageClicked = true;
}
@@ -66,11 +78,13 @@ void MessageViewer::DrawElement() {
UIWidgets::InsertHelpHoverText("Enter a string using Custom Message Syntax to preview it in-game. "
"Any newline (\\n) characters inserted by the Enter key will be stripped "
"from the output.");
+ PushStyleInput(THEME_COLOR);
ImGui::InputTextMultiline("##CustomMessage", mCustomMessageBuf, MAX_STRING_SIZE);
+ PopStyleInput();
if (ImGui::Button("Display Message##CustomMessage")) {
mDisplayCustomMessageClicked = true;
}
- // ReSharper restore CppDFAUnreachableCode
+ PopStyleButton();
}
void MessageViewer::UpdateElement() {
diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp
index 8aac60954..767ff2723 100644
--- a/soh/soh/Enhancements/debugger/actorViewer.cpp
+++ b/soh/soh/Enhancements/debugger/actorViewer.cpp
@@ -1,6 +1,7 @@
#include "actorViewer.h"
#include "../../util.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include "soh/ActorDB.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/nametag.h"
@@ -59,6 +60,8 @@ std::array acMapping = {
"Chest"
};
+using namespace UIWidgets;
+
typedef enum {
ACTORVIEWER_NAMETAGS_NONE,
ACTORVIEWER_NAMETAGS_DESC,
@@ -70,29 +73,18 @@ const std::string GetActorDescription(u16 id) {
return ActorDB::Instance->RetrieveEntry(id).entry.valid ? ActorDB::Instance->RetrieveEntry(id).entry.desc : "???";
}
-template void DrawGroupWithBorder(T&& drawFunc) {
+template void DrawGroupWithBorder(T&& drawFunc, std::string section) {
// First group encapsulates the inner portion and border
- ImGui::BeginGroup();
-
- ImVec2 padding = ImGui::GetStyle().FramePadding;
- ImVec2 p0 = ImGui::GetCursorScreenPos();
- ImGui::SetCursorScreenPos(ImVec2(p0.x + padding.x, p0.y + padding.y));
+ ImGui::BeginChild(std::string("##" + section).c_str(), ImVec2(0, 0),
+ ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY);
// Second group encapsulates just the inner portion
ImGui::BeginGroup();
-
+ ImGui::AlignTextToFramePadding();
drawFunc();
-
- ImGui::Dummy(padding);
ImGui::EndGroup();
- ImVec2 p1 = ImGui::GetItemRectMax();
- p1.x += padding.x;
- ImVec4 borderCol = ImGui::GetStyle().Colors[ImGuiCol_Border];
- ImGui::GetWindowDrawList()->AddRect(
- p0, p1, IM_COL32(borderCol.x * 255, borderCol.y * 255, borderCol.z * 255, borderCol.w * 255));
-
- ImGui::EndGroup();
+ ImGui::EndChild();
}
void PopulateActorDropdown(int i, std::vector& data) {
@@ -938,7 +930,7 @@ void ActorViewerWindow::DrawElement() {
static std::string filler = "Please select";
static std::vector list;
static u16 lastSceneId = 0;
- static char searchString[64] = "";
+ static std::string searchString = "";
static s16 currentSelectedInDropdown;
static std::vector actors;
@@ -951,13 +943,13 @@ void ActorViewerWindow::DrawElement() {
filler = "Please Select";
list.clear();
needs_reset = false;
- for (size_t i = 0; i < ARRAY_COUNT(searchString); i += 1) {
- searchString[i] = 0;
- }
+ searchString = "";
currentSelectedInDropdown = -1;
actors.clear();
}
lastSceneId = gPlayState->sceneNum;
+
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("Actor Type", acMapping[category])) {
for (int i = 0; i < acMapping.size(); i++) {
if (ImGui::Selectable(acMapping[i])) {
@@ -990,7 +982,9 @@ void ActorViewerWindow::DrawElement() {
}
ImGui::EndCombo();
}
+ PopStyleCombobox();
+ PushStyleHeader(THEME_COLOR);
if (ImGui::TreeNode("Selected Actor")) {
DrawGroupWithBorder([&]() {
ImGui::Text("Name: %s", ActorDB::Instance->RetrieveEntry(display->id).name.c_str());
@@ -998,46 +992,52 @@ void ActorViewerWindow::DrawElement() {
ImGui::Text("Category: %s", acMapping[display->category]);
ImGui::Text("ID: %d", display->id);
ImGui::Text("Parameters: %d", display->params);
- });
-
+ }, "Selected Actor");
+ ImGui::SameLine();
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
DrawGroupWithBorder([&]() {
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
+ PushStyleInput(THEME_COLOR);
ImGui::Text("Actor Position");
- ImGui::InputScalar("x pos", ImGuiDataType_Float, &display->world.pos.x);
- ImGui::SameLine();
- ImGui::InputScalar("y pos", ImGuiDataType_Float, &display->world.pos.y);
- ImGui::SameLine();
- ImGui::InputScalar("z pos", ImGuiDataType_Float, &display->world.pos.z);
- });
-
+ ImGui::InputScalar("X##CurPos", ImGuiDataType_Float, &display->world.pos.x);
+ ImGui::InputScalar("Y##CurPos", ImGuiDataType_Float, &display->world.pos.y);
+ ImGui::InputScalar("Z##CurPos", ImGuiDataType_Float, &display->world.pos.z);
+ ImGui::PopItemWidth();
+ PopStyleInput();
+ }, "Actor Position");
+ ImGui::SameLine();
DrawGroupWithBorder([&]() {
+ PushStyleInput(THEME_COLOR);
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
ImGui::Text("Actor Rotation");
- ImGui::InputScalar("x rot", ImGuiDataType_S16, &display->world.rot.x);
- ImGui::SameLine();
- ImGui::InputScalar("y rot", ImGuiDataType_S16, &display->world.rot.y);
- ImGui::SameLine();
- ImGui::InputScalar("z rot", ImGuiDataType_S16, &display->world.rot.z);
- });
+ ImGui::InputScalar("X##CurRot", ImGuiDataType_S16, &display->world.rot.x);
+ ImGui::InputScalar("Y##CurRot", ImGuiDataType_S16, &display->world.rot.y);
+ ImGui::InputScalar("Z##CurRot", ImGuiDataType_S16, &display->world.rot.z);
+ ImGui::PopItemWidth();
+ PopStyleInput();
+ }, "Actor Rotation");
if (display->category == ACTORCAT_BOSS || display->category == ACTORCAT_ENEMY) {
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Enemy Health", ImGuiDataType_U8, &display->colChkInfo.health);
+ PopStyleInput();
UIWidgets::InsertHelpHoverText("Some actors might not use this!");
}
DrawGroupWithBorder([&]() {
ImGui::Text("flags");
UIWidgets::DrawFlagArray32("flags", display->flags);
- });
+ }, "flags");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("bgCheckFlags");
UIWidgets::DrawFlagArray16("bgCheckFlags", display->bgCheckFlags);
- });
+ }, "bgCheckFlags");
- if (ImGui::Button("Refresh")) {
+ if (Button("Refresh", ButtonOptions().Color(THEME_COLOR))) {
PopulateActorDropdown(category, list);
switch (rm) {
case INTERACT:
@@ -1053,13 +1053,13 @@ void ActorViewerWindow::DrawElement() {
}
}
- if (ImGui::Button("Go to Actor")) {
+ if (Button("Go to Actor", ButtonOptions().Color(THEME_COLOR))) {
Player* player = GET_PLAYER(gPlayState);
Math_Vec3f_Copy(&player->actor.world.pos, &display->world.pos);
Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
}
- if (ImGui::Button("Fetch from Target")) {
+ if (Button("Fetch from Target", ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor with target arrow above it. You might need C-Up for enemies"))) {
Player* player = GET_PLAYER(gPlayState);
fetch = player->talkActor;
if (fetch != NULL) {
@@ -1069,8 +1069,7 @@ void ActorViewerWindow::DrawElement() {
rm = TARGET;
}
}
- UIWidgets::InsertHelpHoverText("Grabs actor with target arrow above it. You might need C-Up for enemies");
- if (ImGui::Button("Fetch from Held")) {
+ if (Button("Fetch from Held", ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor that Link is holding"))) {
Player* player = GET_PLAYER(gPlayState);
fetch = player->heldActor;
if (fetch != NULL) {
@@ -1080,8 +1079,7 @@ void ActorViewerWindow::DrawElement() {
rm = HELD;
}
}
- UIWidgets::InsertHelpHoverText("Grabs actor that Link is holding");
- if (ImGui::Button("Fetch from Interaction")) {
+ if (Button("Fetch from Interaction", ButtonOptions().Color(THEME_COLOR).Tooltip("Grabs actor from \"interaction range\""))) {
Player* player = GET_PLAYER(gPlayState);
fetch = player->interactRangeActor;
if (fetch != NULL) {
@@ -1091,21 +1089,21 @@ void ActorViewerWindow::DrawElement() {
rm = INTERACT;
}
}
- UIWidgets::InsertHelpHoverText("Grabs actor from \"interaction range\"");
ImGui::TreePop();
}
if (ImGui::TreeNode("New...")) {
- ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
+ //ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
- if (ImGui::InputText("Search Actor", searchString, ARRAY_COUNT(searchString))) {
- actors = GetActorsWithDescriptionContainingString(std::string(searchString));
+ if (InputString("Search Actor", &searchString, InputOptions().Color(THEME_COLOR))) {
+ actors = GetActorsWithDescriptionContainingString(searchString);
currentSelectedInDropdown = -1;
}
- if (searchString[0] != 0 && !actors.empty()) {
+ if (!SohUtils::IsStringEmpty(searchString) && !actors.empty()) {
std::string preview = currentSelectedInDropdown == -1 ? "Please Select" : ActorDB::Instance->RetrieveEntry(actors[currentSelectedInDropdown]).desc;
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("Results", preview.c_str())) {
for (u8 i = 0; i < actors.size(); i++) {
if (ImGui::Selectable(
@@ -1118,6 +1116,7 @@ void ActorViewerWindow::DrawElement() {
}
ImGui::EndCombo();
}
+ PopStyleCombobox();
}
ImGui::Text("%s", GetActorDescription(newActor.id).c_str());
@@ -1125,44 +1124,51 @@ void ActorViewerWindow::DrawElement() {
newActor.params = 0;
}
- UIWidgets::EnhancementCheckbox("Advanced mode", CVAR_DEVELOPER_TOOLS("ActorViewer.AdvancedParams"));
- UIWidgets::InsertHelpHoverText("Changes the actor specific param menus with a direct input");
+ CVarCheckbox("Advanced mode", CVAR_DEVELOPER_TOOLS("ActorViewer.AdvancedParams"), CheckboxOptions().Tooltip("Changes the actor specific param menus with a direct input"));
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ActorViewer.AdvancedParams"), 0)) {
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("params", ImGuiDataType_S16, &newActor.params, &one);
+ PopStyleInput();
} else if (std::find(noParamsActors.begin(), noParamsActors.end(), newActor.id) == noParamsActors.end()) {
CreateActorSpecificData();
if (actorSpecificData.find(newActor.id) == actorSpecificData.end()) {
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("params", ImGuiDataType_S16, &newActor.params, &one);
+ PopStyleInput();
} else {
DrawGroupWithBorder([&]() {
ImGui::Text("Actor Specific Data");
newActor.params = actorSpecificData[newActor.id](newActor.params);
- });
+ }, "Actor Specific Data");
}
}
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
DrawGroupWithBorder([&]() {
+ PushStyleInput(THEME_COLOR);
ImGui::Text("New Actor Position");
- ImGui::InputScalar("posX", ImGuiDataType_Float, &newActor.pos.x);
- ImGui::SameLine();
- ImGui::InputScalar("posY", ImGuiDataType_Float, &newActor.pos.y);
- ImGui::SameLine();
- ImGui::InputScalar("posZ", ImGuiDataType_Float, &newActor.pos.z);
- });
-
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
+ ImGui::InputScalar("X##NewPos", ImGuiDataType_Float, &newActor.pos.x);
+ ImGui::InputScalar("Y##NewPos", ImGuiDataType_Float, &newActor.pos.y);
+ ImGui::InputScalar("Z##NewPos", ImGuiDataType_Float, &newActor.pos.z);
+ ImGui::PopItemWidth();
+ PopStyleInput();
+ }, "New Actor Position");
+ ImGui::SameLine();
DrawGroupWithBorder([&]() {
+ PushStyleInput(THEME_COLOR);
ImGui::Text("New Actor Rotation");
- ImGui::InputScalar("rotX", ImGuiDataType_S16, &newActor.rot.x);
- ImGui::SameLine();
- ImGui::InputScalar("rotY", ImGuiDataType_S16, &newActor.rot.y);
- ImGui::SameLine();
- ImGui::InputScalar("rotZ", ImGuiDataType_S16, &newActor.rot.z);
- });
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
+ ImGui::InputScalar("X##NewRot", ImGuiDataType_S16, &newActor.rot.x);
+ ImGui::InputScalar("Y##NewRot", ImGuiDataType_S16, &newActor.rot.y);
+ ImGui::InputScalar("Z##NewRot", ImGuiDataType_S16, &newActor.rot.z);
+ ImGui::PopItemWidth();
+ PopStyleInput();
+ }, "New Actor Rotation");
- if (ImGui::Button("Fetch from Link")) {
+ if (Button("Fetch from Link", ButtonOptions().Color(THEME_COLOR))) {
Player* player = GET_PLAYER(gPlayState);
Vec3f newPos = player->actor.world.pos;
Vec3s newRot = player->actor.world.rot;
@@ -1170,7 +1176,7 @@ void ActorViewerWindow::DrawElement() {
newActor.rot = newRot;
}
- if (ImGui::Button("Spawn")) {
+ if (Button("Spawn", ButtonOptions().Color(THEME_COLOR))) {
if (ActorDB::Instance->RetrieveEntry(newActor.id).entry.valid) {
Actor_Spawn(&gPlayState->actorCtx, gPlayState, newActor.id, newActor.pos.x, newActor.pos.y,
newActor.pos.z, newActor.rot.x, newActor.rot.y, newActor.rot.z, newActor.params, 0);
@@ -1179,7 +1185,7 @@ void ActorViewerWindow::DrawElement() {
}
}
- if (ImGui::Button("Spawn as Child")) {
+ if (Button("Spawn as Child", ButtonOptions().Color(THEME_COLOR))) {
Actor* parent = display;
if (parent != NULL) {
if (newActor.id >= 0 && newActor.id < ACTOR_ID_MAX &&
@@ -1193,28 +1199,26 @@ void ActorViewerWindow::DrawElement() {
}
}
- if (ImGui::Button("Reset")) {
+ if (Button("Reset", ButtonOptions().Color(THEME_COLOR))) {
newActor = { 0, 0, { 0, 0, 0 }, { 0, 0, 0 } };
}
ImGui::TreePop();
}
+ PopStyleHeader();
- static const char* nameTagOptions[] = {
- "None",
- "Short Description",
- "Actor ID",
- "Both"
+ static std::unordered_map nameTagOptions = {
+ { 0, "None" },
+ { 1, "Short Description" },
+ { 2, "Actor ID" },
+ { 3, "Both" },
};
- UIWidgets::Spacer(0);
-
- ImGui::Text("Actor Name Tags");
- if (UIWidgets::EnhancementCombobox(CVAR_DEVELOPER_TOOLS("ActorViewer.NameTags"), nameTagOptions, ACTORVIEWER_NAMETAGS_NONE)) {
+ if (CVarCombobox("Actor Name Tags", CVAR_DEVELOPER_TOOLS("ActorViewer.NameTags"), nameTagOptions,
+ ComboboxOptions().Color(THEME_COLOR).Tooltip("Adds \"name tags\" above actors for identification"))) {
NameTag_RemoveAllByTag(DEBUG_ACTOR_NAMETAG_TAG);
ActorViewer_AddTagForAllActors();
}
- UIWidgets::Tooltip("Adds \"name tags\" above actors for identification");
} else {
ImGui::Text("Global Context needed for actor info!");
if (needs_reset) {
@@ -1223,9 +1227,7 @@ void ActorViewerWindow::DrawElement() {
filler = "Please Select";
list.clear();
needs_reset = false;
- for (size_t i = 0; i < ARRAY_COUNT(searchString); i += 1) {
- searchString[i] = 0;
- }
+ searchString = "";
currentSelectedInDropdown = -1;
actors.clear();
}
diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp
index 493ffdfdc..de2272598 100644
--- a/soh/soh/Enhancements/debugger/colViewer.cpp
+++ b/soh/soh/Enhancements/debugger/colViewer.cpp
@@ -1,6 +1,7 @@
#include "colViewer.h"
#include "../../frame_interpolation.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include
#include
@@ -19,12 +20,12 @@ extern "C" {
extern PlayState* gPlayState;
}
-enum class ColRenderSetting { Disabled, Solid, Transparent };
+typedef enum ColRenderSetting { ColRenderDisabled, ColRenderSolid, ColRenderTransparent } ColRenderSetting ;
-static const char* ColRenderSettingNames[] = {
- "Disabled",
- "Solid",
- "Transparent",
+static std::unordered_map ColRenderSettingNames = {
+ { ColRenderDisabled, "Disabled" },
+ { ColRenderSolid, "Solid" },
+ { ColRenderTransparent, "Transparent" },
};
ImVec4 scene_col;
@@ -53,45 +54,69 @@ static std::vector cylinderVtx;
static std::vector sphereGfx;
static std::vector sphereVtx;
+using namespace UIWidgets;
+
// Draws the ImGui window for the collision viewer
void ColViewerWindow::DrawElement() {
- UIWidgets::EnhancementCheckbox("Enabled", CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"));
+ CheckboxOptions checkOpt = CheckboxOptions().Color(THEME_COLOR);
+ ComboboxOptions comboOpt = ComboboxOptions().Color(THEME_COLOR);
+ CVarCheckbox("Enabled", CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), checkOpt);
- UIWidgets::LabeledRightAlignedEnhancementCombobox("Scene", CVAR_DEVELOPER_TOOLS("ColViewer.Scene"), ColRenderSettingNames, COLVIEW_DISABLED);
- UIWidgets::LabeledRightAlignedEnhancementCombobox("Bg Actors", CVAR_DEVELOPER_TOOLS("ColViewer.BGActors"), ColRenderSettingNames, COLVIEW_DISABLED);
- UIWidgets::LabeledRightAlignedEnhancementCombobox("Col Check", CVAR_DEVELOPER_TOOLS("ColViewer.ColCheck"), ColRenderSettingNames, COLVIEW_DISABLED);
- UIWidgets::LabeledRightAlignedEnhancementCombobox("Waterbox", CVAR_DEVELOPER_TOOLS("ColViewer.Waterbox"), ColRenderSettingNames, COLVIEW_DISABLED);
+ CVarCombobox("Scene", CVAR_DEVELOPER_TOOLS("ColViewer.Scene"), ColRenderSettingNames, comboOpt);
+ CVarCombobox("Bg Actors", CVAR_DEVELOPER_TOOLS("ColViewer.BGActors"), ColRenderSettingNames, comboOpt);
+ CVarCombobox("Col Check", CVAR_DEVELOPER_TOOLS("ColViewer.ColCheck"), ColRenderSettingNames, comboOpt);
+ CVarCombobox("Waterbox", CVAR_DEVELOPER_TOOLS("ColViewer.Waterbox"), ColRenderSettingNames, comboOpt);
- UIWidgets::EnhancementCheckbox("Apply as decal", CVAR_DEVELOPER_TOOLS("ColViewer.Decal"), false, "", UIWidgets::CheckboxGraphics::Cross, true);
- UIWidgets::InsertHelpHoverText("Applies the collision as a decal display. This can be useful if there is z-fighting occuring "
- "with the scene geometry, but can cause other artifacts.");
- UIWidgets::EnhancementCheckbox("Shaded", CVAR_DEVELOPER_TOOLS("ColViewer.Shaded"));
- UIWidgets::InsertHelpHoverText("Applies the scene's shading to the collision display.");
+ CVarCheckbox("Apply as decal", CVAR_DEVELOPER_TOOLS("ColViewer.Decal"),
+ checkOpt.DefaultValue(true).Tooltip("Applies the collision as a decal display. This can be useful if there is z-fighting occuring "
+ "with the scene geometry, but can cause other artifacts."));
+ CVarCheckbox("Shaded", CVAR_DEVELOPER_TOOLS("ColViewer.Shaded"), checkOpt.DefaultValue(false).Tooltip("Applies the scene's shading to the collision display."));
// This has to be duplicated in both code paths due to the nature of ImGui::IsItemHovered()
const std::string colorHelpText = "View and change the colors used for collision display.";
+ PushStyleHeader(THEME_COLOR);
if (ImGui::TreeNode("Colors")) {
- UIWidgets::InsertHelpHoverText(colorHelpText);
+ UIWidgets::Tooltip(colorHelpText.c_str());
- UIWidgets::EnhancementColor("Normal", CVAR_DEVELOPER_TOOLS("ColViewer.ColorNormal"), scene_col, ImVec4(255, 255, 255, 255), false);
- UIWidgets::EnhancementColor("Hookshot", CVAR_DEVELOPER_TOOLS("ColViewer.ColorHookshot"), hookshot_col, ImVec4(128, 128, 255, 255),
- false);
- UIWidgets::EnhancementColor("Entrance", CVAR_DEVELOPER_TOOLS("ColViewer.ColorEntrance"), entrance_col, ImVec4(0, 255, 0, 255), false);
- UIWidgets::EnhancementColor("Special Surface (Grass/Sand/Etc)", CVAR_DEVELOPER_TOOLS("ColViewer.ColorSpecialSurface"),
- specialSurface_col, ImVec4(192, 255, 192, 255), false);
- UIWidgets::EnhancementColor("Interactable (Vines/Crawlspace/Etc)", CVAR_DEVELOPER_TOOLS("ColViewer.ColorInteractable"),
- interactable_col, ImVec4(192, 0, 192, 255), false);
- UIWidgets::EnhancementColor("Slope", CVAR_DEVELOPER_TOOLS("ColViewer.ColorSlope"), slope_col, ImVec4(255, 255, 128, 255), false);
- UIWidgets::EnhancementColor("Void", CVAR_DEVELOPER_TOOLS("ColViewer.ColorVoid"), void_col, ImVec4(255, 0, 0, 255), false);
- UIWidgets::EnhancementColor("OC", CVAR_DEVELOPER_TOOLS("ColViewer.ColorOC"), oc_col, ImVec4(255, 255, 255, 255), false);
- UIWidgets::EnhancementColor("AC", CVAR_DEVELOPER_TOOLS("ColViewer.ColorAC"), ac_col, ImVec4(0, 0, 255, 255), false);
- UIWidgets::EnhancementColor("AT", CVAR_DEVELOPER_TOOLS("ColViewer.ColorAT"), at_col, ImVec4(255, 0, 0, 255), false);
- UIWidgets::EnhancementColor("Waterbox", CVAR_DEVELOPER_TOOLS("ColViewer.ColorWaterbox"), waterbox_col, ImVec4(0, 0, 255, 255), false);
+ if (CVarColorPicker("Normal", CVAR_DEVELOPER_TOOLS("ColViewer.ColorNormal"), { 255, 255, 255, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ scene_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorNormal"), { 255, 255, 255, 255 }));
+ }
+ if (CVarColorPicker("Hookshot", CVAR_DEVELOPER_TOOLS("ColViewer.ColorHookshot"), { 128, 128, 255, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ hookshot_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorHookshot"), { 128, 128, 255, 255 }));
+ }
+ if (CVarColorPicker("Entrance", CVAR_DEVELOPER_TOOLS("ColViewer.ColorEntrance"), { 0, 255, 0, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ entrance_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorEntrance"), { 0, 255, 0, 255 }));
+ }
+ if (CVarColorPicker("Special Surface (Grass/Sand/Etc)", CVAR_DEVELOPER_TOOLS("ColViewer.ColorSpecialSurface"), { 192, 255, 192, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ specialSurface_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSpecialSurface"), { 192, 255, 192, 255 }));
+ }
+ if (CVarColorPicker("Interactable (Vines/Crawlspace/Etc)", CVAR_DEVELOPER_TOOLS("ColViewer.ColorInteractable"), { 192, 0, 192, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ interactable_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorInteractable"), { 192, 0, 192, 255 }));
+ }
+ if (CVarColorPicker("Slope", CVAR_DEVELOPER_TOOLS("ColViewer.ColorSlope"), { 255, 255, 128, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ slope_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSlope"), { 255, 255, 128, 255 }));
+ }
+ if (CVarColorPicker("Void", CVAR_DEVELOPER_TOOLS("ColViewer.ColorVoid"), { 255, 0, 0, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ void_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorVoid"), { 255, 0, 0, 255 }));
+ }
+ if (CVarColorPicker("OC", CVAR_DEVELOPER_TOOLS("ColViewer.ColorOC"), { 255, 255, 255, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ oc_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorOC"), { 255, 255, 255, 255 }));
+ }
+ if (CVarColorPicker("AC", CVAR_DEVELOPER_TOOLS("ColViewer.ColorAC"), { 0, 0, 255, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ ac_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorAC"), { 0, 0, 255, 255 }));
+ }
+ if (CVarColorPicker("AT", CVAR_DEVELOPER_TOOLS("ColViewer.ColorAT"), { 255, 0, 0, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ at_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorAT"), { 255, 0, 0, 255 }));
+ }
+ if (CVarColorPicker("Waterbox", CVAR_DEVELOPER_TOOLS("ColViewer.ColorWaterbox"), { 0, 0, 255, 255 }, false, ColorPickerResetButton | ColorPickerRandomButton, THEME_COLOR)) {
+ waterbox_col = VecFromRGBA8(CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorWaterbox"), { 0, 0, 255, 255 }));
+ }
ImGui::TreePop();
} else {
- UIWidgets::InsertHelpHoverText(colorHelpText);
+ UIWidgets::Tooltip(colorHelpText.c_str());
}
+ PopStyleHeader();
}
// Calculates the normal for a triangle at the 3 specified points
@@ -287,7 +312,7 @@ void InitGfx(std::vector& gfx, ColRenderSetting setting) {
uint64_t cm;
uint32_t gm;
- if (setting == ColRenderSetting::Transparent) {
+ if (setting == ColRenderTransparent) {
rm = Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL;
blc1 = GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA);
blc2 = GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA);
@@ -301,7 +326,7 @@ void InitGfx(std::vector& gfx, ColRenderSetting setting) {
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Decal"), 1) != 0) {
rm |= ZMODE_DEC;
- } else if (setting == ColRenderSetting::Transparent) {
+ } else if (setting == ColRenderTransparent) {
rm |= ZMODE_XLU;
} else {
rm |= ZMODE_OPA;
@@ -340,21 +365,21 @@ void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) {
CollisionPoly* poly = &col->polyList[i];
if (SurfaceType_IsHookshotSurface(&gPlayState->colCtx, poly, bgId)) {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorHookshot"), { 128, 128, 255, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorHookshot.Value"), { 128, 128, 255, 255 });
} else if (func_80041D94(&gPlayState->colCtx, poly, bgId) > 0x01) {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorInteractable"), {192, 0, 192, 255});
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorInteractable.Value"), {192, 0, 192, 255});
} else if (func_80041E80(&gPlayState->colCtx, poly, bgId) == 0x0C) {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorVoid"), { 255, 0, 0, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorVoid.Value"), { 255, 0, 0, 255 });
} else if (SurfaceType_GetSceneExitIndex(&gPlayState->colCtx, poly, bgId) ||
func_80041E80(&gPlayState->colCtx, poly, bgId) == 0x05) {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorEntrance"), { 0, 255, 0, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorEntrance.Value"), { 0, 255, 0, 255 });
} else if (func_80041D4C(&gPlayState->colCtx, poly, bgId) != 0 ||
SurfaceType_IsWallDamage(&gPlayState->colCtx, poly, bgId)) {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSpecialSurface"), { 192, 255, 192, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSpecialSurface.Value"), { 192, 255, 192, 255 });
} else if (SurfaceType_GetSlope(&gPlayState->colCtx, poly, bgId) == 0x01) {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSlope"), { 255, 255, 128, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSlope.Value"), { 255, 255, 128, 255 });
} else {
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorNormal"), { 255, 255, 255, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorNormal.Value"), { 255, 255, 255, 255 });
}
if (color.r != lastColorR || color.g != lastColorG || color.b != lastColorB) {
@@ -404,11 +429,11 @@ void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) {
void DrawSceneCollision() {
ColRenderSetting showSceneColSetting = (ColRenderSetting)CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Scene"), COLVIEW_DISABLED);
- if (showSceneColSetting == ColRenderSetting::Disabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
+ if (showSceneColSetting == ColRenderDisabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
return;
}
- std::vector& dl = (showSceneColSetting == ColRenderSetting::Transparent) ? xluDl : opaDl;
+ std::vector& dl = (showSceneColSetting == ColRenderTransparent) ? xluDl : opaDl;
InitGfx(dl, showSceneColSetting);
dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH));
@@ -418,11 +443,11 @@ void DrawSceneCollision() {
// Draws all Bg Actors
void DrawBgActorCollision() {
ColRenderSetting showBgActorSetting = (ColRenderSetting)CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.BGActors"), COLVIEW_DISABLED);
- if (showBgActorSetting == ColRenderSetting::Disabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
+ if (showBgActorSetting == ColRenderDisabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
return;
}
- std::vector& dl = (showBgActorSetting == ColRenderSetting::Transparent) ? xluDl : opaDl;
+ std::vector& dl = (showBgActorSetting == ColRenderTransparent) ? xluDl : opaDl;
InitGfx(dl, showBgActorSetting);
dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH));
@@ -543,22 +568,22 @@ void DrawColCheckList(std::vector& dl, Collider** objects, int32_t count) {
// Draws all Col Check objects
void DrawColCheckCollision() {
ColRenderSetting showColCheckSetting = (ColRenderSetting)CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.ColCheck"), COLVIEW_DISABLED);
- if (showColCheckSetting == ColRenderSetting::Disabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
+ if (showColCheckSetting == ColRenderDisabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
return;
}
- std::vector& dl = (showColCheckSetting == ColRenderSetting::Transparent) ? xluDl : opaDl;
+ std::vector& dl = (showColCheckSetting == ColRenderTransparent) ? xluDl : opaDl;
InitGfx(dl, showColCheckSetting);
dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH));
CollisionCheckContext& col = gPlayState->colChkCtx;
- Color_RGBA8 color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorOC"), { 255, 255, 255, 255 });
+ Color_RGBA8 color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorOC.Value"), { 255, 255, 255, 255 });
dl.push_back(gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
DrawColCheckList(dl, col.colOC, col.colOCCount);
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorAC"), { 0, 0, 255, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorAC.Value"), { 0, 0, 255, 255 });
dl.push_back(gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
DrawColCheckList(dl, col.colAC, col.colACCount);
- color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorAT"), { 0, 0, 255, 255 });
+ color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorAT.Value"), { 0, 0, 255, 255 });
dl.push_back(gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
DrawColCheckList(dl, col.colAT, col.colATCount);
@@ -595,15 +620,15 @@ extern "C" f32 zdWaterBoxMinY;
// Draws all waterboxes
void DrawWaterboxList() {
ColRenderSetting showWaterboxSetting = (ColRenderSetting)CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Waterbox"), COLVIEW_DISABLED);
- if (showWaterboxSetting == ColRenderSetting::Disabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
+ if (showWaterboxSetting == ColRenderDisabled || !CVarGetInteger(CVAR_DEVELOPER_TOOLS("ColViewer.Enabled"), 0)) {
return;
}
- std::vector& dl = (showWaterboxSetting == ColRenderSetting::Transparent) ? xluDl : opaDl;
+ std::vector& dl = (showWaterboxSetting == ColRenderTransparent) ? xluDl : opaDl;
InitGfx(dl, showWaterboxSetting);
dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH));
- Color_RGBA8 color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorWaterbox"), { 0, 0, 255, 255 });
+ Color_RGBA8 color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorWaterbox.Value"), { 0, 0, 255, 255 });
dl.push_back(gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp
index b9858aff4..96163f656 100644
--- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp
+++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp
@@ -3,6 +3,7 @@
#include "soh/SohGui/ImGuiUtils.h"
#include "soh/OTRGlobals.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include
#include
@@ -27,7 +28,7 @@ extern PlayState* gPlayState;
}
// Maps entries in the GS flag array to the area name it represents
-std::vector gsMapping = {
+std::vector gsMapping = {
"Deku Tree",
"Dodongo's Cavern",
"Inside Jabu-Jabu's Belly",
@@ -56,6 +57,15 @@ extern "C" u8 gAreaGsFlags[];
extern "C" u8 gAmmoItems[];
+#define IMAGE_SIZE 48.0f
+
+using namespace UIWidgets;
+
+IntSliderOptions intSliderOptionsBase;
+ButtonOptions buttonOptionsBase;
+CheckboxOptions checkboxOptionsBase;
+ComboboxOptions comboboxOptionsBase;
+
// Modification of gAmmoItems that replaces ITEM_NONE with the item in inventory slot it represents
u8 gAllAmmoItems[] = {
ITEM_STICK, ITEM_NUT, ITEM_BOMB, ITEM_BOW, ITEM_ARROW_FIRE, ITEM_DINS_FIRE,
@@ -65,28 +75,17 @@ u8 gAllAmmoItems[] = {
// Encapsulates what is drawn by the passed-in function within a border
template
-void DrawGroupWithBorder(T&& drawFunc) {
+void DrawGroupWithBorder(T&& drawFunc, std::string section) {
// First group encapsulates the inner portion and border
+ ImGui::BeginChild(std::string("##" + section).c_str(), ImVec2(0, 0),
+ ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY);
+
ImGui::BeginGroup();
-
- ImVec2 padding = ImGui::GetStyle().FramePadding;
- ImVec2 p0 = ImGui::GetCursorScreenPos();
- ImGui::SetCursorScreenPos(ImVec2(p0.x + padding.x, p0.y + padding.y));
-
- // Second group encapsulates just the inner portion
- ImGui::BeginGroup();
-
+ ImGui::AlignTextToFramePadding();
drawFunc();
-
- ImGui::Dummy(padding);
ImGui::EndGroup();
- ImVec2 p1 = ImGui::GetItemRectMax();
- p1.x += padding.x;
- ImVec4 borderCol = ImGui::GetStyle().Colors[ImGuiCol_Border];
- ImGui::GetWindowDrawList()->AddRect(p0, p1, IM_COL32(borderCol.x * 255, borderCol.y * 255, borderCol.z * 255, borderCol.w * 255));
-
- ImGui::EndGroup();
+ ImGui::EndChild();
}
char z2ASCII(int code) {
@@ -108,6 +107,42 @@ char z2ASCII(int code) {
}
+typedef enum MagicLevel {
+ MAGIC_LEVEL_NONE,
+ MAGIC_LEVEL_SINGLE,
+ MAGIC_LEVEL_DOUBLE
+};
+
+std::unordered_map magicLevelMap = {
+ { MAGIC_LEVEL_NONE, "None" },
+ { MAGIC_LEVEL_SINGLE, "Single" },
+ { MAGIC_LEVEL_DOUBLE, "Double" },
+};
+
+typedef enum AudioOutput {
+ AUDIO_STEREO,
+ AUDIO_MONO,
+ AUDIO_HEADSET,
+ AUDIO_SURROUND,
+};
+
+std::unordered_map audioMap = {
+ { AUDIO_STEREO, "Stereo" },
+ { AUDIO_MONO, "Mono" },
+ { AUDIO_HEADSET, "Headset" },
+ { AUDIO_SURROUND, "Surround" },
+};
+
+typedef enum ZTarget {
+ Z_TARGET_SWITCH,
+ Z_TARGET_HOLD,
+};
+
+std::unordered_map zTargetMap = {
+ { Z_TARGET_SWITCH, "Switch" },
+ { Z_TARGET_HOLD, "Hold" },
+};
+
void DrawInfoTab() {
// TODO Needs a better method for name changing but for now this will work.
std::string name;
@@ -121,200 +156,147 @@ void DrawInfoTab() {
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
ImGui::Text("Name: %s", name.c_str());
- UIWidgets::InsertHelpHoverText("Player Name");
+ Tooltip("Player Name");
std::string nameID;
for (int i = 0; i < 8; i++) {
nameID = z2ASCII(i);
if (i % 4 != 0) {
ImGui::SameLine();
}
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar(nameID.c_str(), ImGuiDataType_U8, &gSaveContext.playerName[i], &one, NULL);
+ PopStyleInput();
}
// Use an intermediary to keep the health from updating (and potentially killing the player)
// until it is done being edited
int16_t healthIntermediary = gSaveContext.healthCapacity;
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Max Health", ImGuiDataType_S16, &healthIntermediary);
+ PopStyleInput();
if (ImGui::IsItemDeactivated()) {
gSaveContext.healthCapacity = healthIntermediary;
}
- UIWidgets::InsertHelpHoverText("Maximum health. 16 units per full heart");
+ Tooltip("Maximum health. 16 units per full heart");
if (gSaveContext.health > gSaveContext.healthCapacity) {
gSaveContext.health = gSaveContext.healthCapacity; // Clamp health to new max
}
-
- const uint16_t healthMin = 0;
- const uint16_t healthMax = gSaveContext.healthCapacity;
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
- ImGui::SliderScalar("Health", ImGuiDataType_S16, &gSaveContext.health, &healthMin, &healthMax);
- UIWidgets::InsertHelpHoverText("Current health. 16 units per full heart");
+ int32_t health = (int32_t)gSaveContext.health;
+ if (SliderInt("Health", &health, intSliderOptionsBase.Tooltip("Current health. 16 units per full heart")
+ .Min(0).Max(gSaveContext.healthCapacity))) {
+ gSaveContext.health = (int16_t)health;
+ }
bool isDoubleDefenseAcquired = gSaveContext.isDoubleDefenseAcquired != 0;
- if (ImGui::Checkbox("Double Defense", &isDoubleDefenseAcquired)) {
+ if (Checkbox("Double Defense", &isDoubleDefenseAcquired, checkboxOptionsBase.Tooltip("Is double defense unlocked?"))) {
gSaveContext.isDoubleDefenseAcquired = isDoubleDefenseAcquired;
gSaveContext.inventory.defenseHearts =
gSaveContext.isDoubleDefenseAcquired ? 20 : 0; // Set to get the border drawn in the UI
}
- UIWidgets::InsertHelpHoverText("Is double defense unlocked?");
-
- std::string magicName;
- if (gSaveContext.magicLevel == 2) {
- magicName = "Double";
- } else if (gSaveContext.magicLevel == 1) {
- magicName = "Single";
- } else {
- magicName = "None";
+ if (Combobox("Magic Level", &gSaveContext.magicLevel, magicLevelMap, comboboxOptionsBase.Tooltip("Current magic level"))) {
+ gSaveContext.isMagicAcquired = gSaveContext.magicLevel > 0;
+ gSaveContext.isDoubleMagicAcquired = gSaveContext.magicLevel == 2;
}
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 6);
- if (ImGui::BeginCombo("Magic Level", magicName.c_str())) {
- if (ImGui::Selectable("Double")) {
- gSaveContext.magicLevel = 2;
- gSaveContext.isMagicAcquired = true;
- gSaveContext.isDoubleMagicAcquired = true;
- }
- if (ImGui::Selectable("Single")) {
- gSaveContext.magicLevel = 1;
- gSaveContext.isMagicAcquired = true;
- gSaveContext.isDoubleMagicAcquired = false;
- }
- if (ImGui::Selectable("None")) {
- gSaveContext.magicLevel = 0;
- gSaveContext.isMagicAcquired = false;
- gSaveContext.isDoubleMagicAcquired = false;
- }
-
- ImGui::EndCombo();
- }
- UIWidgets::InsertHelpHoverText("Current magic level");
gSaveContext.magicCapacity = gSaveContext.magicLevel * 0x30; // Set to get the bar drawn in the UI
if (gSaveContext.magic > gSaveContext.magicCapacity) {
gSaveContext.magic = gSaveContext.magicCapacity; // Clamp magic to new max
}
- const uint8_t magicMin = 0;
- const uint8_t magicMax = gSaveContext.magicCapacity;
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
- ImGui::SliderScalar("Magic", ImGuiDataType_S8, &gSaveContext.magic, &magicMin, &magicMax);
- UIWidgets::InsertHelpHoverText("Current magic. 48 units per magic level");
+ int32_t magic = (int32_t)gSaveContext.magic;
+ if (SliderInt("Magic", &magic, intSliderOptionsBase.Min(0).Max(gSaveContext.magicCapacity).Tooltip("Current magic. 48 units per magic level"))) {
+ gSaveContext.magic = (int8_t)magic;
+ }
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Rupees", ImGuiDataType_S16, &gSaveContext.rupees);
- UIWidgets::InsertHelpHoverText("Current rupees");
+ Tooltip("Current rupees");
+ PopStyleInput();
- const uint16_t dayTimeMin = 0;
- const uint16_t dayTimeMax = 0xFFFF;
- ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
- ImGui::SliderScalar("Time", ImGuiDataType_U16, &gSaveContext.dayTime, &dayTimeMin, &dayTimeMax);
- UIWidgets::InsertHelpHoverText("Time of day");
- if (ImGui::Button("Dawn")) {
+ SliderInt("Time", (int32_t*) &gSaveContext.dayTime, intSliderOptionsBase.Min(0).Max(0xFFFF).Tooltip("Time of day"));
+ if (Button("Dawn", buttonOptionsBase)) {
gSaveContext.dayTime = 0x4000;
}
ImGui::SameLine();
- if (ImGui::Button("Noon")) {
+ if (Button("Noon", buttonOptionsBase)) {
gSaveContext.dayTime = 0x8000;
}
ImGui::SameLine();
- if (ImGui::Button("Sunset")) {
+ if (Button("Sunset", buttonOptionsBase)) {
gSaveContext.dayTime = 0xC001;
}
ImGui::SameLine();
- if (ImGui::Button("Midnight")) {
+ if (Button("Midnight", buttonOptionsBase)) {
gSaveContext.dayTime = 0;
}
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Total Days", ImGuiDataType_S32, &gSaveContext.totalDays);
- UIWidgets::InsertHelpHoverText("Total number of days elapsed since the start of the game");
+ Tooltip("Total number of days elapsed since the start of the game");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Deaths", ImGuiDataType_U16, &gSaveContext.deaths);
- UIWidgets::InsertHelpHoverText("Total number of deaths");
+ Tooltip("Total number of deaths");
+ PopStyleInput();
- bool bgsFlag = gSaveContext.bgsFlag != 0;
- if (ImGui::Checkbox("Has BGS", &bgsFlag)) {
- gSaveContext.bgsFlag = bgsFlag;
- }
- UIWidgets::InsertHelpHoverText("Is Biggoron sword unlocked? Replaces Giant's knife");
+ Checkbox("Has BGS", (bool*) &gSaveContext.bgsFlag, checkboxOptionsBase.Tooltip("Is Biggoron sword unlocked? Replaces Giant's knife"));
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Sword Health", ImGuiDataType_U16, &gSaveContext.swordHealth);
- UIWidgets::InsertHelpHoverText("Giant's knife health. Default is 8. Must be >0 for Biggoron sword to work");
+ Tooltip("Giant's knife health. Default is 8. Must be >0 for Biggoron sword to work");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Bgs Day Count", ImGuiDataType_S32, &gSaveContext.bgsDayCount);
- UIWidgets::InsertHelpHoverText("Total number of days elapsed since giving Biggoron the claim check");
+ Tooltip("Total number of days elapsed since giving Biggoron the claim check");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Entrance Index", ImGuiDataType_S32, &gSaveContext.entranceIndex);
- UIWidgets::InsertHelpHoverText("From which entrance did Link arrive?");
+ Tooltip("From which entrance did Link arrive?");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Cutscene Index", ImGuiDataType_S32, &gSaveContext.cutsceneIndex);
- UIWidgets::InsertHelpHoverText("Which cutscene is this?");
+ Tooltip("Which cutscene is this?");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Navi Timer", ImGuiDataType_U16, &gSaveContext.naviTimer);
- UIWidgets::InsertHelpHoverText("Navi wants to talk at 600 units, decides not to at 3000.");
+ Tooltip("Navi wants to talk at 600 units, decides not to at 3000.");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Timer 1 State", ImGuiDataType_S16, &gSaveContext.timer1State);
- UIWidgets::InsertHelpHoverText("Heat timer, race timer, etc. Has white font");
+ Tooltip("Heat timer, race timer, etc. Has white font");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Timer 1 Value", ImGuiDataType_S16, &gSaveContext.timer1Value, &one, NULL);
- UIWidgets::InsertHelpHoverText("Time, in seconds");
+ Tooltip("Time, in seconds");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Timer 2 State", ImGuiDataType_S16, &gSaveContext.timer2State);
- UIWidgets::InsertHelpHoverText("Trade timer, Ganon collapse timer, etc. Has yellow font");
+ Tooltip("Trade timer, Ganon collapse timer, etc. Has yellow font");
+ PopStyleInput();
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Timer 2 Value", ImGuiDataType_S16, &gSaveContext.timer2Value, &one, NULL);
- UIWidgets::InsertHelpHoverText("Time, in seconds");
-
- const char* audioName;
- switch (gSaveContext.audioSetting) {
- case 0:
- audioName = "Stereo";
- break;
- case 1:
- audioName = "Mono";
- break;
- case 2:
- audioName = "Headset";
- break;
- case 3:
- audioName = "Surround";
- break;
- default:
- audioName = "?";
- }
- if (ImGui::BeginCombo("Audio", audioName)) {
- if (ImGui::Selectable("Stereo")) {
- gSaveContext.audioSetting = 0;
- }
- if (ImGui::Selectable("Mono")) {
- gSaveContext.audioSetting = 1;
- }
- if (ImGui::Selectable("Headset")) {
- gSaveContext.audioSetting = 2;
- }
- if (ImGui::Selectable("Surround")) {
- gSaveContext.audioSetting = 3;
- }
+ Tooltip("Time, in seconds");
+ PopStyleInput();
- ImGui::EndCombo();
- }
- UIWidgets::InsertHelpHoverText("Sound setting");
+ Combobox("Audio", &gSaveContext.audioSetting, audioMap, comboboxOptionsBase.Tooltip("Sound setting"));
- bool n64DDFlag = gSaveContext.n64ddFlag != 0;
- if (ImGui::Checkbox("64 DD file?", &n64DDFlag)) {
- gSaveContext.n64ddFlag = n64DDFlag;
- }
- UIWidgets::InsertHelpHoverText("WARNING! If you save, your file may be locked! Use caution!");
+ Checkbox("64 DD file?", (bool*) &gSaveContext.n64ddFlag, checkboxOptionsBase.Tooltip("WARNING! If you save, your file may be locked! Use caution!"));
- if (ImGui::BeginCombo("Z Target Mode", gSaveContext.zTargetSetting ? "Hold" : "Switch")) {
- if (ImGui::Selectable("Switch")) {
- gSaveContext.zTargetSetting = 0;
- }
- if (ImGui::Selectable("Hold")) {
- gSaveContext.zTargetSetting = 1;
- }
- ImGui::EndCombo();
- }
- UIWidgets::InsertHelpHoverText("Z-Targeting behavior");
+ Combobox("Z Target Mode", &gSaveContext.zTargetSetting, zTargetMap, comboboxOptionsBase.Tooltip("Z-Targeting behavior"));
if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT)) {
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("Triforce Pieces", ImGuiDataType_U8, &gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected);
- UIWidgets::InsertHelpHoverText("Currently obtained Triforce Pieces. For Triforce Hunt.");
+ Tooltip("Currently obtained Triforce Pieces. For Triforce Hunt.");
+ PopStyleInput();
}
ImGui::PushItemWidth(ImGui::GetFontSize() * 10);
@@ -330,78 +312,79 @@ void DrawInfoTab() {
for (int i = 0; i < 7; i++) {
if(i == 2 && ImGui::TreeNode("Fishing") ){ //fishing has a few more flags to it
u8 fishSize = gSaveContext.highScores[i] & 0x7F;
+ PushStyleInput(THEME_COLOR);
if(ImGui::InputScalar("Child Size Record",ImGuiDataType_U8,&fishSize)){
gSaveContext.highScores[i]&=~0x7F;
gSaveContext.highScores[i]|=fishSize & 0x7F;
}
char fishMsg[64];
std::sprintf(fishMsg,"Weight: %2.0f lbs",((SQ(fishSize)*.0036)+.5));
- UIWidgets::InsertHelpHoverText(fishMsg);
+ Tooltip(fishMsg);
+ PopStyleInput();
bool FishBool = gSaveContext.highScores[i]&0x80;
- if (ImGui::Checkbox("Cheated as Child", &FishBool)) {
+ if (Checkbox("Cheated as Child", &FishBool, checkboxOptionsBase.Tooltip("Used the Sinking lure to catch it."))) {
gSaveContext.highScores[i] &= ~0x80;
gSaveContext.highScores[i] |= (0x80 * FishBool);
}
- UIWidgets::InsertHelpHoverText("Used the Sinking lure to catch it.");
fishSize=(gSaveContext.highScores[i] & 0x7F000000)>>0x18;
+ PushStyleInput(THEME_COLOR);
if(ImGui::InputScalar("Adult Size Record",ImGuiDataType_U8,&fishSize)){
gSaveContext.highScores[i]&=~0x7F000000;
gSaveContext.highScores[i]|=(fishSize & 0x7F) << 0x18;
}
std::sprintf(fishMsg,"Weight: %2.0f lbs",((SQ(fishSize)*.0036)+.5));
- UIWidgets::InsertHelpHoverText(fishMsg);
+ Tooltip(fishMsg);
+ PopStyleInput();
FishBool = gSaveContext.highScores[i] & 0x80000000;
- if (ImGui::Checkbox("Cheated as Adult", &FishBool)) {
+ if (Checkbox("Cheated as Adult", &FishBool, checkboxOptionsBase.Tooltip("Used the Sinking lure to catch it."))) {
gSaveContext.highScores[i] &= ~0x80000000;
gSaveContext.highScores[i] |= (0x80000000 * FishBool);
}
- UIWidgets::InsertHelpHoverText("Used the Sinking lure to catch it.");
FishBool = gSaveContext.highScores[i]&0x100;
- if (ImGui::Checkbox("Played as Child", &FishBool)) {
+ if (Checkbox("Played as Child", &FishBool, checkboxOptionsBase.Tooltip("Played at least one game as a child"))) {
gSaveContext.highScores[i] &= ~0x100;
gSaveContext.highScores[i] |= (0x100 * FishBool);
}
- UIWidgets::InsertHelpHoverText("Played at least one game as a child");
FishBool = gSaveContext.highScores[i]&0x200;
- if (ImGui::Checkbox("Played as Adult", &FishBool)) {
+ if (Checkbox("Played as Adult", &FishBool, checkboxOptionsBase.Tooltip("Played at least one game as an adult"))) {
gSaveContext.highScores[i] &= ~0x200;
gSaveContext.highScores[i] |= (0x200 * FishBool);
}
- UIWidgets::InsertHelpHoverText("Played at least one game as an adult");
FishBool = gSaveContext.highScores[i]&0x400;
- if (ImGui::Checkbox("Got Prize as Child", &FishBool)) {
+ if (Checkbox("Got Prize as Child", &FishBool, checkboxOptionsBase.Tooltip("Got the prize item (Heart Piece, unless rando.)\nunlocks Sinking Lure for Child Link."))) {
gSaveContext.highScores[i] &= ~0x400;
gSaveContext.highScores[i] |= (0x400 * FishBool);
}
- UIWidgets::InsertHelpHoverText("Got the prize item (Heart Piece, unless rando.)\nunlocks Sinking Lure for Child Link.");
FishBool = gSaveContext.highScores[i]&0x800;
- if (ImGui::Checkbox("Got Prize as Adult", &FishBool)) {
+ if (Checkbox("Got Prize as Adult", &FishBool, checkboxOptionsBase.Tooltip("Got the prize item (Golden Scale, unless rando.)\nUnlocks Sinking Lure for Adult Link."))) {
gSaveContext.highScores[i] &= ~0x800;
gSaveContext.highScores[i] |= (0x800 * FishBool);
}
- UIWidgets::InsertHelpHoverText("Got the prize item (Golden Scale, unless rando.)\nUnlocks Sinking Lure for Adult Link.");
FishBool = gSaveContext.highScores[i] & 0x1000;
- if (ImGui::Checkbox("Stole Owner's Hat", &FishBool)) {
+ if (Checkbox("Stole Owner's Hat", &FishBool, checkboxOptionsBase.Tooltip("The owner's now visibly bald when Adult Link."))) {
gSaveContext.highScores[i] &= ~0x1000;
gSaveContext.highScores[i] |= (0x1000 * FishBool);
}
- UIWidgets::InsertHelpHoverText("The owner's now visibly bald when Adult Link.");
fishSize=(gSaveContext.highScores[i] & 0xFF0000)>>16;
+ PushStyleInput(THEME_COLOR);
if(ImGui::InputScalar("Times Played",ImGuiDataType_U8,&fishSize)){
gSaveContext.highScores[i]&=~0xFF0000;
gSaveContext.highScores[i]|=(fishSize) << 16;
}
- UIWidgets::InsertHelpHoverText("Determines weather and school size during dawn/dusk.");
+ Tooltip("Determines weather and school size during dawn/dusk.");
+ PopStyleInput();
ImGui::TreePop();
continue;
}
- if (i == 5) { //HS_UNK_05 is unused
+ if (i == 5 || i == 2) { //HS_UNK_05 is unused
continue;
}
std::string minigameLbl = minigameHS[i];
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar(minigameLbl.c_str(), ImGuiDataType_S32, &gSaveContext.highScores[i], &one, NULL);
+ PopStyleInput();
}
ImGui::TreePop();
@@ -412,14 +395,14 @@ void DrawInfoTab() {
void DrawBGSItemFlag(uint8_t itemID) {
const ItemMapEntry& slotEntry = itemMapping[itemID];
- ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
+ ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
+ ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
}
void DrawInventoryTab() {
static bool restrictToValid = true;
- ImGui::Checkbox("Restrict to valid items", &restrictToValid);
- UIWidgets::InsertHelpHoverText("Restricts items and ammo to only what is possible to legally acquire in-game");
+ Checkbox("Restrict to valid items", &restrictToValid, checkboxOptionsBase.Tooltip("Restricts items and ammo to only what is possible to legally acquire in-game"));
for (int32_t y = 0; y < 4; y++) {
for (int32_t x = 0; x < 6; x++) {
@@ -433,35 +416,33 @@ void DrawInventoryTab() {
ImGui::SameLine();
}
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0));
- ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
uint8_t item = gSaveContext.inventory.items[index];
+ PushStyleButton(Colors::DarkGray);
if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping.find(item)->second;
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
auto ret = ImGui::ImageButton(slotEntry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(48.0f, 48.0f), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
selectedIndex = index;
ImGui::OpenPopup(itemPopupPicker);
}
} else {
- if (ImGui::Button("##itemNone", ImVec2(32.0f, 32.0f))) {
+ if (ImGui::Button("##itemNone", ImVec2(IMAGE_SIZE, IMAGE_SIZE) + ImGui::GetStyle().FramePadding * 2)) {
selectedIndex = index;
ImGui::OpenPopup(itemPopupPicker);
}
}
- ImGui::PopStyleVar();
- ImGui::PopStyleColor();
+ PopStyleButton();
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
if (ImGui::BeginPopup(itemPopupPicker)) {
- if (ImGui::Button("##itemNonePicker", ImVec2(32.0f, 32.0f))) {
+ PushStyleButton(Colors::DarkGray);
+ if (ImGui::Button("##itemNonePicker", ImVec2(IMAGE_SIZE, IMAGE_SIZE) + ImGui::GetStyle().FramePadding * 2)) {
gSaveContext.inventory.items[selectedIndex] = ITEM_NONE;
ImGui::CloseCurrentPopup();
}
- UIWidgets::SetLastItemHoverText("None");
+ PopStyleButton();
+ UIWidgets::Tooltip("None");
std::vector possibleItems;
if (restrictToValid) {
@@ -486,15 +467,15 @@ void DrawInventoryTab() {
ImGui::SameLine();
}
const ItemMapEntry& slotEntry = possibleItems[pickerIndex];
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(slotEntry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
+ PopStyleButton();
if (ret) {
gSaveContext.inventory.items[selectedIndex] = slotEntry.id;
ImGui::CloseCurrentPopup();
}
- UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(slotEntry.id));
+ UIWidgets::Tooltip(SohUtils::GetItemName(slotEntry.id).c_str());
}
ImGui::EndPopup();
@@ -517,11 +498,13 @@ void DrawInventoryTab() {
drawnAmmoItems++;
ImGui::PushID(ammoIndex);
- ImGui::PushItemWidth(32.0f);
+ ImGui::PushItemWidth(IMAGE_SIZE);
ImGui::BeginGroup();
- ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f));
+ ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[item].name), ImVec2(IMAGE_SIZE, IMAGE_SIZE));
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item));
+ PopStyleInput();
ImGui::EndGroup();
ImGui::PopItemWidth();
@@ -548,7 +531,10 @@ void DrawFlagTableArray16(const FlagTable& flagTable, uint16_t row, uint16_t& fl
ImGui::PushID(flagIndex);
bool hasDescription = !!flagTable.flagDescriptions.contains(row * 16 + flagIndex);
uint32_t bitMask = 1 << flagIndex;
- ImGui::PushStyleColor(ImGuiCol_FrameBg, hasDescription ? ImVec4(0.16f, 0.29f, 0.48f, 0.54f) : ImVec4(0.16f, 0.29f, 0.48f, 0.24f));
+ ImVec4 themeColor = ColorValues.at(THEME_COLOR);
+ ImVec4 colorDark = { themeColor.x * 0.4f, themeColor.y * 0.4f, themeColor.z * 0.4f , themeColor.z };
+ PushStyleCheckbox(hasDescription ? themeColor : colorDark);
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 3.0f));
bool flag = (flags & bitMask) != 0;
if (ImGui::Checkbox("##check", &flag)) {
if (flag) {
@@ -557,7 +543,8 @@ void DrawFlagTableArray16(const FlagTable& flagTable, uint16_t row, uint16_t& fl
flags &= ~bitMask;
}
}
- ImGui::PopStyleColor();
+ ImGui::PopStyleVar();
+ PopStyleCheckbox();
if (ImGui::IsItemHovered() && hasDescription) {
ImGui::BeginTooltip();
ImGui::Text("%s", UIWidgets::WrappedText(flagTable.flagDescriptions.at(row * 16 + flagIndex), 60).c_str());
@@ -575,165 +562,154 @@ void DrawFlagsTab() {
DrawGroupWithBorder([&]() {
ImGui::Text("stateFlags1");
- UIWidgets::DrawFlagArray32("stateFlags1", player->stateFlags1);
- });
+ DrawFlagArray32("stateFlags1", player->stateFlags1, THEME_COLOR);
+ }, "stateFlags1");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("stateFlags2");
- UIWidgets::DrawFlagArray32("stateFlags2", player->stateFlags2);
- });
+ DrawFlagArray32("stateFlags2", player->stateFlags2, THEME_COLOR);
+ }, "stateFlags2");
DrawGroupWithBorder([&]() {
ImGui::Text("stateFlags3");
- UIWidgets::DrawFlagArray8("stateFlags3", player->stateFlags3);
- });
+ DrawFlagArray8("stateFlags3", player->stateFlags3, THEME_COLOR);
+ }, "stateFlags3");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("unk_6AE_rotFlags");
- UIWidgets::DrawFlagArray16("unk_6AE_rotFlags", player->unk_6AE_rotFlags);
- });
+ DrawFlagArray16("unk_6AE_rotFlags", player->unk_6AE_rotFlags, THEME_COLOR);
+ }, "unk_6AE_rotFlags");
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Current Scene")) {
if (gPlayState != nullptr) {
ActorContext* act = &gPlayState->actorCtx;
-
DrawGroupWithBorder([&]() {
ImGui::Text("Switch");
- UIWidgets::InsertHelpHoverText("Permanently-saved switch flags");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Switch")) {
+ InsertHelpHoverText("Permanently-saved switch flags");
+ if (Button("Set All##Switch", buttonOptionsBase.Tooltip(""))) {
act->flags.swch = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Switch")) {
+ if (Button("Clear All##Switch", buttonOptionsBase.Tooltip(""))) {
act->flags.swch = 0;
}
- UIWidgets::DrawFlagArray32("Switch", act->flags.swch);
- });
+ DrawFlagArray32("Switch", act->flags.swch, THEME_COLOR);
+ }, "Switch");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Temp Switch");
- UIWidgets::InsertHelpHoverText("Temporary switch flags. Unset on scene transitions");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Temp Switch")) {
+ InsertHelpHoverText("Temporary switch flags. Unset on scene transitions");
+ if (Button("Set All##Temp Switch", buttonOptionsBase.Tooltip(""))) {
act->flags.tempSwch = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Temp Switch")) {
+ if (Button("Clear All##Temp Switch", buttonOptionsBase.Tooltip(""))) {
act->flags.tempSwch = 0;
}
- UIWidgets::DrawFlagArray32("Temp Switch", act->flags.tempSwch);
- });
+ DrawFlagArray32("Temp Switch", act->flags.tempSwch, THEME_COLOR);
+ }, "Temp Switch");
DrawGroupWithBorder([&]() {
ImGui::Text("Clear");
- UIWidgets::InsertHelpHoverText("Permanently-saved room-clear flags");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Clear")) {
+ InsertHelpHoverText("Permanently-saved room-clear flags");
+ if (Button("Set All##Clear", buttonOptionsBase.Tooltip(""))) {
act->flags.clear = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Clear")) {
+ if (Button("Clear All##Clear", buttonOptionsBase.Tooltip(""))) {
act->flags.clear = 0;
}
- UIWidgets::DrawFlagArray32("Clear", act->flags.clear);
- });
+ DrawFlagArray32("Clear", act->flags.clear, THEME_COLOR);
+ }, "Clear");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Temp Clear");
- UIWidgets::InsertHelpHoverText("Temporary room-clear flags. Unset on scene transitions");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Temp Clear")) {
+ InsertHelpHoverText("Temporary room-clear flags. Unset on scene transitions");
+ if (Button("Set All##Temp Clear", buttonOptionsBase.Tooltip(""))) {
act->flags.tempClear = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Temp Clear")) {
+ if (Button("Clear All##Temp Clear", buttonOptionsBase.Tooltip(""))) {
act->flags.tempClear = 0;
}
- UIWidgets::DrawFlagArray32("Temp Clear", act->flags.tempClear);
- });
+ DrawFlagArray32("Temp Clear", act->flags.tempClear, THEME_COLOR);
+ }, "Temp Clear");
DrawGroupWithBorder([&]() {
ImGui::Text("Collect");
- UIWidgets::InsertHelpHoverText("Permanently-saved collect flags");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Collect")) {
+ InsertHelpHoverText("Permanently-saved collect flags");
+ if (Button("Set All##Collect", buttonOptionsBase.Tooltip(""))) {
act->flags.collect = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Collect")) {
+ if (Button("Clear All##Collect", buttonOptionsBase.Tooltip(""))) {
act->flags.collect = 0;
}
- UIWidgets::DrawFlagArray32("Collect", act->flags.collect);
- });
+ DrawFlagArray32("Collect", act->flags.collect, THEME_COLOR);
+ }, "Collect");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Temp Collect");
- UIWidgets::InsertHelpHoverText("Temporary collect flags. Unset on scene transitions");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Temp Collect")) {
+ InsertHelpHoverText("Temporary collect flags. Unset on scene transitions");
+ if (Button("Set All##Temp Collect", buttonOptionsBase.Tooltip(""))) {
act->flags.tempCollect = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Temp Collect")) {
+ if (Button("Clear All##Temp Collect", buttonOptionsBase.Tooltip(""))) {
act->flags.tempCollect = 0;
}
- UIWidgets::DrawFlagArray32("Temp Collect", act->flags.tempCollect);
- });
+ DrawFlagArray32("Temp Collect", act->flags.tempCollect, THEME_COLOR);
+ }, "Temp Collect");
DrawGroupWithBorder([&]() {
ImGui::Text("Chest");
- UIWidgets::InsertHelpHoverText("Permanently-saved chest flags");
- ImGui::SameLine();
- if (ImGui::Button("Set All##Chest")) {
+ InsertHelpHoverText("Permanently-saved chest flags");
+ if (Button("Set All##Chest", buttonOptionsBase.Tooltip(""))) {
act->flags.chest = UINT32_MAX;
}
ImGui::SameLine();
- if (ImGui::Button("Clear All##Chest")) {
+ if (Button("Clear All##Chest", buttonOptionsBase.Tooltip(""))) {
act->flags.chest = 0;
}
- UIWidgets::DrawFlagArray32("Chest", act->flags.chest);
- });
+ DrawFlagArray32("Chest", act->flags.chest, THEME_COLOR);
+ }, "Chest");
ImGui::SameLine();
ImGui::BeginGroup();
- if (ImGui::Button("Reload Flags")) {
+ if (Button("Reload Flags", buttonOptionsBase.Tooltip("Load flags from saved scene flags. Normally happens on scene load"))) {
act->flags.swch = gSaveContext.sceneFlags[gPlayState->sceneNum].swch;
act->flags.clear = gSaveContext.sceneFlags[gPlayState->sceneNum].clear;
act->flags.collect = gSaveContext.sceneFlags[gPlayState->sceneNum].collect;
act->flags.chest = gSaveContext.sceneFlags[gPlayState->sceneNum].chest;
}
- UIWidgets::SetLastItemHoverText("Load flags from saved scene flags. Normally happens on scene load");
- if (ImGui::Button("Save Flags")) {
+ if (Button("Save Flags", buttonOptionsBase.Tooltip("Save current scene flags. Normally happens on scene exit"))) {
gSaveContext.sceneFlags[gPlayState->sceneNum].swch = act->flags.swch;
gSaveContext.sceneFlags[gPlayState->sceneNum].clear = act->flags.clear;
gSaveContext.sceneFlags[gPlayState->sceneNum].collect = act->flags.collect;
gSaveContext.sceneFlags[gPlayState->sceneNum].chest = act->flags.chest;
}
- UIWidgets::SetLastItemHoverText("Save current scene flags. Normally happens on scene exit");
- if (ImGui::Button("Clear Flags")) {
+ if (Button("Clear Flags", buttonOptionsBase.Tooltip("Clear current scene flags. Reload scene to see changes"))) {
act->flags.swch = 0;
act->flags.clear = 0;
act->flags.collect = 0;
act->flags.chest = 0;
}
- UIWidgets::SetLastItemHoverText("Clear current scene flags. Reload scene to see changes");
ImGui::EndGroup();
@@ -746,8 +722,10 @@ void DrawFlagsTab() {
if (ImGui::TreeNode("Saved Scene Flags")) {
static uint32_t selectedSceneFlagMap = 0;
+ ImGui::AlignTextToFramePadding();
ImGui::Text("Map");
ImGui::SameLine();
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("##Map", SohUtils::GetSceneName(selectedSceneFlagMap).c_str())) {
for (int32_t sceneIndex = 0; sceneIndex < SCENE_ID_MAX; sceneIndex++) {
if (ImGui::Selectable(SohUtils::GetSceneName(sceneIndex).c_str())) {
@@ -757,77 +735,68 @@ void DrawFlagsTab() {
ImGui::EndCombo();
}
+ PopStyleCombobox();
// Don't show current scene button if there is no current scene
if (gPlayState != nullptr) {
ImGui::SameLine();
- if (ImGui::Button("Current")) {
+ if (Button("Current", buttonOptionsBase.Tooltip("Open flags for current scene"))) {
selectedSceneFlagMap = gPlayState->sceneNum;
}
- UIWidgets::SetLastItemHoverText("Open flags for current scene");
}
DrawGroupWithBorder([&]() {
ImGui::Text("Switch");
- UIWidgets::InsertHelpHoverText("Switch flags");
- UIWidgets::DrawFlagArray32("Switch", gSaveContext.sceneFlags[selectedSceneFlagMap].swch);
- });
+ InsertHelpHoverText("Switch flags");
+ DrawFlagArray32("Switch", gSaveContext.sceneFlags[selectedSceneFlagMap].swch, THEME_COLOR);
+ }, "Saved Switch");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Clear");
- UIWidgets::InsertHelpHoverText("Room-clear flags");
- UIWidgets::DrawFlagArray32("Clear", gSaveContext.sceneFlags[selectedSceneFlagMap].clear);
- });
+ InsertHelpHoverText("Room-clear flags");
+ DrawFlagArray32("Clear", gSaveContext.sceneFlags[selectedSceneFlagMap].clear, THEME_COLOR);
+ }, "Saved Clear");
DrawGroupWithBorder([&]() {
ImGui::Text("Collect");
- UIWidgets::InsertHelpHoverText("Collect flags");
- UIWidgets::DrawFlagArray32("Collect", gSaveContext.sceneFlags[selectedSceneFlagMap].collect);
- });
+ InsertHelpHoverText("Collect flags");
+ DrawFlagArray32("Collect", gSaveContext.sceneFlags[selectedSceneFlagMap].collect, THEME_COLOR);
+ }, "Saved Collect");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Chest");
- UIWidgets::InsertHelpHoverText("Chest flags");
- UIWidgets::DrawFlagArray32("Chest", gSaveContext.sceneFlags[selectedSceneFlagMap].chest);
- });
+ InsertHelpHoverText("Chest flags");
+ DrawFlagArray32("Chest", gSaveContext.sceneFlags[selectedSceneFlagMap].chest, THEME_COLOR);
+ }, "Saved Chest");
DrawGroupWithBorder([&]() {
ImGui::Text("Rooms");
- UIWidgets::InsertHelpHoverText("Flags for visted rooms");
- UIWidgets::DrawFlagArray32("Rooms", gSaveContext.sceneFlags[selectedSceneFlagMap].rooms);
- });
+ InsertHelpHoverText("Flags for visted rooms");
+ DrawFlagArray32("Rooms", gSaveContext.sceneFlags[selectedSceneFlagMap].rooms, THEME_COLOR);
+ }, "Saved Rooms");
ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Floors");
- UIWidgets::InsertHelpHoverText("Flags for visted floors");
- UIWidgets::DrawFlagArray32("Floors", gSaveContext.sceneFlags[selectedSceneFlagMap].floors);
- });
+ InsertHelpHoverText("Flags for visted floors");
+ DrawFlagArray32("Floors", gSaveContext.sceneFlags[selectedSceneFlagMap].floors, THEME_COLOR);
+ }, "Saved Floors");
ImGui::TreePop();
}
DrawGroupWithBorder([&]() {
- static uint32_t selectedGsMap = 0;
+ size_t selectedGsMap = 0;
ImGui::Text("Gold Skulltulas");
- ImGui::Text("Map");
- ImGui::SameLine();
- if (ImGui::BeginCombo("##Gold Skulltula Map", gsMapping[selectedGsMap].c_str())) {
- for (int32_t gsIndex = 0; gsIndex < gsMapping.size(); gsIndex++) {
- if (ImGui::Selectable(gsMapping[gsIndex].c_str())) {
- selectedGsMap = gsIndex;
- }
- }
-
- ImGui::EndCombo();
- }
+ Combobox("Map##Gold Skulltulas", &selectedGsMap, gsMapping, comboboxOptionsBase.Tooltip(""));
// TODO We should write out descriptions for each one... ugh
+ ImGui::AlignTextToFramePadding();
ImGui::Text("Flags");
uint32_t currentFlags = GET_GS_FLAGS(selectedGsMap);
uint32_t allFlags = gAreaGsFlags[selectedGsMap];
@@ -838,6 +807,8 @@ void DrawFlagsTab() {
ImGui::SameLine();
ImGui::PushID(allFlags);
+ PushStyleCheckbox(THEME_COLOR);
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 3.0f));
if (ImGui::Checkbox("##gs", &isThisSet)) {
if (isThisSet) {
SET_GS_FLAGS(selectedGsMap, setMask);
@@ -848,6 +819,8 @@ void DrawFlagsTab() {
SET_GS_FLAGS(selectedGsMap, currentFlagsBase & ~setMask);
}
}
+ ImGui::PopStyleVar();
+ PopStyleCheckbox();
ImGui::PopID();
@@ -860,8 +833,8 @@ void DrawFlagsTab() {
// GS Token Count updated, since Gold Skulltulas killed will not correlate to GS Tokens Collected.
if (!(IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) {
static bool keepGsCountUpdated = true;
- ImGui::Checkbox("Keep GS Count Updated", &keepGsCountUpdated);
- UIWidgets::InsertHelpHoverText("Automatically adjust the number of gold skulltula tokens acquired based on set flags.");
+ Checkbox("Keep GS Count Updated", &keepGsCountUpdated,
+ checkboxOptionsBase.Tooltip("Automatically adjust the number of gold skulltula tokens acquired based on set flags."));
int32_t gsCount = 0;
if (keepGsCountUpdated) {
for (int32_t gsFlagIndex = 0; gsFlagIndex < 6; gsFlagIndex++) {
@@ -870,7 +843,7 @@ void DrawFlagsTab() {
gSaveContext.inventory.gsTokens = gsCount;
}
}
- });
+ }, "Gold Skulltulas");
for (int i = 0; i < flagTables.size(); i++) {
const FlagTable& flagTable = flagTables[i];
@@ -899,7 +872,7 @@ void DrawFlagsTab() {
DrawFlagTableArray16(flagTable, j, gSaveContext.ship.randomizerInf[j]);
break;
}
- });
+ }, flagTable.name);
}
// make some buttons to help with fishsanity debugging
@@ -941,6 +914,8 @@ void DrawUpgrade(const std::string& categoryName, int32_t categoryId, const std:
ImGui::Text("%s", categoryName.c_str());
ImGui::SameLine();
ImGui::PushID(categoryName.c_str());
+ PushStyleCombobox(THEME_COLOR);
+ ImGui::AlignTextToFramePadding();
if (ImGui::BeginCombo("##upgrade", names[CUR_UPG_VALUE(categoryId)].c_str())) {
for (int32_t i = 0; i < names.size(); i++) {
if (ImGui::Selectable(names[i].c_str())) {
@@ -950,8 +925,9 @@ void DrawUpgrade(const std::string& categoryName, int32_t categoryId, const std:
ImGui::EndCombo();
}
+ PopStyleCombobox();
ImGui::PopID();
- UIWidgets::SetLastItemHoverText(categoryName.c_str());
+ UIWidgets::Tooltip(categoryName.c_str());
}
// Draws a combo that lets you choose and upgrade value from a popup grid of icons
@@ -959,59 +935,50 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
static const char* upgradePopupPicker = "upgradePopupPicker";
ImGui::PushID(categoryName.c_str());
-
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0));
- ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
+
+ PushStyleButton(Colors::DarkGray);
uint8_t item = items[CUR_UPG_VALUE(categoryId)];
if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping[item];
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
- auto ret = ImGui::ImageButton(slotEntry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
- if (ret) {
+ if (ImGui::ImageButton(slotEntry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
+ ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1))) {
ImGui::OpenPopup(upgradePopupPicker);
}
} else {
- if (ImGui::Button("##itemNone", ImVec2(32.0f, 32.0f))) {
+ if (ImGui::Button("##itemNone", ImVec2(IMAGE_SIZE, IMAGE_SIZE) + ImGui::GetStyle().FramePadding * 2)) {
ImGui::OpenPopup(upgradePopupPicker);
}
}
- ImGui::PopStyleVar();
- ImGui::PopStyleColor();
- UIWidgets::SetLastItemHoverText(categoryName.c_str());
+ PopStyleButton();
+ Tooltip(categoryName.c_str());
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
if (ImGui::BeginPopup(upgradePopupPicker)) {
for (int32_t pickerIndex = 0; pickerIndex < items.size(); pickerIndex++) {
if ((pickerIndex % 8) != 0) {
ImGui::SameLine();
}
-
+
+ PushStyleButton(Colors::DarkGray);
if (items[pickerIndex] == ITEM_NONE) {
- if (ImGui::Button("##upgradePopupPicker", ImVec2(32.0f, 32.0f))) {
+ if (ImGui::Button("##upgradePopupPicker", ImVec2(IMAGE_SIZE, IMAGE_SIZE) + ImGui::GetStyle().FramePadding * 2)) {
Inventory_ChangeUpgrade(categoryId, pickerIndex);
ImGui::CloseCurrentPopup();
}
- UIWidgets::SetLastItemHoverText("None");
+ Tooltip("None");
} else {
const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]];
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
auto ret = ImGui::ImageButton(slotEntry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
Inventory_ChangeUpgrade(categoryId, pickerIndex);
ImGui::CloseCurrentPopup();
}
- UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(slotEntry.id));
+ Tooltip(SohUtils::GetItemName(slotEntry.id).c_str());
}
+ PopStyleButton();
}
-
ImGui::EndPopup();
}
- ImGui::PopStyleVar();
-
ImGui::PopID();
}
@@ -1035,11 +1002,9 @@ void DrawEquipmentTab() {
uint32_t bitMask = 1 << i;
bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0;
const ItemMapEntry& entry = itemMapping[equipmentValues[i]];
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip ? entry.name : entry.nameFaded),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasEquip) {
gSaveContext.inventory.equipment &= ~bitMask;
@@ -1047,9 +1012,9 @@ void DrawEquipmentTab() {
gSaveContext.inventory.equipment |= bitMask;
}
}
- ImGui::PopStyleColor();
+ PopStyleButton();
+ Tooltip(SohUtils::GetItemName(entry.id).c_str());
ImGui::PopID();
- UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(entry.id));
}
const std::vector bulletBagValues = {
@@ -1137,11 +1102,9 @@ void DrawQuestItemButton(uint32_t item) {
const QuestMapEntry& entry = questMapping[item];
uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask;
@@ -1149,8 +1112,8 @@ void DrawQuestItemButton(uint32_t item) {
gSaveContext.inventory.questItems |= bitMask;
}
}
- ImGui::PopStyleColor();
- UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(entry.id));
+ PopStyleButton();
+ Tooltip(SohUtils::GetQuestItemName(entry.id).c_str());
}
// Draws a toggleable icon for a dungeon item that is faded when disabled
@@ -1158,11 +1121,9 @@ void DrawDungeonItemButton(uint32_t item, uint32_t scene) {
const ItemMapEntry& entry = itemMapping[item];
uint32_t bitMask = 1 << (entry.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential
bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0;
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem ? entry.name : entry.nameFaded),
- ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasItem) {
gSaveContext.inventory.dungeonItems[scene] &= ~bitMask;
@@ -1170,12 +1131,11 @@ void DrawDungeonItemButton(uint32_t item, uint32_t scene) {
gSaveContext.inventory.dungeonItems[scene] |= bitMask;
}
}
- ImGui::PopStyleColor();
- UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(entry.id));
+ PopStyleButton();
+ Tooltip(SohUtils::GetItemName(entry.id).c_str());
}
void DrawQuestStatusTab() {
- ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
for (int32_t i = QUEST_MEDALLION_FOREST; i < QUEST_MEDALLION_LIGHT + 1; i++) {
if (i != QUEST_MEDALLION_FOREST) {
@@ -1193,14 +1153,13 @@ void DrawQuestStatusTab() {
// Put Stone of Agony and Gerudo Card on the same line with a little space between them
ImGui::SameLine();
- ImGui::Dummy(ImVec2(20, 0));
+ ImGui::Dummy(ImVec2(IMAGE_SIZE, IMAGE_SIZE) + ImGui::GetStyle().FramePadding * 2);
ImGui::SameLine();
DrawQuestItemButton(QUEST_STONE_OF_AGONY);
ImGui::SameLine();
DrawQuestItemButton(QUEST_GERUDO_CARD);
-
for (const auto& [quest, entry] : songMapping) {
if ((entry.id != QUEST_SONG_MINUET) && (entry.id != QUEST_SONG_LULLABY)) {
ImGui::SameLine();
@@ -1208,11 +1167,9 @@ void DrawQuestStatusTab() {
uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
- ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
- ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
+ PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded),
- ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1));
- ImGui::PopStyleVar();
+ ImVec2(32.0f, 48.0f), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask;
@@ -1220,25 +1177,28 @@ void DrawQuestStatusTab() {
gSaveContext.inventory.questItems |= bitMask;
}
}
- ImGui::PopStyleColor();
- UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(entry.id));
+ PopStyleButton();
+ Tooltip(SohUtils::GetQuestItemName(entry.id).c_str());
}
+ PushStyleInput(THEME_COLOR);
ImGui::InputScalar("GS Count", ImGuiDataType_S16, &gSaveContext.inventory.gsTokens);
- UIWidgets::InsertHelpHoverText("Number of gold skulltula tokens aquired");
+ PopStyleInput();
+ InsertHelpHoverText("Number of gold skulltula tokens aquired");
uint32_t bitMask = 1 << QUEST_SKULL_TOKEN;
bool gsUnlocked = (bitMask & gSaveContext.inventory.questItems) != 0;
- if (ImGui::Checkbox("GS unlocked", &gsUnlocked)) {
+ if (Checkbox("GS unlocked", &gsUnlocked, CheckboxOptions().Color(THEME_COLOR))) {
if (gsUnlocked) {
gSaveContext.inventory.questItems |= bitMask;
} else {
gSaveContext.inventory.questItems &= ~bitMask;
}
}
- UIWidgets::InsertHelpHoverText("If unlocked, enables showing the gold skulltula count in the quest status menu");
+ InsertHelpHoverText("If unlocked, enables showing the gold skulltula count in the quest status menu");
int32_t pohCount = (gSaveContext.inventory.questItems & 0xF0000000) >> 28;
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("PoH count", std::to_string(pohCount).c_str())) {
for (int32_t i = 0; i < 4; i++) {
if (ImGui::Selectable(std::to_string(i).c_str(), pohCount == i)) {
@@ -1248,13 +1208,14 @@ void DrawQuestStatusTab() {
}
ImGui::EndCombo();
}
- UIWidgets::InsertHelpHoverText("The number of pieces of heart acquired towards the next heart container");
+ InsertHelpHoverText("The number of pieces of heart acquired towards the next heart container");
+ PopStyleCombobox();
DrawGroupWithBorder([&]() {
ImGui::Text("Dungeon Items");
static int32_t dungeonItemsScene = SCENE_DEKU_TREE;
- ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f);
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("##DungeonSelect", SohUtils::GetSceneName(dungeonItemsScene).c_str())) {
for (int32_t dungeonIndex = SCENE_DEKU_TREE; dungeonIndex < SCENE_JABU_JABU_BOSS + 1; dungeonIndex++) {
if (ImGui::Selectable(SohUtils::GetSceneName(dungeonIndex).c_str(),
@@ -1265,7 +1226,7 @@ void DrawQuestStatusTab() {
ImGui::EndCombo();
}
- ImGui::PopItemWidth();
+ PopStyleCombobox();
DrawDungeonItemButton(ITEM_KEY_BOSS, dungeonItemsScene);
ImGui::SameLine();
@@ -1277,16 +1238,17 @@ void DrawQuestStatusTab() {
float lineHeight = ImGui::GetTextLineHeightWithSpacing();
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight));
ImGui::SameLine();
+ PushStyleInput(THEME_COLOR);
if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) {
gSaveContext.ship.stats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene];
};
+ PopStyleInput();
} else {
// dungeonItems is size 20 but dungeonKeys is size 19, so there are no keys for the last scene (Barinade's Lair)
ImGui::Text("Barinade's Lair does not have small keys");
}
- });
+ }, "Dungeon Items");
- ImGui::PopItemWidth();
}
void DrawPlayerTab() {
@@ -1364,50 +1326,53 @@ void DrawPlayerTab() {
}
ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
+ PushStyleInput(THEME_COLOR);
DrawGroupWithBorder([&]() {
ImGui::Text("Link's Position");
- ImGui::InputScalar("X Pos", ImGuiDataType_Float, &player->actor.world.pos.x);
- ImGui::SameLine();
- ImGui::InputScalar("Y Pos", ImGuiDataType_Float, &player->actor.world.pos.y);
- ImGui::SameLine();
- ImGui::InputScalar("Z Pos", ImGuiDataType_Float, &player->actor.world.pos.z);
- });
-
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 12);
+ ImGui::InputScalar("X##Pos", ImGuiDataType_Float, &player->actor.world.pos.x);
+ ImGui::InputScalar("Y##Pos", ImGuiDataType_Float, &player->actor.world.pos.y);
+ ImGui::InputScalar("Z##Pos", ImGuiDataType_Float, &player->actor.world.pos.z);
+ ImGui::PopItemWidth();
+ }, "Link's Position");
+ ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Link's Rotation");
- UIWidgets::InsertHelpHoverText("For Link's rotation in relation to the world");
- ImGui::InputScalar("X Rot", ImGuiDataType_S16, &player->actor.world.rot.x);
- ImGui::SameLine();
- ImGui::InputScalar("Y Rot", ImGuiDataType_S16, &player->actor.world.rot.y);
- ImGui::SameLine();
- ImGui::InputScalar("Z Rot", ImGuiDataType_S16, &player->actor.world.rot.z);
- });
-
+ InsertHelpHoverText("For Link's rotation in relation to the world");
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 12);
+ ImGui::InputScalar("X##Rot", ImGuiDataType_S16, &player->actor.world.rot.x);
+ ImGui::InputScalar("Y##Rot", ImGuiDataType_S16, &player->actor.world.rot.y);
+ ImGui::InputScalar("Z##Rot", ImGuiDataType_S16, &player->actor.world.rot.z);
+ ImGui::PopItemWidth();
+ }, "Link's Rotation");
+ ImGui::SameLine();
DrawGroupWithBorder([&]() {
ImGui::Text("Link's Model Rotation");
- UIWidgets::InsertHelpHoverText("For Link's actual model");
- ImGui::InputScalar("X ModRot", ImGuiDataType_S16, &player->actor.shape.rot.x);
- ImGui::SameLine();
- ImGui::InputScalar("Y ModRot", ImGuiDataType_S16, &player->actor.shape.rot.y);
- ImGui::SameLine();
- ImGui::InputScalar("Z ModRot", ImGuiDataType_S16, &player->actor.shape.rot.z);
- });
+ InsertHelpHoverText("For Link's actual model");
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 12);
+ ImGui::InputScalar("X##ModRot", ImGuiDataType_S16, &player->actor.shape.rot.x);
+ ImGui::InputScalar("Y##ModRot", ImGuiDataType_S16, &player->actor.shape.rot.y);
+ ImGui::InputScalar("Z##ModRot", ImGuiDataType_S16, &player->actor.shape.rot.z);
+ ImGui::PopItemWidth();
+ }, "Link's Model Rotation");
ImGui::InputScalar("Linear Velocity", ImGuiDataType_Float, &player->linearVelocity);
- UIWidgets::InsertHelpHoverText("Link's speed along the XZ plane");
+ InsertHelpHoverText("Link's speed along the XZ plane");
ImGui::InputScalar("Y Velocity", ImGuiDataType_Float, &player->actor.velocity.y);
- UIWidgets::InsertHelpHoverText("Link's speed along the Y plane. Caps at -20");
+ InsertHelpHoverText("Link's speed along the Y plane. Caps at -20");
ImGui::InputScalar("Wall Height", ImGuiDataType_Float, &player->yDistToLedge);
- UIWidgets::InsertHelpHoverText("Height used to determine whether Link can climb or grab a ledge at the top");
+ InsertHelpHoverText("Height used to determine whether Link can climb or grab a ledge at the top");
ImGui::InputScalar("Invincibility Timer", ImGuiDataType_S8, &player->invincibilityTimer);
- UIWidgets::InsertHelpHoverText("Can't take damage while this is nonzero");
+ InsertHelpHoverText("Can't take damage while this is nonzero");
ImGui::InputScalar("Gravity", ImGuiDataType_Float, &player->actor.gravity);
- UIWidgets::InsertHelpHoverText("Rate at which Link falls. Default -4.0f");
+ InsertHelpHoverText("Rate at which Link falls. Default -4.0f");
+ PopStyleInput();
+ PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("Link Age on Load", gPlayState->linkAgeOnLoad == 0 ? "Adult" : "Child")) {
if (ImGui::Selectable("Adult")) {
gPlayState->linkAgeOnLoad = 0;
@@ -1417,132 +1382,140 @@ void DrawPlayerTab() {
}
ImGui::EndCombo();
}
-
- UIWidgets::InsertHelpHoverText("This will change Link's age when you load a map");
-
+ InsertHelpHoverText("This will change Link's age when you load a map");
+ PopStyleCombobox();
ImGui::Separator();
- ImGui::Text("Link's Current Equipment");
- ImGui::PushItemWidth(ImGui::GetFontSize() * 15);
- if (ImGui::BeginCombo("Sword", curSword)) {
- if (ImGui::Selectable("None")) {
- player->currentSwordItemId = ITEM_NONE;
- gSaveContext.equips.buttonItems[0] = ITEM_NONE;
- Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_NONE);
- }
- if (ImGui::Selectable("Kokiri Sword")) {
- player->currentSwordItemId = ITEM_SWORD_KOKIRI;
- gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
- Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_KOKIRI);
- }
- if (ImGui::Selectable("Master Sword")) {
- player->currentSwordItemId = ITEM_SWORD_MASTER;
- gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER;
- Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER);
- }
- if (ImGui::Selectable("Biggoron's Sword")) {
- if (gSaveContext.bgsFlag) {
- if (gSaveContext.swordHealth < 8) {
- gSaveContext.swordHealth = 8;
- }
- player->currentSwordItemId = ITEM_SWORD_BGS;
- gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS;
- } else {
- if (gSaveContext.swordHealth < 8) {
- gSaveContext.swordHealth = 8;
- }
- player->currentSwordItemId = ITEM_SWORD_BGS;
- gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE;
+ DrawGroupWithBorder([&]() {
+ PushStyleCombobox(THEME_COLOR);
+ ImGui::Text("Link's Current Equipment");
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 12);
+ if (ImGui::BeginCombo("Sword", curSword)) {
+ if (ImGui::Selectable("None")) {
+ player->currentSwordItemId = ITEM_NONE;
+ gSaveContext.equips.buttonItems[0] = ITEM_NONE;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_NONE);
}
-
- Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_BIGGORON);
- }
- if (ImGui::Selectable("Fishing Pole")) {
- player->currentSwordItemId = ITEM_FISHING_POLE;
- gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE;
- Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER);
- }
- ImGui::EndCombo();
+ if (ImGui::Selectable("Kokiri Sword")) {
+ player->currentSwordItemId = ITEM_SWORD_KOKIRI;
+ gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_KOKIRI);
+ }
+ if (ImGui::Selectable("Master Sword")) {
+ player->currentSwordItemId = ITEM_SWORD_MASTER;
+ gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER);
+ }
+ if (ImGui::Selectable("Biggoron's Sword")) {
+ if (gSaveContext.bgsFlag) {
+ if (gSaveContext.swordHealth < 8) {
+ gSaveContext.swordHealth = 8;
+ }
+ player->currentSwordItemId = ITEM_SWORD_BGS;
+ gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS;
+ }
+ else {
+ if (gSaveContext.swordHealth < 8) {
+ gSaveContext.swordHealth = 8;
+ }
+ player->currentSwordItemId = ITEM_SWORD_BGS;
+ gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE;
+ }
- }
- if (ImGui::BeginCombo("Shield", curShield)) {
- if (ImGui::Selectable("None")) {
- player->currentShield = PLAYER_SHIELD_NONE;
- Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_NONE);
- }
- if (ImGui::Selectable("Deku Shield")) {
- player->currentShield = PLAYER_SHIELD_DEKU;
- Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_DEKU);
- }
- if (ImGui::Selectable("Hylian Shield")) {
- player->currentShield = PLAYER_SHIELD_HYLIAN;
- Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_HYLIAN);
- }
- if (ImGui::Selectable("Mirror Shield")) {
- player->currentShield = PLAYER_SHIELD_MIRROR;
- Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_MIRROR);
- }
- ImGui::EndCombo();
- }
+ Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_BIGGORON);
+ }
+ if (ImGui::Selectable("Fishing Pole")) {
+ player->currentSwordItemId = ITEM_FISHING_POLE;
+ gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER);
+ }
+ ImGui::EndCombo();
- if (ImGui::BeginCombo("Tunic", curTunic)) {
- if (ImGui::Selectable("Kokiri Tunic")) {
- player->currentTunic = PLAYER_TUNIC_KOKIRI;
- Inventory_ChangeEquipment(EQUIP_TYPE_TUNIC, EQUIP_VALUE_TUNIC_KOKIRI);
}
- if (ImGui::Selectable("Goron Tunic")) {
- player->currentTunic = PLAYER_TUNIC_GORON;
- Inventory_ChangeEquipment(EQUIP_TYPE_TUNIC, EQUIP_VALUE_TUNIC_GORON);
+ if (ImGui::BeginCombo("Shield", curShield)) {
+ if (ImGui::Selectable("None")) {
+ player->currentShield = PLAYER_SHIELD_NONE;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_NONE);
+ }
+ if (ImGui::Selectable("Deku Shield")) {
+ player->currentShield = PLAYER_SHIELD_DEKU;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_DEKU);
+ }
+ if (ImGui::Selectable("Hylian Shield")) {
+ player->currentShield = PLAYER_SHIELD_HYLIAN;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_HYLIAN);
+ }
+ if (ImGui::Selectable("Mirror Shield")) {
+ player->currentShield = PLAYER_SHIELD_MIRROR;
+ Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_MIRROR);
+ }
+ ImGui::EndCombo();
}
- if (ImGui::Selectable("Zora Tunic")) {
- player->currentTunic = PLAYER_TUNIC_ZORA;
- Inventory_ChangeEquipment(EQUIP_TYPE_TUNIC, EQUIP_VALUE_TUNIC_ZORA);
- }
- ImGui::EndCombo();
- }
- if (ImGui::BeginCombo("Boots", curBoots)) {
- if (ImGui::Selectable("Kokiri Boots")) {
- player->currentBoots = PLAYER_BOOTS_KOKIRI;
- Inventory_ChangeEquipment(EQUIP_TYPE_BOOTS, EQUIP_VALUE_BOOTS_KOKIRI);
+ if (ImGui::BeginCombo("Tunic", curTunic)) {
+ if (ImGui::Selectable("Kokiri Tunic")) {
+ player->currentTunic = PLAYER_TUNIC_KOKIRI;
+ Inventory_ChangeEquipment(EQUIP_TYPE_TUNIC, EQUIP_VALUE_TUNIC_KOKIRI);
+ }
+ if (ImGui::Selectable("Goron Tunic")) {
+ player->currentTunic = PLAYER_TUNIC_GORON;
+ Inventory_ChangeEquipment(EQUIP_TYPE_TUNIC, EQUIP_VALUE_TUNIC_GORON);
+ }
+ if (ImGui::Selectable("Zora Tunic")) {
+ player->currentTunic = PLAYER_TUNIC_ZORA;
+ Inventory_ChangeEquipment(EQUIP_TYPE_TUNIC, EQUIP_VALUE_TUNIC_ZORA);
+ }
+ ImGui::EndCombo();
}
- if (ImGui::Selectable("Iron Boots")) {
- player->currentBoots = PLAYER_BOOTS_IRON;
- Inventory_ChangeEquipment(EQUIP_TYPE_BOOTS, EQUIP_VALUE_BOOTS_IRON);
+
+ if (ImGui::BeginCombo("Boots", curBoots)) {
+ if (ImGui::Selectable("Kokiri Boots")) {
+ player->currentBoots = PLAYER_BOOTS_KOKIRI;
+ Inventory_ChangeEquipment(EQUIP_TYPE_BOOTS, EQUIP_VALUE_BOOTS_KOKIRI);
+ }
+ if (ImGui::Selectable("Iron Boots")) {
+ player->currentBoots = PLAYER_BOOTS_IRON;
+ Inventory_ChangeEquipment(EQUIP_TYPE_BOOTS, EQUIP_VALUE_BOOTS_IRON);
+ }
+ if (ImGui::Selectable("Hover Boots")) {
+ player->currentBoots = PLAYER_BOOTS_HOVER;
+ Inventory_ChangeEquipment(EQUIP_TYPE_BOOTS, EQUIP_VALUE_BOOTS_HOVER);
+ }
+ ImGui::EndCombo();
}
- if (ImGui::Selectable("Hover Boots")) {
- player->currentBoots = PLAYER_BOOTS_HOVER;
- Inventory_ChangeEquipment(EQUIP_TYPE_BOOTS, EQUIP_VALUE_BOOTS_HOVER);
- }
- ImGui::EndCombo();
- }
+ ImGui::PopItemWidth();
+ PopStyleCombobox();
+ }, "Current Equipment");
+ ImGui::SameLine();
ImU16 one = 1;
- ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
DrawGroupWithBorder([&]() {
- ImGui::Text("Current B Item");
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
+ PushStyleInput(THEME_COLOR);
+ ImGui::Text("Current Items");
ImGui::InputScalar("B Button", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[0], &one, NULL);
- ImGui::NewLine();
-
- ImGui::Text("Current C Equips");
ImGui::InputScalar("C Left", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[1], &one, NULL);
- ImGui::SameLine();
ImGui::InputScalar("C Down", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[2], &one, NULL);
- ImGui::SameLine();
ImGui::InputScalar("C Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[3], &one, NULL);
-
- if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0)) {
- ImGui::NewLine();
- ImGui::Text("Current D-pad Equips");
- ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL); // Two spaces at the end for aligning, not elegant but it's working
- ImGui::SameLine();
+ PopStyleInput();
+ ImGui::PopItemWidth();
+ }, "Current Items");
+
+ if (CVarGetInteger(CVAR_ENHANCEMENT("DpadEquips"), 0)) {
+ ImGui::SameLine();
+ DrawGroupWithBorder([&]() {
+ ImGui::PushItemWidth(ImGui::GetFontSize() * 6);
+ PushStyleInput(THEME_COLOR);
+ ImGui::Text("Current D-pad Items");
+ // Two spaces at the end for aligning, not elegant but it's working
+ ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL);
ImGui::InputScalar("D-pad Down", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[5], &one, NULL);
- // Intentionnal to not put everything on the same line, else it's taking too much for lower resolution.
ImGui::InputScalar("D-pad Left", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[6], &one, NULL);
- ImGui::SameLine();
ImGui::InputScalar("D-pad Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[7], &one, NULL);
- }
- });
+ PopStyleInput();
+ ImGui::PopItemWidth();
+ }, "Current D-pad Items");
+ }
ImGui::Text("Player State");
uint8_t bit[32] = {};
@@ -1550,8 +1523,9 @@ void DrawPlayerTab() {
std::vector> flag_strs = { state1, state2, state3 };
for (int j = 0; j <= 2; j++) {
+ std::string label = fmt::format("State Flags {}", j + 1);
DrawGroupWithBorder([&]() {
- ImGui::Text("State Flags %d", j + 1);
+ ImGui::Text("%s", label.c_str());
std::vector state = flag_strs[j];
for (int i = 0; i <= 31; i++) {
bit[i] = ((flags[j] >> i) & 1);
@@ -1559,46 +1533,62 @@ void DrawPlayerTab() {
ImGui::Text("%s", state[i].c_str());
}
}
- });
+ }, label.c_str());
ImGui::SameLine();
}
DrawGroupWithBorder([&]() {
ImGui::Text("Sword");
ImGui::Text(" %d", player->meleeWeaponState);
- });
+ }, "Sword");
} else {
ImGui::Text("Global Context needed for player info!");
}
}
+void ResetBaseOptions() {
+ intSliderOptionsBase.Color(THEME_COLOR).Size({320.0f, 0.0f}).Tooltip("");
+ buttonOptionsBase.Color(THEME_COLOR).Size(Sizes::Inline).Tooltip("");
+ checkboxOptionsBase.Color(THEME_COLOR).Tooltip("");
+ comboboxOptionsBase.Color(THEME_COLOR).ComponentAlignment(ComponentAlignments::Left).LabelPosition(LabelPositions::Near).Tooltip("");
+}
+
void SaveEditorWindow::DrawElement() {
+ PushStyleTabs(THEME_COLOR);
+ ImGui::PushFont(OTRGlobals::Instance->fontMonoLarger);
+
if (ImGui::BeginTabBar("SaveContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
+ ResetBaseOptions();
if (ImGui::BeginTabItem("Info")) {
DrawInfoTab();
ImGui::EndTabItem();
}
+ ResetBaseOptions();
if (ImGui::BeginTabItem("Inventory")) {
DrawInventoryTab();
ImGui::EndTabItem();
}
+ ResetBaseOptions();
if (ImGui::BeginTabItem("Flags")) {
DrawFlagsTab();
ImGui::EndTabItem();
}
+ ResetBaseOptions();
if (ImGui::BeginTabItem("Equipment")) {
DrawEquipmentTab();
ImGui::EndTabItem();
}
+ ResetBaseOptions();
if (ImGui::BeginTabItem("Quest Status")) {
DrawQuestStatusTab();
ImGui::EndTabItem();
}
+ ResetBaseOptions();
if (ImGui::BeginTabItem("Player")) {
DrawPlayerTab();
ImGui::EndTabItem();
@@ -1606,6 +1596,9 @@ void SaveEditorWindow::DrawElement() {
ImGui::EndTabBar();
}
+
+ ImGui::PopFont();
+ PopStyleTabs();
}
void SaveEditorWindow::InitElement() {}
diff --git a/soh/soh/Enhancements/debugger/dlViewer.cpp b/soh/soh/Enhancements/debugger/dlViewer.cpp
index 4f4d13bff..27833058a 100644
--- a/soh/soh/Enhancements/debugger/dlViewer.cpp
+++ b/soh/soh/Enhancements/debugger/dlViewer.cpp
@@ -1,6 +1,7 @@
#include "actorViewer.h"
#include "soh/util.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include "ResourceManager.h"
#include "DisplayList.h"
#include "soh/OTRGlobals.h"
@@ -91,10 +92,14 @@ void PerformDisplayListSearch() {
void DLViewerWindow::DrawElement() {
// Debounce the search field as listing otr files is expensive
+ UIWidgets::PushStyleInput(THEME_COLOR);
+ ImGui::PushFont(OTRGlobals::Instance->fontMonoLarger);
+
if (ImGui::InputText("Search Display Lists", searchString, ARRAY_COUNT(searchString))) {
doSearch = true;
searchDebounceFrames = 30;
}
+ UIWidgets::PopStyleInput();
if (doSearch) {
if (searchDebounceFrames == 0) {
@@ -105,6 +110,7 @@ void DLViewerWindow::DrawElement() {
searchDebounceFrames--;
}
+ UIWidgets::PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("Active Display List", activeDisplayList.c_str())) {
for (size_t i = 0; i < displayListSearchResults.size(); i++) {
if (ImGui::Selectable(displayListSearchResults[i].c_str())) {
@@ -114,8 +120,10 @@ void DLViewerWindow::DrawElement() {
}
ImGui::EndCombo();
}
+ UIWidgets::PopStyleCombobox();
if (activeDisplayList == "") {
+ ImGui::PopFont();
return;
}
@@ -144,6 +152,7 @@ void DLViewerWindow::DrawElement() {
ImGui::SameLine();
ImGui::PushItemWidth(175.0f);
+ UIWidgets::PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo(("CMD" + id).c_str(), cmdLabel.c_str())) {
if (ImGui::Selectable("gsDPSetPrimColor") && cmd != G_SETPRIMCOLOR) {
*gfx = gsDPSetPrimColor(0, 0, 0, 0, 0, 255);
@@ -162,6 +171,7 @@ void DLViewerWindow::DrawElement() {
}
ImGui::EndCombo();
}
+ UIWidgets::PopStyleCombobox();
ImGui::PopItemWidth();
@@ -194,9 +204,11 @@ void DLViewerWindow::DrawElement() {
if (cmd == G_SETGRAYSCALE) {
bool* state = (bool*)&gfx->words.w1;
ImGui::SameLine();
+ UIWidgets::PushStyleCheckbox(THEME_COLOR);
if (ImGui::Checkbox(("state" + id).c_str(), state)) {
//
}
+ UIWidgets::PopStyleCheckbox();
}
if (cmd == G_SETTILE) {
ImGui::SameLine();
@@ -317,8 +329,11 @@ void DLViewerWindow::DrawElement() {
}
} catch (const std::exception& e) {
ImGui::Text("Error displaying DL instructions.");
+ ImGui::PopFont();
return;
}
+
+ ImGui::PopFont();
}
void DLViewerWindow::InitElement() {
diff --git a/soh/soh/Enhancements/debugger/hookDebugger.cpp b/soh/soh/Enhancements/debugger/hookDebugger.cpp
index 782cf4f7a..113862282 100644
--- a/soh/soh/Enhancements/debugger/hookDebugger.cpp
+++ b/soh/soh/Enhancements/debugger/hookDebugger.cpp
@@ -1,31 +1,33 @@
#include "hookDebugger.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/OTRGlobals.h"
#include
#include
-static std::unordered_map*> hookData;
+static std::map*> hookData;
const ImVec4 grey = ImVec4(0.75, 0.75, 0.75, 1);
const ImVec4 yellow = ImVec4(1, 1, 0, 1);
const ImVec4 red = ImVec4(1, 0, 0, 1);
void DrawHookRegisteringInfos(const char* hookName) {
- if ((*hookData[hookName]).size() == 0) {
+ size_t numHooks = (*hookData[hookName]).size();
+
+ if (numHooks == 0) {
ImGui::TextColored(grey, "No hooks found");
return;
}
- if (ImGui::BeginTable(
- ("Table##" + std::string(hookName)).c_str(),
- 4,
- ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit
- )) {
- ImGui::TableSetupColumn("Id");
- ImGui::TableSetupColumn("Type");
- ImGui::TableSetupColumn("Registration Info");
- //ImGui::TableSetupColumn("Stub");
- ImGui::TableSetupColumn("Number of Calls");
+ ImGui::Text("Total Registered: %d", numHooks);
+
+ if (ImGui::BeginTable(("Table##" + std::string(hookName)).c_str(), 4,
+ ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable |
+ ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit)) {
+ ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed);
+ ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_WidthFixed);
+ ImGui::TableSetupColumn("Registration Info", ImGuiTableColumnFlags_WidthStretch);
+ ImGui::TableSetupColumn("# Calls", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableHeadersRow();
for (auto& [id, hookInfo] : (*hookData[hookName])) {
ImGui::TableNextRow();
@@ -39,7 +41,7 @@ void DrawHookRegisteringInfos(const char* hookName) {
ImGui::Text("Normal");
break;
case HOOK_TYPE_ID:
- ImGui::Text("Id");
+ ImGui::Text("ID");
break;
case HOOK_TYPE_PTR:
ImGui::Text("Ptr");
@@ -54,27 +56,19 @@ void DrawHookRegisteringInfos(const char* hookName) {
ImGui::TableNextColumn();
if (hookInfo.registering.valid) {
- ImGui::Text("%s(%d:%d) %s", hookInfo.registering.file, hookInfo.registering.line, hookInfo.registering.column, hookInfo.registering.function);
+ // Replace the space after the return type of the parent function with a non-breaking space
+ std::string parentFunction = std::string(hookInfo.registering.function);
+ size_t pos = parentFunction.find_first_of(" ");
+ if (pos != std::string::npos) {
+ parentFunction.replace(pos, 1, "\u00A0");
+ }
+ // Non breaking space to keep the arrow with the parent function
+ ImGui::TextWrapped("%s(%d:%d) <-\u00A0%s", hookInfo.registering.file, hookInfo.registering.line,
+ hookInfo.registering.column, parentFunction.c_str());
} else {
- ImGui::TextColored(yellow, "[Unavaliable]");
+ ImGui::TextColored(yellow, "[Unavailable]");
}
- //TODO: not currently possible
- /*
- ImGui::TableNextColumn();
-
- ImGui::BeginDisabled();
-
- bool stubButtonPressed = ImGui::Button(("Stub##" + std::to_string(id)).c_str());
- UIWidgets::SetLastItemHoverText("Stub this hook.\nThis is not possible to automatically undo.");
-
- if (stubButtonPressed) {
- //stub
- }
-
- ImGui::EndDisabled();
- */
-
ImGui::TableNextColumn();
ImGui::Text("%d", hookInfo.calls);
}
@@ -84,26 +78,27 @@ void DrawHookRegisteringInfos(const char* hookName) {
void HookDebuggerWindow::DrawElement() {
#ifndef __cpp_lib_source_location
- ImGui::TextColored(
- yellow,
- "Some features of the Hook Debugger are unavaliable because SoH was compiled "
- "without \"\" support "
- "(\"__cpp_lib_source_location\" not defined in \"\")."
- );
+ ImGui::TextColored(yellow, "Some features of the Hook Debugger are unavailable because SoH was compiled "
+ "without \"\" support "
+ "(\"__cpp_lib_source_location\" not defined in \"\").");
#endif
+ ImGui::PushFont(OTRGlobals::Instance->fontMonoLarger);
+
for (auto& [hookName, _] : hookData) {
if (ImGui::TreeNode(hookName)) {
DrawHookRegisteringInfos(hookName);
ImGui::TreePop();
}
}
+
+ ImGui::PopFont();
}
void HookDebuggerWindow::InitElement() {
- #define DEFINE_HOOK(name, _) hookData.insert({#name, GameInteractor::Instance->GetHookData()});
+#define DEFINE_HOOK(name, _) hookData.insert({ #name, GameInteractor::Instance->GetHookData() });
- #include "../game-interactor/GameInteractor_HookTable.h"
+#include "../game-interactor/GameInteractor_HookTable.h"
- #undef DEFINE_HOOK
+#undef DEFINE_HOOK
}
diff --git a/soh/soh/Enhancements/debugger/sohConsole.cpp b/soh/soh/Enhancements/debugger/sohConsole.cpp
new file mode 100644
index 000000000..686152a1f
--- /dev/null
+++ b/soh/soh/Enhancements/debugger/sohConsole.cpp
@@ -0,0 +1,30 @@
+#include "sohConsole.h"
+#include "soh/OTRGlobals.h"
+#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
+
+void SohConsoleWindow::InitElement() {
+ ConsoleWindow::InitElement();
+}
+
+void SohConsoleWindow::UpdateElement() {
+ ConsoleWindow::UpdateElement();
+}
+
+void SohConsoleWindow::DrawElement() {
+ UIWidgets::PushStyleInput(THEME_COLOR);
+ // Small font (13) to match hardcoded width values in the LUS window.. set large font after below TODO addressed
+ ImGui::PushFont(OTRGlobals::Instance->fontMonoSmall);
+
+ // TODO: This can be removed after the LUS console window is designed better without hardcoding widths
+ ImGui::BeginChild("##Console Wrapper", ImVec2(0, 0), ImGuiChildFlags_None,
+ ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar |
+ ImGuiWindowFlags_NoScrollWithMouse);
+
+ ConsoleWindow::DrawElement();
+
+ ImGui::EndChild();
+
+ ImGui::PopFont();
+ UIWidgets::PopStyleInput();
+}
diff --git a/soh/soh/Enhancements/debugger/sohConsole.h b/soh/soh/Enhancements/debugger/sohConsole.h
new file mode 100644
index 000000000..db039625b
--- /dev/null
+++ b/soh/soh/Enhancements/debugger/sohConsole.h
@@ -0,0 +1,17 @@
+#ifndef SOH_CONSOLE_H
+#define SOH_CONSOLE_H
+
+#include "window/gui/GuiWindow.h"
+#include "window/gui/ConsoleWindow.h"
+
+class SohConsoleWindow : public Ship::ConsoleWindow {
+ public:
+ using ConsoleWindow::ConsoleWindow;
+
+ protected:
+ void InitElement() override;
+ void UpdateElement() override;
+ void DrawElement() override;
+};
+
+#endif // SOH_CONSOLE_H
diff --git a/soh/soh/Enhancements/debugger/sohGfxDebugger.cpp b/soh/soh/Enhancements/debugger/sohGfxDebugger.cpp
new file mode 100644
index 000000000..20b37ca93
--- /dev/null
+++ b/soh/soh/Enhancements/debugger/sohGfxDebugger.cpp
@@ -0,0 +1,16 @@
+#include "sohGfxDebugger.h"
+#include "soh/OTRGlobals.h"
+
+void SohGfxDebuggerWindow::InitElement() {
+ GfxDebuggerWindow::InitElement();
+}
+
+void SohGfxDebuggerWindow::UpdateElement() {
+ GfxDebuggerWindow::UpdateElement();
+}
+
+void SohGfxDebuggerWindow::DrawElement() {
+ ImGui::PushFont(OTRGlobals::Instance->fontMonoLarger);
+ GfxDebuggerWindow::DrawElement();
+ ImGui::PopFont();
+}
diff --git a/soh/soh/Enhancements/debugger/sohGfxDebugger.h b/soh/soh/Enhancements/debugger/sohGfxDebugger.h
new file mode 100644
index 000000000..789173b88
--- /dev/null
+++ b/soh/soh/Enhancements/debugger/sohGfxDebugger.h
@@ -0,0 +1,17 @@
+#ifndef SOH_GFX_DEBUGGER_H
+#define SOH_GFX_DEBUGGER_H
+
+#include "window/gui/GuiWindow.h"
+#include "window/gui/GfxDebuggerWindow.h"
+
+class SohGfxDebuggerWindow : public LUS::GfxDebuggerWindow {
+ public:
+ using GfxDebuggerWindow::GfxDebuggerWindow;
+
+ protected:
+ void InitElement() override;
+ void UpdateElement() override;
+ void DrawElement() override;
+};
+
+#endif // SOH_GFX_DEBUGGER_H
diff --git a/soh/soh/Enhancements/debugger/valueViewer.cpp b/soh/soh/Enhancements/debugger/valueViewer.cpp
index 7d09dfb63..23ce4e26c 100644
--- a/soh/soh/Enhancements/debugger/valueViewer.cpp
+++ b/soh/soh/Enhancements/debugger/valueViewer.cpp
@@ -1,5 +1,6 @@
#include "valueViewer.h"
#include "soh/SohGui/UIWidgets.hpp"
+#include "soh/SohGui/SohGui.hpp"
#include "soh/OTRGlobals.h"
#include "soh/ShipInit.hpp"
@@ -142,13 +143,14 @@ void RegisterValueViewerHooks() {
RegisterShipInitFunc initFunc(RegisterValueViewerHooks, { CVAR_NAME });
void ValueViewerWindow::DrawElement() {
- UIWidgets::PaddedEnhancementCheckbox("Enable Printing", CVAR_NAME);
+ UIWidgets::CVarCheckbox("Enable Printing", CVAR_NAME, UIWidgets::CheckboxOptions().Color(THEME_COLOR));
ImGui::BeginGroup();
static int selectedElement = -1;
std::string selectedElementText = (selectedElement == -1) ? "Select a value" : (
std::string(valueTable[selectedElement].name) + " (" + std::string(valueTable[selectedElement].path) + ")"
);
+ UIWidgets::PushStyleCombobox(THEME_COLOR);
if (ImGui::BeginCombo("##valueViewerElement", selectedElementText.c_str())) {
for (int i = 0; i < valueTable.size(); i++) {
if (valueTable[i].isActive) continue;
@@ -165,20 +167,28 @@ void ValueViewerWindow::DrawElement() {
}
ImGui::EndCombo();
}
+ UIWidgets::PopStyleCombobox();
ImGui::SameLine();
+ UIWidgets::PushStyleButton(THEME_COLOR);
if (selectedElement != -1 && ImGui::Button("+")) {
valueTable[selectedElement].isActive = true;
selectedElement = -1;
}
+ UIWidgets::PopStyleButton();
ImGui::EndGroup();
for (int i = 0; i < valueTable.size(); i++) {
ValueTableElement& element = valueTable[i];
if (!element.isActive || (gPlayState == NULL && element.requiresPlayState)) continue;
- if (ImGui::Button(("x##" + std::string(element.name)).c_str())) {
+ UIWidgets::PushStyleButton(THEME_COLOR);
+ UIWidgets::PushStyleCheckbox(THEME_COLOR);
+ ImGui::AlignTextToFramePadding();
+ if (ImGui::Button((ICON_FA_TIMES + std::string("##") + std::string(element.name)).c_str())) {
element.isActive = false;
element.isPrinted = false;
}
+ UIWidgets::PopStyleCheckbox();
+ UIWidgets::PopStyleButton();
ImGui::SameLine();
ImGui::Text("%s:", element.name);
ImGui::SameLine();
@@ -212,7 +222,7 @@ void ValueViewerWindow::DrawElement() {
break;
}
ImGui::SameLine();
-
+ UIWidgets::PushStyleCheckbox(THEME_COLOR);
if (element.type <= TYPE_U32) {
ImGui::Checkbox(("Hex##" + std::string(element.name)).c_str(), &element.typeFormat);
ImGui::SameLine();
@@ -220,23 +230,30 @@ void ValueViewerWindow::DrawElement() {
ImGui::Checkbox(("Trim##" + std::string(element.name)).c_str(), &element.typeFormat);
ImGui::SameLine();
}
+ UIWidgets::PopStyleCheckbox();
ImGui::BeginGroup();
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ValueViewerEnablePrinting"), 0)) {
+ UIWidgets::PushStyleCheckbox(THEME_COLOR);
ImGui::Checkbox(("Print##" + std::string(element.name)).c_str(), &element.isPrinted);
+ UIWidgets::PopStyleCheckbox();
if (element.isPrinted) {
char* prefix = (char*)element.prefix.c_str();
ImGui::SameLine();
ImGui::SetNextItemWidth(80.0f);
+ UIWidgets::PushStyleInput(THEME_COLOR);
if (ImGui::InputText(("Prefix##" + std::string(element.name)).c_str(), prefix, 10)) {
element.prefix = prefix;
}
+ UIWidgets::PopStyleInput();
ImGui::SameLine();
ImGui::ColorEdit3(("##color" + std::string(element.name)).c_str(), (float*)&element.color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel);
ImGui::SameLine();
+ UIWidgets::PushStyleCheckbox(THEME_COLOR);
if (ImGui::Button(("Position##" + std::string(element.name)).c_str())) {
ImGui::OpenPopup(("Position Picker##" + std::string(element.name)).c_str());
}
+ UIWidgets::PopStyleCheckbox();
if (ImGui::BeginPopup(("Position Picker##" + std::string(element.name)).c_str())) {
ImGui::DragInt("X", (int*)&element.x, 1.0f, 0, 44);
ImGui::DragInt("Y", (int*)&element.y, 1.0f, 0, 29);
diff --git a/soh/soh/Enhancements/enemyrandomizer.cpp b/soh/soh/Enhancements/enemyrandomizer.cpp
index a2b72ca07..326a4a78d 100644
--- a/soh/soh/Enhancements/enemyrandomizer.cpp
+++ b/soh/soh/Enhancements/enemyrandomizer.cpp
@@ -186,7 +186,7 @@ extern "C" uint8_t GetRandomizedEnemy(PlayState* play, int16_t *actorId, f32 *po
// Lengthen timer in non-MQ Jabu Jabu bubble room.
if (!isMQ && *actorId == ACTOR_OBJ_ROOMTIMER && *params == 30760 && play->sceneNum == SCENE_JABU_JABU &&
play->roomCtx.curRoom.num == 12) {
- *params = 92280;
+ *params = (*params & ~0x3FF) | 120;
}
if (IsEnemyFoundToRandomize(play->sceneNum, play->roomCtx.curRoom.num, *actorId, *params, *posX)) {
@@ -286,7 +286,7 @@ void GetSelectedEnemies() {
for (int i = 0; i < 49; i++) {
if (CVarGetInteger(CVAR_ENHANCEMENT("RandomizedEnemyList.All"), 0)) {
selectedEnemyList.push_back(randomizedEnemySpawnTable[i]);
- } else if (CVarGetInteger(enemyCVarList[i], 0)) {
+ } else if (CVarGetInteger(enemyCVarList[i], 1)) {
selectedEnemyList.push_back(randomizedEnemySpawnTable[i]);
}
}
diff --git a/soh/soh/Enhancements/enhancementTypes.h b/soh/soh/Enhancements/enhancementTypes.h
index db96a7700..14228054b 100644
--- a/soh/soh/Enhancements/enhancementTypes.h
+++ b/soh/soh/Enhancements/enhancementTypes.h
@@ -39,7 +39,7 @@ typedef enum {
MIRRORED_WORLD_ALWAYS,
MIRRORED_WORLD_RANDOM,
MIRRORED_WORLD_RANDOM_SEEDED,
- MIRRORED_WORLD_DUNGEONS_All,
+ MIRRORED_WORLD_DUNGEONS_ALL,
MIRRORED_WORLD_DUNGEONS_VANILLA,
MIRRORED_WORLD_DUNGEONS_MQ,
MIRRORED_WORLD_DUNGEONS_RANDOM,
@@ -75,6 +75,18 @@ typedef enum {
BONK_DAMAGE_OHKO,
} BonkDamage;
+typedef enum {
+ DAMAGE_VANILLA,
+ DAMAGE_DOUBLE,
+ DAMAGE_QUADRUPLE,
+ DAMAGE_OCTUPLE,
+ DAMAGE_FOOLISH,
+ DAMAGE_RIDICULOUS,
+ DAMAGE_MERCILESS,
+ DAMAGE_TORTURE,
+ DAMAGE_OHKO
+} DamageMultType;
+
typedef enum {
DEKU_STICK_NORMAL,
DEKU_STICK_UNBREAKABLE,
@@ -87,4 +99,16 @@ typedef enum {
SWORD_TOGGLE_BOTH_AGES,
} SwordToggleMode;
+typedef enum {
+ TIME_TRAVEL_DISABLED,
+ TIME_TRAVEL_OOT,
+ TIME_TRAVEL_ANY
+} TimeTravelType;
+
+typedef enum {
+ WATERFALL_ALWAYS,
+ WATERFALL_ONCE,
+ WATERFALL_NEVER
+} SleepingWaterfallType;
+
#endif
diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h
index 8c6be086f..db68ad86a 100644
--- a/soh/soh/Enhancements/game-interactor/GameInteractor.h
+++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h
@@ -4,8 +4,8 @@
#define GameInteractor_h
#include "libultraship/libultraship.h"
-#include "GameInteractionEffect.h"
#include "vanilla-behavior/GIVanillaBehavior.h"
+#include "GameInteractionEffect.h"
#include "soh/Enhancements/item-tables/ItemTableTypes.h"
#include
@@ -92,19 +92,20 @@ void GameInteractor_SetTriforceHuntCreditsWarpActive(uint8_t state);
}
#endif
-
#ifdef __cplusplus
#include
#include
+#include