diff --git a/src/gui/UI_LenheartUI/DropControl.java b/src/gui/UI_LenheartUI/DropControl.java index 1945f27..f2c4b10 100644 --- a/src/gui/UI_LenheartUI/DropControl.java +++ b/src/gui/UI_LenheartUI/DropControl.java @@ -4,6 +4,7 @@ package gui.UI_LenheartUI; +import java.util.*; import gui.Start; import gui.tw.BlConfig; import gui.特殊控制台; @@ -29,6 +30,7 @@ public class DropControl extends JPanel { Start.blkg = this.toggleButton1.isSelected() ? 1 : 0; Start.bldj = this.toggleButton2.isSelected() ? 1 : 0; + Start.bskg = this.toggleButton3.isSelected() ? 1 : 0; List Buf = new ArrayList<>(); DefaultTableModel tableModel = (DefaultTableModel) table1.getModel(); @@ -50,6 +52,8 @@ public class DropControl extends JPanel { Buf.add(buffer); } Start.BLlist = Buf; + Start.bsConfig.setItem_id(Integer.valueOf(this.textField1.getText())); + Start.bsConfig.setRate(Integer.valueOf(this.textField2.getText())); 特殊控制台.setTwConfig(); } @@ -80,6 +84,12 @@ public class DropControl extends JPanel { button19 = new JButton(); button20 = new JButton(); button21 = new JButton(); + textField1 = new JTextField(); + textField2 = new JTextField(); + toggleButton3 = new JToggleButton(); + label3 = new JLabel(); + label4 = new JLabel(); + label5 = new JLabel(); //======== this ======== setLayout(null); @@ -151,6 +161,33 @@ public class DropControl extends JPanel { button21.addActionListener(e -> 删除配置(e)); add(button21); button21.setBounds(990, 570, 160, 35); + add(textField1); + textField1.setBounds(1220, 22, 150, textField1.getPreferredSize().height); + add(textField2); + textField2.setBounds(1220, 57, 150, textField2.getPreferredSize().height); + + //---- toggleButton3 ---- + toggleButton3.setIcon(new ImageIcon(getClass().getResource("/image/OFF3.png"))); + toggleButton3.setSelectedIcon(new ImageIcon(getClass().getResource("/image/ON3.png"))); + toggleButton3.setFocusPainted(false); + toggleButton3.setContentAreaFilled(false); + add(toggleButton3); + toggleButton3.setBounds(1150, 95, 100, 35); + + //---- label3 ---- + label3.setText("\u97ad\u5c38\u5f00\u5173"); + add(label3); + label3.setBounds(1255, 100, 185, 30); + + //---- label4 ---- + label4.setText("\u9053\u5177\u4ee3\u7801"); + add(label4); + label4.setBounds(1165, 20, 55, 30); + + //---- label5 ---- + label5.setText("\u97ad\u5c38\u51e0\u7387"); + add(label5); + label5.setBounds(1165, 55, 88, 30); { // compute preferred size @@ -171,6 +208,7 @@ public class DropControl extends JPanel { this.toggleButton1.setSelected(Start.blkg == 1 ? true : false); this.toggleButton2.setSelected(Start.bldj == 1 ? true : false); + this.toggleButton3.setSelected(Start.bskg == 1 ? true : false); DefaultTableModel tableModel = (DefaultTableModel)this.table1.getModel(); @@ -195,6 +233,11 @@ public class DropControl extends JPanel { Object[] rowData = {ItemId, GoldRate ,ItemRate,split[0],split[1], IsStack}; tableModel.addRow(rowData); }); + + int itemId = Start.bsConfig.getItem_id(); + int rate = Start.bsConfig.getRate(); + this.textField1.setText(String.valueOf(itemId)); + this.textField2.setText(String.valueOf(rate)); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @formatter:off @@ -207,5 +250,11 @@ public class DropControl extends JPanel { private JButton button19; private JButton button20; private JButton button21; + private JTextField textField1; + private JTextField textField2; + private JToggleButton toggleButton3; + private JLabel label3; + private JLabel label4; + private JLabel label5; // JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on } diff --git a/src/gui/UI_LenheartUI/DropControl.jfd b/src/gui/UI_LenheartUI/DropControl.jfd index 5906eee..ca54b2d 100644 --- a/src/gui/UI_LenheartUI/DropControl.jfd +++ b/src/gui/UI_LenheartUI/DropControl.jfd @@ -117,6 +117,59 @@ new FormModel { "x": 990 "y": 570 } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField1" + }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { + "x": 1220 + "y": 22 + "width": 150 + } ) + add( new FormComponent( "javax.swing.JTextField" ) { + name: "textField2" + }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { + "x": 1220 + "y": 57 + "width": 150 + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton3" + "icon": #SwingIcon0 + "selectedIcon": #SwingIcon1 + "focusPainted": false + "contentAreaFilled": false + }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { + "width": 100 + "height": 35 + "x": 1150 + "y": 95 + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "鞭尸开关" + }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { + "width": 185 + "height": 30 + "x": 1255 + "y": 100 + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "道具代码" + }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { + "x": 1165 + "y": 20 + "height": 30 + "width": 55 + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "text": "鞭尸几率" + }, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { + "width": 88 + "height": 30 + "x": 1165 + "y": 55 + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) "size": new java.awt.Dimension( 1585, 715 ) diff --git a/src/gui/UI_LenheartUI/ExplosiveControl.java b/src/gui/UI_LenheartUI/ExplosiveControl.java new file mode 100644 index 0000000..4ebd63f --- /dev/null +++ b/src/gui/UI_LenheartUI/ExplosiveControl.java @@ -0,0 +1,43 @@ +/* + * Created by JFormDesigner on Wed Mar 12 16:06:47 CST 2025 + */ + +package gui.UI_LenheartUI; + +import java.awt.*; +import javax.swing.*; + +/** + * @author dongj + */ +public class ExplosiveControl extends JPanel { + public ExplosiveControl() { + initComponents(); + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents @formatter:off + + //======== this ======== + setLayout(null); + + { + // compute preferred size + Dimension preferredSize = new Dimension(); + for(int i = 0; i < getComponentCount(); i++) { + Rectangle bounds = getComponent(i).getBounds(); + preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); + preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); + } + Insets insets = getInsets(); + preferredSize.width += insets.right; + preferredSize.height += insets.bottom; + setMinimumSize(preferredSize); + setPreferredSize(preferredSize); + } + // JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables @formatter:off + // JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on +} diff --git a/src/gui/UI_LenheartUI/ExplosiveControl.jfd b/src/gui/UI_LenheartUI/ExplosiveControl.jfd new file mode 100644 index 0000000..0491d8f --- /dev/null +++ b/src/gui/UI_LenheartUI/ExplosiveControl.jfd @@ -0,0 +1,13 @@ +JFDML JFormDesigner: "9.0.0.0.352" Java: "21.0.6" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class com.jformdesigner.runtime.NullLayout ) ) { + name: "this" + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 400, 300 ) + } ) + } +} diff --git a/src/gui/UI_LenheartUI/UI_LenheartUI.java b/src/gui/UI_LenheartUI/UI_LenheartUI.java index 868ba5f..b1ff55d 100644 --- a/src/gui/UI_LenheartUI/UI_LenheartUI.java +++ b/src/gui/UI_LenheartUI/UI_LenheartUI.java @@ -7,14 +7,17 @@ public class UI_LenheartUI { private JPanel 物品回收页面; private JPanel 伤害控制页面; private JPanel 爆率控制页面; + private JPanel 爆物管理页面; public UI_LenheartUI(JTabbedPane mainComponent) { 物品回收页面 = new ItemRecovery(); 伤害控制页面 = new DamageControl(); 爆率控制页面 = new DropControl(); + 爆物管理页面 = new ExplosiveControl(); mainComponent.addTab("物品回收设置", 物品回收页面); mainComponent.addTab("伤害控制设置", 伤害控制页面); - mainComponent.addTab("爆率控制设置", 爆率控制页面); + mainComponent.addTab("爆率 & 鞭尸控制设置", 爆率控制页面); + mainComponent.addTab("爆物管理设置", 爆物管理页面); } }