配置写入文件
This commit is contained in:
parent
8583c01dc1
commit
86ce3af7c8
|
|
@ -1,6 +1,7 @@
|
|||
package gui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.PreparedStatement;
|
||||
|
|
@ -71,6 +72,7 @@ import javax.swing.JPanel;
|
|||
import javax.swing.JLabel;
|
||||
import java.lang.management.MemoryMXBean;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -1008,6 +1010,7 @@ public class 特殊控制台 extends JFrame {
|
|||
}
|
||||
|
||||
public static void initTWinfo(){
|
||||
try {
|
||||
String property = System.getProperty("user.dir");
|
||||
FileReader fileReader = new FileReader(property + "\\配置文件\\伤害控制.ini");
|
||||
String result = fileReader.readString();
|
||||
|
|
@ -1038,7 +1041,7 @@ public class 特殊控制台 extends JFrame {
|
|||
|
||||
Start.bskg = jsonObject1.getInteger("bskg");
|
||||
Start.bsConfig = jsonObject1.getObject("bsitem",BsConfig.class);
|
||||
try {
|
||||
|
||||
|
||||
|
||||
fileReader = new FileReader(property + "\\配置文件\\战力显示.ini");
|
||||
|
|
@ -1061,6 +1064,32 @@ public class 特殊控制台 extends JFrame {
|
|||
String jsonStr = JSONUtil.toJsonStr(Start.ConfigItemJson);
|
||||
FileWriter fileWriter2 = new FileWriter(new File(property + "\\配置文件\\物品回收.ini"));
|
||||
fileWriter2.write(jsonStr);
|
||||
|
||||
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
jsonObject1.put("open", Start.blkg);
|
||||
jsonObject1.put("stackable", Start.bldj);
|
||||
jsonObject1.put("gold_and_item_drop_rates", Start.BLlist);
|
||||
|
||||
jsonObject1.put("bskg", Start.bskg);
|
||||
jsonObject1.put("bsitem", Start.bsConfig);
|
||||
String jsonString1 = jsonObject1.toJSONString();
|
||||
fileWriter = new FileWriter(property + "\\配置文件\\多倍爆率.ini");
|
||||
fileWriter.write(jsonString1);
|
||||
|
||||
|
||||
JSONObject jsonObject2 = new JSONObject();
|
||||
List<ZLConfig> sortedZlConfigs = Start.zlConfigs.stream()
|
||||
.sorted(Comparator.comparing(ZLConfig::getNum))
|
||||
.collect(Collectors.toList());
|
||||
jsonObject2.put("zl", new JSONArray(Collections.singletonList(sortedZlConfigs)));
|
||||
String jsonString2 = jsonObject2.toJSONString();
|
||||
|
||||
fileWriter = new FileWriter(property + "\\配置文件\\战力显示.ini");
|
||||
fileWriter.write(jsonString2);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void 配置更新(final String name, final int value) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue