From 3a6fce5ecf8fa6967ec67d49347779afe2a50ad9 Mon Sep 17 00:00:00 2001 From: MalitsPlus <50281195+MalitsPlus@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:18:57 +0900 Subject: [PATCH] feat: support for skill action 8 ~ 10 --- app/build.gradle | 4 ++-- .../github/malitsplus/shizurunotes/db/DBHelper.kt | 12 ++++++++++++ .../malitsplus/shizurunotes/db/RawSkillData.java | 9 ++++++++- release_log.json | 9 +++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4b617bff..32090238 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "com.github.malitsplus.shizurunotes" minSdk 26 targetSdk 30 - versionCode 103 - versionName "1.24.0" + versionCode 104 + versionName "1.25.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } signingConfigs { diff --git a/app/src/main/java/com/github/malitsplus/shizurunotes/db/DBHelper.kt b/app/src/main/java/com/github/malitsplus/shizurunotes/db/DBHelper.kt index 03a699e3..88eb8a4d 100644 --- a/app/src/main/java/com/github/malitsplus/shizurunotes/db/DBHelper.kt +++ b/app/src/main/java/com/github/malitsplus/shizurunotes/db/DBHelper.kt @@ -1598,6 +1598,18 @@ class DBHelper private constructor( return result?.toInt() ?: 0 } + val hasAction10: Boolean + get() { + val result = getOne(""" + SELECT COUNT(*) + FROM sqlite_master + WHERE type='table' + AND name='skill_data' + AND sql like '%action_10%';""" + ) + return result == "1" + } + /*** * 随机生成16位随机英数字符串 * @return diff --git a/app/src/main/java/com/github/malitsplus/shizurunotes/db/RawSkillData.java b/app/src/main/java/com/github/malitsplus/shizurunotes/db/RawSkillData.java index 8d1b92b2..68fe1664 100644 --- a/app/src/main/java/com/github/malitsplus/shizurunotes/db/RawSkillData.java +++ b/app/src/main/java/com/github/malitsplus/shizurunotes/db/RawSkillData.java @@ -17,6 +17,9 @@ public class RawSkillData { public int action_5; public int action_6; public int action_7; + public int action_8; + public int action_9; + public int action_10; public int depend_action_1; public int depend_action_2; public int depend_action_3; @@ -24,6 +27,9 @@ public class RawSkillData { public int depend_action_5; public int depend_action_6; public int depend_action_7; + public int depend_action_8; + public int depend_action_9; + public int depend_action_10; public String description; public int icon_type; @@ -37,7 +43,8 @@ public void setSkillData(Skill skill){ description, icon_type ); - for(int i = 1; i <= 7; i++){ + int iteration = DBHelper.get().getHasAction10() ? 10 : 7; + for(int i = 1; i <= iteration; i++){ int action = (int)Utils.getValueFromObject(this, "action_" + i); if(action != 0) { skill.getActions().add(skill.new Action(action, (int) Utils.getValueFromObject(this, "depend_action_" + i))); diff --git a/release_log.json b/release_log.json index 88824486..0891d79b 100644 --- a/release_log.json +++ b/release_log.json @@ -1,4 +1,13 @@ [ + { + "versionCode": "104", + "versionName": "1.25.0", + "recommend": "false", + "messageJa": "- Skill Action 8 ~ 10 へのサポート", + "messageZh": "- 追加对 Skill Action 8 ~ 10 的支持", + "infoJa": "", + "infoZh": "" + }, { "versionCode": "103", "versionName": "1.24.0",