From 65e844c0c6656ee30c7fb5fea4a633a706e839a7 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Sun, 16 Jun 2024 21:58:15 +0800 Subject: [PATCH 1/7] update submodule, breast limit multiplier --- app/src/main/assets/gakumas-local | 2 +- app/src/main/cpp/GakumasLocalify/Hook.cpp | 18 +++++++++++++++++- .../main/cpp/GakumasLocalify/config/Config.cpp | 2 +- .../main/cpp/GakumasLocalify/config/Config.hpp | 2 +- .../gakumas/localify/ConfigUpdateListener.kt | 6 +++--- .../gakumas/localify/models/GakumasConfig.kt | 2 +- app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 9 files changed, 27 insertions(+), 11 deletions(-) diff --git a/app/src/main/assets/gakumas-local b/app/src/main/assets/gakumas-local index e97c861..b736d15 160000 --- a/app/src/main/assets/gakumas-local +++ b/app/src/main/assets/gakumas-local @@ -1 +1 @@ -Subproject commit e97c861d73668fdaa00c4aded70b18ead28fee02 +Subproject commit b736d15d9c015b97c1dec5a679b41e62c8508e33 diff --git a/app/src/main/cpp/GakumasLocalify/Hook.cpp b/app/src/main/cpp/GakumasLocalify/Hook.cpp index 08c182f..0455913 100644 --- a/app/src/main/cpp/GakumasLocalify/Hook.cpp +++ b/app/src/main/cpp/GakumasLocalify/Hook.cpp @@ -740,6 +740,9 @@ namespace GakumasLocal::HookMain { static auto limitInfo_field = ActorSwingBreastBone_klass->Get("limitInfo"); static auto limitInfo_useLimit_field = LimitInfo_klass->Get("useLimit"); + static auto limitInfo_axisX_field = LimitInfo_klass->Get("axisX"); + static auto limitInfo_axisY_field = LimitInfo_klass->Get("axisY"); + static auto limitInfo_axisZ_field = LimitInfo_klass->Get("axisZ"); auto swingBreastBones = Il2cppUtils::ClassGetFieldValue *>(initializeData, Data_swingBreastBones_field); @@ -778,8 +781,21 @@ namespace GakumasLocal::HookMain { Log::DebugFmt("orig bone: damping: %f, stiffness: %f, spring: %f, pendulum: %f, " "pendulumRange: %f, average: %f, rootWeight: %f, useLimit: %d, useArmCorrection: %d, isDirty: %d", damping, stiffness, spring, pendulum, pendulumRange, average, rootWeight, useLimit, useArmCorrection, isDirty); + if (Config::bUseLimit == 0.0f) { + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_useLimit_field, 0); + } + else { + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_useLimit_field, 1); + if (Config::bUseLimit != 1.0f) { + auto axisX = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisX_field); + auto axisY = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisY_field); + auto axisZ = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisZ_field); + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisX_field, axisX * Config::bUseLimit); + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisY_field, axisY * Config::bUseLimit); + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisZ_field, axisZ * Config::bUseLimit); + } + } - Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_useLimit_field, Config::bUseLimit); Il2cppUtils::ClassSetFieldValue(bone, damping_field, Config::bDamping); Il2cppUtils::ClassSetFieldValue(bone, stiffness_field, Config::bStiffness); Il2cppUtils::ClassSetFieldValue(bone, spring_field, Config::bSpring); diff --git a/app/src/main/cpp/GakumasLocalify/config/Config.cpp b/app/src/main/cpp/GakumasLocalify/config/Config.cpp index 40108e0..7f3791e 100644 --- a/app/src/main/cpp/GakumasLocalify/config/Config.cpp +++ b/app/src/main/cpp/GakumasLocalify/config/Config.cpp @@ -29,7 +29,7 @@ namespace GakumasLocal::Config { int lodQualityLevel = 4; bool enableBreastParam = false; - int bUseLimit = 1; + float bUseLimit = 1.0f; float bDamping = 0.33f; float bStiffness = 0.08f; float bSpring = 1.0f; diff --git a/app/src/main/cpp/GakumasLocalify/config/Config.hpp b/app/src/main/cpp/GakumasLocalify/config/Config.hpp index 8a4bec9..32aedca 100644 --- a/app/src/main/cpp/GakumasLocalify/config/Config.hpp +++ b/app/src/main/cpp/GakumasLocalify/config/Config.hpp @@ -28,7 +28,7 @@ namespace GakumasLocal::Config { extern int lodQualityLevel; extern bool enableBreastParam; - extern int bUseLimit; + extern float bUseLimit; extern float bDamping; extern float bStiffness; extern float bSpring; diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt index 031a3f7..a0090d3 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt @@ -334,10 +334,10 @@ interface ConfigUpdateListener: ConfigListener { override fun onBUseLimitChanged(s: CharSequence, start: Int, before: Int, count: Int){ binding.config!!.bUseLimit = try { - s.toString().toInt() + s.toString().toFloat() } catch (e: Exception) { - 0 + 0f } saveConfig() } @@ -372,7 +372,7 @@ interface ConfigUpdateListener: ConfigListener { binding.config!!.bPendulumRange = setData[4] binding.config!!.bAverage = setData[5] binding.config!!.bRootWeight = setData[6] - binding.config!!.bUseLimit = setData[7].toInt() + binding.config!!.bUseLimit = setData[7] binding.config!!.bUseArmCorrection = true checkConfigAndUpdateView() diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt index beb5763..cd6914c 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt @@ -25,7 +25,7 @@ data class GakumasConfig ( var lodQualityLevel: Int = 4, // 0~5 var enableBreastParam: Boolean = false, - var bUseLimit: Int = 1, + var bUseLimit: Float = 1.0f, var bDamping: Float = 0.33f, var bStiffness: Float = 0.08f, var bSpring: Float = 1.0f, diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index b2217bf..1c63996 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -897,7 +897,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:ems="10" - android:inputType="number" + android:inputType="numberDecimal|numberSigned" android:onTextChanged="@{(s, st, b, a) -> listener.onBUseLimitChanged(s, st, b, a)}" android:paddingStart="0dp" android:paddingEnd="0dp" diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 1c75d80..c903592 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -32,7 +32,7 @@ 钟摆范围 (PendulumRange) Average RootWeight - 限制范围 (0/1) + 范围限制倍率 (0 为不限制, 1 为原版) 使用手臂矫正 IsDirty 应用缩放 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6b6c102..9050b63 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,7 +32,7 @@ Pendulum Range Average Root Weight - Use Limit (0/1) + Limit Range Multiplier (0 is Unlimited) Use Arm Correction IsDirty Use Breast Scale From 7ad798386b97e7f00cfd5fe82f47f782e8fdb222 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Sun, 16 Jun 2024 23:23:51 +0800 Subject: [PATCH 2/7] add type, add limit axis config --- app/src/main/cpp/GakumasLocalify/Hook.cpp | 23 +- .../cpp/GakumasLocalify/config/Config.cpp | 16 +- .../cpp/GakumasLocalify/config/Config.hpp | 8 +- .../cpp/deps/UnityResolve/UnityResolve.hpp | 70 +++++- .../gakumas/localify/ConfigUpdateListener.kt | 107 ++++++++- .../gakumas/localify/models/GakumasConfig.kt | 10 +- app/src/main/res/layout/activity_main.xml | 206 ++++++++++++++++-- app/src/main/res/values-zh-rCN/strings.xml | 7 + app/src/main/res/values/strings.xml | 7 + 9 files changed, 404 insertions(+), 50 deletions(-) diff --git a/app/src/main/cpp/GakumasLocalify/Hook.cpp b/app/src/main/cpp/GakumasLocalify/Hook.cpp index 0455913..c538fd2 100644 --- a/app/src/main/cpp/GakumasLocalify/Hook.cpp +++ b/app/src/main/cpp/GakumasLocalify/Hook.cpp @@ -781,19 +781,24 @@ namespace GakumasLocal::HookMain { Log::DebugFmt("orig bone: damping: %f, stiffness: %f, spring: %f, pendulum: %f, " "pendulumRange: %f, average: %f, rootWeight: %f, useLimit: %d, useArmCorrection: %d, isDirty: %d", damping, stiffness, spring, pendulum, pendulumRange, average, rootWeight, useLimit, useArmCorrection, isDirty); - if (Config::bUseLimit == 0.0f) { + if (!Config::bUseLimit) { Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_useLimit_field, 0); } else { Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_useLimit_field, 1); - if (Config::bUseLimit != 1.0f) { - auto axisX = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisX_field); - auto axisY = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisY_field); - auto axisZ = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisZ_field); - Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisX_field, axisX * Config::bUseLimit); - Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisY_field, axisY * Config::bUseLimit); - Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisZ_field, axisZ * Config::bUseLimit); - } + auto axisX = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisX_field); + auto axisY = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisY_field); + auto axisZ = Il2cppUtils::ClassGetFieldValue(limitInfo, limitInfo_axisZ_field); + axisX.m_X *= Config::bLimitXx; + axisX.m_Y *= Config::bLimitXy; + axisY.m_X *= Config::bLimitYx; + axisY.m_Y *= Config::bLimitYy; + axisZ.m_X *= Config::bLimitZx; + axisZ.m_Y *= Config::bLimitZy; + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisX_field, axisX); + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisY_field, axisY); + Il2cppUtils::ClassSetFieldValue(limitInfo, limitInfo_axisZ_field, axisZ); + } Il2cppUtils::ClassSetFieldValue(bone, damping_field, Config::bDamping); diff --git a/app/src/main/cpp/GakumasLocalify/config/Config.cpp b/app/src/main/cpp/GakumasLocalify/config/Config.cpp index 7f3791e..dae0fcd 100644 --- a/app/src/main/cpp/GakumasLocalify/config/Config.cpp +++ b/app/src/main/cpp/GakumasLocalify/config/Config.cpp @@ -29,7 +29,6 @@ namespace GakumasLocal::Config { int lodQualityLevel = 4; bool enableBreastParam = false; - float bUseLimit = 1.0f; float bDamping = 0.33f; float bStiffness = 0.08f; float bSpring = 1.0f; @@ -40,6 +39,13 @@ namespace GakumasLocal::Config { bool bUseArmCorrection = true; bool bUseScale = false; float bScale = 1.0f; + bool bUseLimit = true; + float bLimitXx = 1.0f; + float bLimitXy = 1.0f; + float bLimitYx = 1.0f; + float bLimitYy = 1.0f; + float bLimitZx = 1.0f; + float bLimitZy = 1.0f; void LoadConfig(const std::string& configStr) { try { @@ -68,7 +74,6 @@ namespace GakumasLocal::Config { GetConfigItem(reflectionQualityLevel); GetConfigItem(lodQualityLevel); GetConfigItem(enableBreastParam); - GetConfigItem(bUseLimit); GetConfigItem(bDamping); GetConfigItem(bStiffness); GetConfigItem(bSpring); @@ -79,6 +84,13 @@ namespace GakumasLocal::Config { GetConfigItem(bUseArmCorrection); GetConfigItem(bUseScale); GetConfigItem(bScale); + GetConfigItem(bUseLimit); + GetConfigItem(bLimitXx); + GetConfigItem(bLimitXy); + GetConfigItem(bLimitYx); + GetConfigItem(bLimitYy); + GetConfigItem(bLimitZx); + GetConfigItem(bLimitZy); } catch (std::exception& e) { diff --git a/app/src/main/cpp/GakumasLocalify/config/Config.hpp b/app/src/main/cpp/GakumasLocalify/config/Config.hpp index 32aedca..38aaa64 100644 --- a/app/src/main/cpp/GakumasLocalify/config/Config.hpp +++ b/app/src/main/cpp/GakumasLocalify/config/Config.hpp @@ -28,7 +28,6 @@ namespace GakumasLocal::Config { extern int lodQualityLevel; extern bool enableBreastParam; - extern float bUseLimit; extern float bDamping; extern float bStiffness; extern float bSpring; @@ -39,6 +38,13 @@ namespace GakumasLocal::Config { extern bool bUseArmCorrection; extern bool bUseScale; extern float bScale; + extern bool bUseLimit; + extern float bLimitXx; + extern float bLimitXy; + extern float bLimitYx; + extern float bLimitYy; + extern float bLimitZx; + extern float bLimitZy; void LoadConfig(const std::string& configStr); } diff --git a/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp b/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp index d199bf5..e49b779 100644 --- a/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp +++ b/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp @@ -983,7 +983,75 @@ class UnityResolve final { auto operator ==(const Vector2 x) const -> bool { return this->x == x.x && this->y == x.y; } }; - struct Vector4 { + struct Vector2Int { + int m_X, m_Y; + + Vector2Int() { m_X = m_Y = 0; } + + Vector2Int(const int f1, const int f2) { + m_X = f1; + m_Y = f2; + } + + [[nodiscard]] auto Distance(const Vector2Int& event) const -> float { + const auto dx = this->m_X - event.m_X; + const auto dy = this->m_Y - event.m_Y; + return std::sqrt(dx * dx + dy * dy); + } + + auto operator*(const int x) -> Vector2Int { + this->m_X *= x; + this->m_Y *= x; + return *this; + } + + auto operator/(const int x) -> Vector2Int { + this->m_X /= x; + this->m_Y /= x; + return *this; + } + + auto operator+(const int x) -> Vector2Int { + this->m_X += x; + this->m_Y += x; + return *this; + } + + auto operator-(const int x) -> Vector2Int { + this->m_X -= x; + this->m_Y -= x; + return *this; + } + + auto operator*(const Vector2Int x) -> Vector2Int { + this->m_X *= x.m_X; + this->m_Y *= x.m_Y; + return *this; + } + + auto operator-(const Vector2Int x) -> Vector2Int { + this->m_X -= x.m_X; + this->m_Y -= x.m_Y; + return *this; + } + + auto operator+(const Vector2Int x) -> Vector2Int { + this->m_X += x.m_X; + this->m_Y += x.m_Y; + return *this; + } + + auto operator/(const Vector2Int x) -> Vector2Int { + this->m_X /= x.m_X; + this->m_Y /= x.m_Y; + return *this; + } + + auto operator ==(const Vector2Int x) const -> bool { return this->m_X == x.m_X && this->m_Y == x.m_Y; } + }; + + + struct Vector4 { float x, y, z, w; Vector4() { x = y = z = w = 0.F; } diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt index a0090d3..457fdf4 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/ConfigUpdateListener.kt @@ -35,7 +35,13 @@ interface ConfigListener { fun onBPendulumRangeChanged(s: CharSequence, start: Int, before: Int, count: Int) fun onBAverageChanged(s: CharSequence, start: Int, before: Int, count: Int) fun onBRootWeightChanged(s: CharSequence, start: Int, before: Int, count: Int) - fun onBUseLimitChanged(s: CharSequence, start: Int, before: Int, count: Int) + fun onBUseLimitChanged(value: Boolean) + fun onBLimitXxChanged(s: CharSequence, start: Int, before: Int, count: Int) + fun onBLimitXyChanged(s: CharSequence, start: Int, before: Int, count: Int) + fun onBLimitYxChanged(s: CharSequence, start: Int, before: Int, count: Int) + fun onBLimitYyChanged(s: CharSequence, start: Int, before: Int, count: Int) + fun onBLimitZxChanged(s: CharSequence, start: Int, before: Int, count: Int) + fun onBLimitZyChanged(s: CharSequence, start: Int, before: Int, count: Int) fun onBScaleChanged(s: CharSequence, start: Int, before: Int, count: Int) fun onBUseArmCorrectionChanged(value: Boolean) fun onBUseScaleChanged(value: Boolean) @@ -332,8 +338,14 @@ interface ConfigUpdateListener: ConfigListener { saveConfig() } - override fun onBUseLimitChanged(s: CharSequence, start: Int, before: Int, count: Int){ - binding.config!!.bUseLimit = try { + override fun onBUseLimitChanged(value: Boolean){ + binding.config!!.bUseLimit = value + saveConfig() + checkConfigAndUpdateView() + } + + override fun onBLimitXxChanged(s: CharSequence, start: Int, before: Int, count: Int) { + binding.config!!.bLimitXx = try { s.toString().toFloat() } catch (e: Exception) { @@ -342,7 +354,58 @@ interface ConfigUpdateListener: ConfigListener { saveConfig() } - override fun onBScaleChanged(s: CharSequence, start: Int, before: Int, count: Int){ + override fun onBLimitXyChanged(s: CharSequence, start: Int, before: Int, count: Int) { + binding.config!!.bLimitXy = try { + s.toString().toFloat() + } + catch (e: Exception) { + 0f + } + saveConfig() + } + + override fun onBLimitYxChanged(s: CharSequence, start: Int, before: Int, count: Int) { + binding.config!!.bLimitYx = try { + s.toString().toFloat() + } + catch (e: Exception) { + 0f + } + saveConfig() + } + + override fun onBLimitYyChanged(s: CharSequence, start: Int, before: Int, count: Int) { + binding.config!!.bLimitYy = try { + s.toString().toFloat() + } + catch (e: Exception) { + 0f + } + saveConfig() + } + + override fun onBLimitZxChanged(s: CharSequence, start: Int, before: Int, count: Int) { + binding.config!!.bLimitZx = try { + s.toString().toFloat() + } + catch (e: Exception) { + 0f + } + saveConfig() + } + + override fun onBLimitZyChanged(s: CharSequence, start: Int, before: Int, count: Int) { + binding.config!!.bLimitZy = try { + s.toString().toFloat() + } + catch (e: Exception) { + 0f + } + saveConfig() + } + + + override fun onBScaleChanged(s: CharSequence, start: Int, before: Int, count: Int) { binding.config!!.bScale = try { s.toString().toFloat() } @@ -351,18 +414,26 @@ interface ConfigUpdateListener: ConfigListener { } saveConfig() } + override fun onBClickPresetChanged(index: Int) { val setData: FloatArray = when (index) { // 0.33, 0.08, 0.7, 0.12, 0.25, 0.2, 0.8, 0, noUseArm 啥玩意 - 0 -> floatArrayOf(0.33f, 0.07f, 0.7f, 0.06f, 0.25f, 0.2f, 0.5f, 1f) - 1 -> floatArrayOf(0.365f, 0.06f, 0.62f, 0.07f, 0.25f, 0.2f, 0.5f, 1f) - 2 -> floatArrayOf(0.4f, 0.065f, 0.55f, 0.075f, 0.25f, 0.2f, 0.5f, 1f) - 3 -> floatArrayOf(0.4f, 0.065f, 0.55f, 0.075f, 0.25f, 0.2f, 0.5f, 0f) - 4 -> floatArrayOf(0.4f, 0.06f, 0.4f, 0.075f, 0.55f, 0.2f, 0.8f, 0f) + 0 -> floatArrayOf(0.33f, 0.07f, 0.7f, 0.06f, 0.25f, 0.2f, 0.5f, + 1f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f) + 1 -> floatArrayOf(0.365f, 0.06f, 0.62f, 0.07f, 0.25f, 0.2f, 0.5f, + 1f, 1.5f, 1.5f, 1.5f, 1.5f, 1.5f, 1.5f) + 2 -> floatArrayOf(0.4f, 0.065f, 0.55f, 0.075f, 0.25f, 0.2f, 0.5f, + 1f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f, 2.0f) + 3 -> floatArrayOf(0.4f, 0.065f, 0.55f, 0.075f, 0.25f, 0.2f, 0.5f, + 1f, 4.0f, 4.0f, 4.0f, 4.0f, 4.0f, 3.0f) + 4 -> floatArrayOf(0.4f, 0.06f, 0.4f, 0.075f, 0.55f, 0.2f, 0.8f, + 1f, 6.0f, 6.0f, 6.0f, 6.0f, 6.0f, 3.5f) - 5 -> floatArrayOf(0.33f, 0.08f, 0.8f, 0.12f, 0.55f, 0.2f, 1.0f, 0f) + 5 -> floatArrayOf(0.33f, 0.08f, 0.8f, 0.12f, 0.55f, 0.2f, 1.0f, + 0f) - else -> floatArrayOf(0.33f, 0.08f, 1.0f, 0.055f, 0.15f, 0.2f, 0.5f, 1f) + else -> floatArrayOf(0.33f, 0.08f, 1.0f, 0.055f, 0.15f, 0.2f, 0.5f, + 1f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f) } binding.config!!.bDamping = setData[0] @@ -372,7 +443,19 @@ interface ConfigUpdateListener: ConfigListener { binding.config!!.bPendulumRange = setData[4] binding.config!!.bAverage = setData[5] binding.config!!.bRootWeight = setData[6] - binding.config!!.bUseLimit = setData[7] + binding.config!!.bUseLimit = if (setData[7] == 0f) { + false + } + else { + binding.config!!.bLimitXx = setData[8] + binding.config!!.bLimitXy = setData[9] + binding.config!!.bLimitYx = setData[10] + binding.config!!.bLimitYy = setData[11] + binding.config!!.bLimitZx = setData[12] + binding.config!!.bLimitZy = setData[13] + true + } + binding.config!!.bUseArmCorrection = true checkConfigAndUpdateView() diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt index cd6914c..af45b52 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/models/GakumasConfig.kt @@ -25,7 +25,6 @@ data class GakumasConfig ( var lodQualityLevel: Int = 4, // 0~5 var enableBreastParam: Boolean = false, - var bUseLimit: Float = 1.0f, var bDamping: Float = 0.33f, var bStiffness: Float = 0.08f, var bSpring: Float = 1.0f, @@ -35,5 +34,12 @@ data class GakumasConfig ( var bRootWeight: Float = 0.5f, var bUseArmCorrection: Boolean = true, var bUseScale: Boolean = false, - var bScale: Float = 1.0f + var bScale: Float = 1.0f, + var bUseLimit: Boolean = true, + var bLimitXx: Float = 1.0f, + var bLimitXy: Float = 1.0f, + var bLimitYx: Float = 1.0f, + var bLimitYy: Float = 1.0f, + var bLimitZx: Float = 1.0f, + var bLimitZy: Float = 1.0f, ) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1c63996..a92b1cb 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -883,29 +883,6 @@ android:text="@={`` + config.bRootWeight}" /> - - - - - - - - @@ -975,6 +952,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index c903592..76a9cd1 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -37,4 +37,11 @@ IsDirty 应用缩放 胸部缩放倍率 + 启用范围限制倍率 + axisX.x + axisY.x + axisZ.x + axisX.y + axisY.y + axisZ.y \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9050b63..0de9161 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -37,5 +37,12 @@ IsDirty Use Breast Scale Breast Scale + Use Limit Multiplier + axisX.x + axisY.x + axisZ.x + axisX.y + axisY.y + axisZ.y \ No newline at end of file From 33848e6c530f214c2545b7eff4581dc12b102808 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Sun, 16 Jun 2024 23:40:54 +0800 Subject: [PATCH 3/7] update layout --- app/src/main/res/layout/activity_main.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index a92b1cb..fb5dd05 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -861,7 +861,7 @@ + android:weightSum="1"> Date: Mon, 17 Jun 2024 00:26:25 +0800 Subject: [PATCH 4/7] update submodule, update workflow --- .github/workflows/build.yml | 14 ++++++++++++++ app/src/main/assets/gakumas-local | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08e6671..bbdc750 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive + - name: set up android development environment uses: android-actions/setup-android@v2 @@ -18,6 +19,7 @@ jobs: run: | sdkmanager --install "cmake;3.22.1" echo "cmake.dir=/usr/local/lib/android/sdk/cmake/3.22.1" > local.properties + npm install -g pnpm - name: Setup Java JDK uses: actions/setup-java@v4.2.1 @@ -25,6 +27,18 @@ jobs: distribution: 'temurin' java-version: '21' + - name: Update Assets + run: | + git submodule foreach --recursive git pull origin main + git clone https://$ACCESS_TOKEN_GITHUB@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local + mv app/src/main/assets/gakumas-local/gakumas-raw-txts/Resource app/src/main/assets/gakumas-local/raw + rm -rf app/src/main/assets/gakumas-local/gakumas-raw-txts + + - name: Build Assets + run: | + mv app/src/main/assets/gakumas-local/GakumasPreTranslation/.env.sample app/src/main/assets/gakumas-local/GakumasPreTranslation/.env + cd app/src/main/assets/gakumas-local && make build-resource + - name: Write branch and commit info run: | branch=$(git rev-parse --abbrev-ref HEAD) diff --git a/app/src/main/assets/gakumas-local b/app/src/main/assets/gakumas-local index b736d15..56c568e 160000 --- a/app/src/main/assets/gakumas-local +++ b/app/src/main/assets/gakumas-local @@ -1 +1 @@ -Subproject commit b736d15d9c015b97c1dec5a679b41e62c8508e33 +Subproject commit 56c568e32a84ee1351f2efcc70971b7f23d85186 From 28e04841abac4076a50b77884fcaaa16261f25a9 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Mon, 17 Jun 2024 00:30:39 +0800 Subject: [PATCH 5/7] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbdc750..9e2a45a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - name: Update Assets run: | git submodule foreach --recursive git pull origin main - git clone https://$ACCESS_TOKEN_GITHUB@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local + git clone https://$ACCESS_TOKEN_GITHUB@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local/gakumas-raw-txts mv app/src/main/assets/gakumas-local/gakumas-raw-txts/Resource app/src/main/assets/gakumas-local/raw rm -rf app/src/main/assets/gakumas-local/gakumas-raw-txts From c1a12fba91845ec68faf3705c405022fb5a74327 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Mon, 17 Jun 2024 00:33:37 +0800 Subject: [PATCH 6/7] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e2a45a..7e50cfc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - name: Update Assets run: | git submodule foreach --recursive git pull origin main - git clone https://$ACCESS_TOKEN_GITHUB@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local/gakumas-raw-txts + git clone https://$GITHUB_TOKEN@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local/gakumas-raw-txts mv app/src/main/assets/gakumas-local/gakumas-raw-txts/Resource app/src/main/assets/gakumas-local/raw rm -rf app/src/main/assets/gakumas-local/gakumas-raw-txts From a2027667c469c09cb72cd6c1c34b73b95ed654e3 Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Mon, 17 Jun 2024 00:35:31 +0800 Subject: [PATCH 7/7] update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e50cfc..89f6156 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - name: Update Assets run: | git submodule foreach --recursive git pull origin main - git clone https://$GITHUB_TOKEN@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local/gakumas-raw-txts + git clone https://${{ secrets.ACCESS_TOKEN_GITHUB }}@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local/gakumas-raw-txts mv app/src/main/assets/gakumas-local/gakumas-raw-txts/Resource app/src/main/assets/gakumas-local/raw rm -rf app/src/main/assets/gakumas-local/gakumas-raw-txts