Compare commits

..

3 Commits

Author SHA1 Message Date
Lenheart 1a792cf446 no message 2025-05-27 21:43:57 +08:00
Lenheart bba9675add Merge branch 'master' of http://192.168.200.25:3000/Lenheart/MXD-Server 2025-05-27 21:37:57 +08:00
Lenheart 435dec6dca no message 2025-05-27 21:37:53 +08:00
2 changed files with 26 additions and 12 deletions

View File

@ -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);
}
}

View File

@ -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 ) {