From 1a792cf44694566c48c65a390d4854e4864ba05a Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Tue, 27 May 2025 21:43:57 +0800 Subject: [PATCH] no message --- src/gui/UI_LenheartUI/AutoScriptNpc.java | 24 +++++++++++++----------- src/gui/UI_LenheartUI/AutoScriptNpc.jfd | 14 +++++++++++++- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/gui/UI_LenheartUI/AutoScriptNpc.java b/src/gui/UI_LenheartUI/AutoScriptNpc.java index c9ab75e..71e9abb 100644 --- a/src/gui/UI_LenheartUI/AutoScriptNpc.java +++ b/src/gui/UI_LenheartUI/AutoScriptNpc.java @@ -25,7 +25,7 @@ public class AutoScriptNpc extends JPanel { private void 新增按钮(ActionEvent e) { DefaultTableModel tableModel = (DefaultTableModel)this.table1.getModel(); - Object[] rowData = {0, 0 ,0,0,0,0}; + Object[] rowData = {0, 0,0 ,0,0,0,0,0}; tableModel.addRow(rowData); } @@ -47,12 +47,14 @@ public class AutoScriptNpc extends JPanel { AotuNpc aotuNpc = new AotuNpc(); // 从表格中获取数据并设置到对象中 aotuNpc.setMapId(tableModel.getValueAt(i, 0).toString()); - aotuNpc.setNpcId(Integer.parseInt(tableModel.getValueAt(i, 1).toString())); - aotuNpc.setScriptsName(tableModel.getValueAt(i, 2).toString()); - aotuNpc.setItemId(Integer.parseInt(tableModel.getValueAt(i, 3).toString())); - aotuNpc.setItemNum(Integer.parseInt(tableModel.getValueAt(i, 4).toString())); - aotuNpc.setEquId(Integer.parseInt(tableModel.getValueAt(i, 5).toString())); - aotuNpc.setTime(Integer.parseInt(tableModel.getValueAt(i, 6).toString())); + aotuNpc.setNoMapId(tableModel.getValueAt(i, 1).toString()); + aotuNpc.setNpcId(Integer.parseInt(tableModel.getValueAt(i, 2).toString())); + aotuNpc.setScriptsName(tableModel.getValueAt(i, 3).toString()); + aotuNpc.setLv(Integer.parseInt(tableModel.getValueAt(i, 4).toString())); + aotuNpc.setItemId(Integer.parseInt(tableModel.getValueAt(i, 5).toString())); + aotuNpc.setItemNum(Integer.parseInt(tableModel.getValueAt(i, 6).toString())); + aotuNpc.setEquId(Integer.parseInt(tableModel.getValueAt(i, 7).toString())); + aotuNpc.setTime(Integer.parseInt(tableModel.getValueAt(i, 8).toString())); // 将对象添加到列表中 Start.aotuNpcs.add(aotuNpc); } @@ -76,11 +78,11 @@ public class AutoScriptNpc extends JPanel { //---- table1 ---- table1.setModel(new DefaultTableModel( new Object[][] { - {null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null}, + {null, null, null, null, null, null, null, null, null}, + {null, null, null, null, null, null, null, null, null}, }, new String[] { - "\u5730\u56feID", "NPC_ID", "\u811a\u672c\u540d\u5b57", "\u9053\u5177ID", "\u9053\u5177\u6570\u91cf", "\u88c5\u5907ID", "\u95f4\u9694\u65f6\u95f4" + "\u751f\u6548\u5730\u56fe", "\u7981\u7528\u5730\u56fe", "NPC_ID", "\u811a\u672c\u540d\u5b57", "\u73a9\u5bb6\u7b49\u7ea7", "\u9053\u5177ID", "\u9053\u5177\u6570\u91cf", "\u88c5\u5907ID", "\u95f4\u9694\u65f6\u95f4" } )); scrollPane1.setViewportView(table1); @@ -137,7 +139,7 @@ public class AutoScriptNpc extends JPanel { } for (AotuNpc aotuNpc : Start.aotuNpcs) { - Object[] rowData = {aotuNpc.getMapId(), aotuNpc.getNpcId() ,aotuNpc.getScriptsName(),aotuNpc.getItemId(),aotuNpc.getItemNum(),aotuNpc.getEquId(),aotuNpc.getTime()}; + Object[] rowData = {aotuNpc.getMapId(),aotuNpc.getNoMapId(), aotuNpc.getNpcId() ,aotuNpc.getScriptsName(),aotuNpc.getLv(),aotuNpc.getItemId(),aotuNpc.getItemNum(),aotuNpc.getEquId(),aotuNpc.getTime()}; tableModel.addRow(rowData); } } diff --git a/src/gui/UI_LenheartUI/AutoScriptNpc.jfd b/src/gui/UI_LenheartUI/AutoScriptNpc.jfd index 89324cb..109354c 100644 --- a/src/gui/UI_LenheartUI/AutoScriptNpc.jfd +++ b/src/gui/UI_LenheartUI/AutoScriptNpc.jfd @@ -18,6 +18,8 @@ new FormModel { add( null ) add( null ) add( null ) + add( null ) + add( null ) } ) add( new java.util.Vector { add( null ) @@ -27,11 +29,15 @@ new FormModel { add( null ) add( null ) add( null ) + add( null ) + add( null ) } ) }, new java.util.Vector { - add( "地图ID" ) + add( "生效地图" ) + add( "禁用地图" ) add( "NPC_ID" ) add( "脚本名字" ) + add( "玩家等级" ) add( "道具ID" ) add( "道具数量" ) add( "装备ID" ) @@ -44,6 +50,8 @@ new FormModel { add( null ) add( null ) add( null ) + add( null ) + add( null ) }, new java.util.Vector { add( null ) add( null ) @@ -52,6 +60,8 @@ new FormModel { add( null ) add( null ) add( null ) + add( null ) + add( null ) }, new java.util.Vector { add( null ) add( null ) @@ -60,6 +70,8 @@ new FormModel { add( null ) add( null ) add( null ) + add( null ) + add( null ) } ) } ) }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {