File tree 2 files changed +29
-0
lines changed
src/main/java/net/cassite/hottapcassistant
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public static InputConfig ofSaved(String path) {
39
39
"Evade" ,
40
40
"Evade_Key" ,
41
41
"WeaponSkill" ,
42
+ "SkillAdditional" ,
42
43
"SwitchTarget" ,
43
44
"Interaction" ,
44
45
"Jump" ,
@@ -92,6 +93,33 @@ public static InputConfig ofSaved(String path) {
92
93
);
93
94
94
95
public List <KeyBinding > read () throws IOException {
96
+ var kbList = read0 ();
97
+ if (kbList .isEmpty ()) return kbList ;
98
+ if (kbList .stream ().anyMatch (kb -> kb .action .equals ("SkillAdditional" ))) {
99
+ return kbList ;
100
+ }
101
+ Path path = Path .of (this .path );
102
+ var lines = new ArrayList <>(Files .readAllLines (path ));
103
+ for (int i = 0 ; i < lines .size (); ++i ) {
104
+ var line = lines .get (i ).trim ();
105
+ if (!line .startsWith ("[" ) || !line .endsWith ("]" )) {
106
+ continue ;
107
+ }
108
+ line = line .substring (1 , line .length () - 1 ).trim ();
109
+ if (!line .equals ("/Script/Engine.InputSettings" )) {
110
+ continue ;
111
+ }
112
+ var newKb = new KeyBinding ();
113
+ newKb .action = "SkillAdditional" ;
114
+ newKb .key = new Key ("X" );
115
+ lines .add (i + 1 , newKb .toString ());
116
+ break ;
117
+ }
118
+ IOUtils .writeFile (path , String .join ("\n " , lines ));
119
+ return read0 ();
120
+ }
121
+
122
+ private List <KeyBinding > read0 () throws IOException {
95
123
var actions = new ArrayList <KeyBinding >();
96
124
var lines = Files .readAllLines (Path .of (path ));
97
125
for (int i = 0 ; i < lines .size (); i ++) {
Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ public String inputActionMapping(String action) {
232
232
case "UI_Weapon" -> "武器界面" ;
233
233
case "UI_Weapon_BreakFate" -> "命运突围-武器界面" ;
234
234
case "WeaponSkill" -> "武器技能" ;
235
+ case "SkillAdditional" -> "额外技能" ;
235
236
case "WeaponSkill_BreakFate" -> "命运突围-武器技能" ;
236
237
case "Vines" -> "攀爬" ;
237
238
case "LookUpRate" -> "视角[上]下" ;
You can’t perform that action at this time.
0 commit comments