remove a bunch of unused assignments

This commit is contained in:
OMGeeky
2025-06-21 18:19:25 +02:00
parent a4b431efdd
commit bb187621b7
28 changed files with 55 additions and 67 deletions

View File

@@ -919,8 +919,8 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
private static final long serialVersionUID = 6819681566800482793L;
private boolean includeType = false;
private boolean writable = false;
private boolean includeType;
private boolean writable;
public GDERenderer(boolean includeType, boolean writable) {
super();

View File

@@ -293,8 +293,8 @@ public class JSONImportWizard extends JDialog {
errors.add("Invalid JSON content: neither an array nor an object.");
}
if (jsonObjects != null) {
JSONElement node = null;
JSONElement existingNode = null;
JSONElement node;
JSONElement existingNode;
int i = 0;
for (Map jsonObject : jsonObjects) {
switch ((DataType)dataTypeCombo.getSelectedItem()) {
@@ -342,10 +342,8 @@ public class JSONImportWizard extends JDialog {
node.jsonFile = existingNode.jsonFile;
warnings.add("An item with id "+node.id+" exists in the used game source. This one will be inserted as \"altered\"");
}
existingNode = null;
}
node = null;
} else {
}
} else {
warnings.add("Failed to load element #"+i);
}
}
@@ -508,7 +506,7 @@ public class JSONImportWizard extends JDialog {
private static final long serialVersionUID = 6819681566800482793L;
private boolean includeType = false;
private boolean includeType;
public GDERenderer(boolean includeType) {
super();

View File

@@ -234,10 +234,8 @@ public class ProjectCreationWizard extends JDialog {
buttonPane.setLayout(new GridBagLayout());
GridBagConstraints c2 = new GridBagConstraints();
c2.fill = GridBagConstraints.HORIZONTAL;
c2.gridx = 1;
c2.weightx = 80;
c2.gridx = 1;
c2.gridx = 1;
c2.weightx = 80;
buttonPane.add(new JLabel(), c2);

View File

@@ -685,7 +685,7 @@ public class ProjectsTree extends JPanel {
JLabel label = (JLabel)c;
String text = ((ProjectTreeNode)value).getDesc();
if (text != null) label.setText(text);
Image img = null;
Image img;
if (leaf) img = ((ProjectTreeNode)value).getLeafIcon();
else if (expanded) img = ((ProjectTreeNode)value).getOpenIcon();
else img = ((ProjectTreeNode)value).getClosedIcon();

View File

@@ -171,7 +171,7 @@ public class WorkspaceActions {
@Override
public void run() {
final List<SaveEvent> events = new ArrayList<SaveEvent>();
List<SaveEvent> catEvents = null;
List<SaveEvent> catEvents;
for (GameDataCategory<JSONElement> category : impactedCategories.keySet()) {
for (File f : impactedCategories.get(category)) {
catEvents = category.attemptSave(true, f.getName());

View File

@@ -32,7 +32,7 @@ public class WorldmapLabelEditionWizard extends JDialog {
final WorldmapSegment segment;
final WorldmapSegment.NamedArea label;
boolean createMode = false;
boolean createMode;
public WorldmapLabelEditionWizard(WorldmapSegment segment) {
this(segment, new WorldmapSegment.NamedArea(null, null, null), true);

View File

@@ -972,7 +972,7 @@ public class DialogueEditor extends JSONElementEditor {
} else if (source == rewardValue) {
//Backlink removal to quest stages when selecting another quest are handled in the addQuestStageBox() method. Too complex too handle here
Quest quest = null;
QuestStage stage = null;
QuestStage stage;
if (rewardValue instanceof JComboBox<?>) {
quest = ((Quest)selectedReward.reward_obj);
if (quest != null && selectedReward.reward_value != null) {
@@ -1048,7 +1048,7 @@ public class DialogueEditor extends JSONElementEditor {
} else if (source == requirementValue) {
//Backlink removal to quest stages when selecting another quest are handled in the addQuestStageBox() method. Too complex too handle here
Quest quest = null;
QuestStage stage = null;
QuestStage stage;
if (requirementValue instanceof JComboBox<?>) {
quest = ((Quest)selectedRequirement.required_obj);
if (quest != null && selectedRequirement.required_value != null) {

View File

@@ -1429,10 +1429,8 @@ public class ItemEditor extends JSONElementEditor {
ItemEditor.this.repaint();
} else if (item.category.action_type == ItemCategory.ActionType.equip) {
equipEffectPane.setVisible(true);
updateEquip = true;
hitEffectPane.setVisible(true);
updateEquip = true;
killEffectPane.setVisible(true);
hitEffectPane.setVisible(true);
killEffectPane.setVisible(true);
updateKill = true;
hitReceivedEffectPane.setVisible(true);
updateEquip = true;

View File

@@ -14,7 +14,7 @@ public class MapColorFilters {
Composite oldComp = g2d.getComposite();
Rectangle clip = g2d.getClipBounds();
MatrixComposite newComp = null;
float f=0.0f;
float f;
switch(colorFilter) {
case black20:
f=0.8f;

View File

@@ -1173,7 +1173,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
public class ReplacementsLayersComboModel implements ComboBoxModel<String> {
ReplaceArea area;
boolean modelForSource = false;
boolean modelForSource;
public List<String> availableLayers = new ArrayList<String>();
@@ -1542,7 +1542,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
private static final long serialVersionUID = 6819681566800482793L;
private boolean includeType = false;
private boolean includeType;
public SpritesheetCellRenderer(boolean includeType) {
super();
@@ -2032,7 +2032,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
if (selectedMapObject instanceof KeyArea) {
KeyArea area = (KeyArea) selectedMapObject;
Quest quest = null;
QuestStage stage = null;
QuestStage stage;
if (requirementValue instanceof JComboBox<?>) {
quest = ((Quest)area.requirement.required_obj);
if (quest != null && area.requirement.required_value != null) {
@@ -2053,7 +2053,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
} else if (selectedMapObject instanceof ReplaceArea) {
ReplaceArea area = (ReplaceArea) selectedMapObject;
Quest quest = null;
QuestStage stage = null;
QuestStage stage;
if (requirementValue instanceof JComboBox<?>) {
quest = ((Quest)area.requirement.required_obj);
if (quest != null && area.requirement.required_value != null) {

View File

@@ -386,7 +386,7 @@ public class SpritesheetEditor extends Editor {
private static final long serialVersionUID = 6819681566800482793L;
private boolean includeType = false;
private boolean includeType;
public BacklinkCellRenderer(boolean includeType) {
super();

View File

@@ -93,7 +93,7 @@ public class WriterModeEditor extends Editor {
private Display view;
final private WriterModeData data;
private WriterNode selected = null;
private WriterNode selected;
private WriterNode prevSelected = null;
public WriterModeEditor(WriterModeData data) {
@@ -708,8 +708,8 @@ public class WriterModeEditor extends Editor {
public void actionPerformed(ActionEvent e) {
commitAreaText();
stopPendingEdge();
WriterDialogue newWrNode = null;
Node newNode = null;
WriterDialogue newWrNode;
Node newNode;
if (selected instanceof WriterDialogue) {
EmptyReply temp = data.new EmptyReply((WriterDialogue) selected);
newWrNode = data.new WriterDialogue(((WriterDialogue) selected).id_prefix);
@@ -737,8 +737,8 @@ public class WriterModeEditor extends Editor {
public void actionPerformed(ActionEvent e) {
commitAreaText();
stopPendingEdge();
WriterReply newWrNode = null;
Node newNode = null;
WriterReply newWrNode;
Node newNode;
if (selected instanceof WriterReply) {
newWrNode = data.new WriterReply(((WriterReply) selected).parent);
newNode = addReplyNode(newWrNode);