This commit is contained in:
OMGeeky
2025-06-16 11:46:54 +02:00
parent b775be08fc
commit d6d742feac
2 changed files with 8 additions and 18 deletions

View File

@@ -21,7 +21,6 @@ import com.gpl.rpg.atcontentstudio.model.gamedata.Droplist;
import com.gpl.rpg.atcontentstudio.model.gamedata.Droplist.DroppedItem;
import com.gpl.rpg.atcontentstudio.model.gamedata.Item;
import com.gpl.rpg.atcontentstudio.ui.CollapsiblePanel;
import com.gpl.rpg.atcontentstudio.ui.DefaultIcons;
import com.gpl.rpg.atcontentstudio.ui.FieldUpdateListener;
import com.gpl.rpg.atcontentstudio.ui.tools.CommonEditor;
import com.jidesoft.swing.JideBoxLayout;
@@ -48,7 +47,6 @@ public class DroplistEditor extends JSONElementEditor {
addEditorTab(json_view_id, getJSONView());
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void insertFormViewDataField(JPanel pane) {
@@ -85,8 +83,8 @@ public class DroplistEditor extends JSONElementEditor {
}
public void updateDroppedItemsEditorPane(JPanel pane, DroppedItem di, FieldUpdateListener listener) {
boolean writable = ((Droplist)target).writable;
Project proj = ((Droplist)target).getProject();
boolean writable = target.writable;
Project proj = target.getProject();
pane.removeAll();
if (itemCombo != null) {
removeElementListener(itemCombo);
@@ -122,7 +120,7 @@ public class DroplistEditor extends JSONElementEditor {
private static final long serialVersionUID = 7987880146189575234L;
@Override
public Component getListCellRendererComponent(@SuppressWarnings("rawtypes") JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (c instanceof JLabel) {
JLabel label = ((JLabel)c);
@@ -161,7 +159,7 @@ public class DroplistEditor extends JSONElementEditor {
skipNext = false;
return;
}
if (target.id.equals((String) value)) return;
if (target.id.equals(value)) return;
if (idChanging()) {
droplist.id = (String) value;

View File

@@ -5,7 +5,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.ButtonGroup;
import javax.swing.DefaultListCellRenderer;
@@ -17,15 +16,8 @@ import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.gpl.rpg.atcontentstudio.ATContentStudio;
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
@@ -464,8 +456,8 @@ public class ItemEditor extends JSONElementEditor {
return;
}
boolean writable = ((Item)target).writable;
Project proj = ((Item)target).getProject();
boolean writable = target.writable;
Project proj = target.getProject();
hitSourceConditionBox = addActorConditionBox(pane, proj, "Actor Condition: ", condition.condition, writable, listener);
hitSourceConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);
@@ -560,8 +552,8 @@ public class ItemEditor extends JSONElementEditor {
return;
}
boolean writable = ((Item)target).writable;
Project proj = ((Item)target).getProject();
boolean writable = target.writable;
Project proj = target.getProject();
hitTargetConditionBox = addActorConditionBox(pane, proj, "Actor Condition: ", condition.condition, writable, listener);
hitTargetConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);