配置写入文件
This commit is contained in:
parent
92f4e04cd0
commit
7c14e8b8c6
|
|
@ -1048,7 +1048,8 @@ public class 特殊控制台 extends JFrame {
|
||||||
fileReader = new FileReader(property + "\\配置文件\\战力显示.ini");
|
fileReader = new FileReader(property + "\\配置文件\\战力显示.ini");
|
||||||
String result4 = fileReader.readString();
|
String result4 = fileReader.readString();
|
||||||
JSONObject jsonObject2 = JSONObject.parseObject(result4);
|
JSONObject jsonObject2 = JSONObject.parseObject(result4);
|
||||||
Start.zlConfigs = jsonObject2 .getJSONArray("zl").toJavaList(ZLConfig.class).stream().sorted(Comparator.comparing(ZLConfig::getNum)).collect(Collectors.toList());
|
JSONArray zl = jsonObject2.getJSONArray("zl");
|
||||||
|
Start.zlConfigs = zl .toJavaList(ZLConfig.class).stream().sorted(Comparator.comparing(ZLConfig::getNum)).collect(Collectors.toList());
|
||||||
|
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -1076,18 +1077,16 @@ public class 特殊控制台 extends JFrame {
|
||||||
jsonObject1.put("bskg", Start.bskg);
|
jsonObject1.put("bskg", Start.bskg);
|
||||||
jsonObject1.put("bsitem", Start.bsConfig);
|
jsonObject1.put("bsitem", Start.bsConfig);
|
||||||
String jsonString1 = jsonObject1.toJSONString();
|
String jsonString1 = jsonObject1.toJSONString();
|
||||||
fileWriter = new FileWriter(property + "\\配置文件\\多倍爆率.ini");
|
fileWriter = new FileWriter(new File(property + "\\配置文件\\多倍爆率.ini"));
|
||||||
fileWriter.write(jsonString1);
|
fileWriter.write(jsonString1);
|
||||||
|
|
||||||
|
|
||||||
JSONObject jsonObject2 = new JSONObject();
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
List<ZLConfig> sortedZlConfigs = Start.zlConfigs.stream()
|
|
||||||
.sorted(Comparator.comparing(ZLConfig::getNum))
|
jsonObject2.put("zl", Start.zlConfigs);
|
||||||
.collect(Collectors.toList());
|
|
||||||
jsonObject2.put("zl", new JSONArray(Collections.singletonList(sortedZlConfigs)));
|
|
||||||
String jsonString2 = jsonObject2.toJSONString();
|
String jsonString2 = jsonObject2.toJSONString();
|
||||||
|
|
||||||
fileWriter = new FileWriter(property + "\\配置文件\\战力显示.ini");
|
fileWriter = new FileWriter(new File(property + "\\配置文件\\战力显示.ini"));
|
||||||
fileWriter.write(jsonString2);
|
fileWriter.write(jsonString2);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue