Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
feat: support for skill action 8 ~ 10
Browse files Browse the repository at this point in the history
  • Loading branch information
MalitsPlus committed Oct 10, 2023
1 parent da9acf8 commit 3a6fce5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ 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;
public int depend_action_4;
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;

Expand All @@ -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)));
Expand Down
9 changes: 9 additions & 0 deletions release_log.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 3a6fce5

Please sign in to comment.