From d5eab7f17ddc635d1d29fca7c19646056aa9c49e Mon Sep 17 00:00:00 2001 From: DelvalletQuentin Date: Fri, 13 Mar 2015 14:39:03 +0100 Subject: [PATCH 1/2] Bug fix Fixed inverted min/max values in the NPC parser. --- src/com/gpl/rpg/atcontentstudio/model/gamedata/NPC.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/model/gamedata/NPC.java b/src/com/gpl/rpg/atcontentstudio/model/gamedata/NPC.java index d75db0a..68e5744 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/gamedata/NPC.java +++ b/src/com/gpl/rpg/atcontentstudio/model/gamedata/NPC.java @@ -189,12 +189,12 @@ public class NPC extends JSONElement { if (hitEffect != null) { this.hit_effect = new HitEffect(); if (hitEffect.get("increaseCurrentHP") != null) { - this.hit_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentHP")).get("min"))); - this.hit_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentHP")).get("max"))); + this.hit_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentHP")).get("max"))); + this.hit_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentHP")).get("min"))); } if (hitEffect.get("increaseCurrentAP") != null) { - this.hit_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentAP")).get("min"))); - this.hit_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentAP")).get("max"))); + this.hit_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentAP")).get("max"))); + this.hit_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)hitEffect.get("increaseCurrentAP")).get("min"))); } List conditionsSourceJson = (List) hitEffect.get("conditionsSource"); if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) { From 0eee3c646b679b5bda12ab609b139c56f957f686 Mon Sep 17 00:00:00 2001 From: DelvalletQuentin Date: Fri, 13 Mar 2015 15:02:58 +0100 Subject: [PATCH 2/2] Fixed scrollers speed The scrollers in the sprite selector and the xml in map editors were slow, now it's fixed. Also withdrawned a useless semicolon. --- src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java | 9 ++++++--- .../rpg/atcontentstudio/ui/sprites/SpriteChooser.java | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java index d37724d..6ba5a5a 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java @@ -154,9 +154,11 @@ public class TMXMapEditor extends Editor { editorTabsHolder.setShowCloseButtonOnTab(false); add(editorTabsHolder, BorderLayout.CENTER); - JScrollPane tmxScroller = new JScrollPane(getTmxEditorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);; + JScrollPane tmxScroller = new JScrollPane(getTmxEditorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + JScrollPane xmlScroller = new JScrollPane(getXmlEditorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + xmlScroller.getVerticalScrollBar().setUnitIncrement(16); editorTabsHolder.add("TMX", tmxScroller); - editorTabsHolder.add("XML", new JScrollPane(getXmlEditorPane())); + editorTabsHolder.add("XML", xmlScroller); } @@ -559,6 +561,7 @@ public class TMXMapEditor extends Editor { editorPane.setEditable(false); editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML); pane.add(editorPane, JideBoxLayout.VARY); + return pane; } @@ -1061,7 +1064,7 @@ public class TMXMapEditor extends Editor { listeners.remove(l); } - public void fireListChanged() { + public void fireListChanged() { for (ListDataListener l : listeners) { l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, this.getSize())); } diff --git a/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpriteChooser.java b/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpriteChooser.java index 004689d..df3ac66 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpriteChooser.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/sprites/SpriteChooser.java @@ -168,6 +168,7 @@ public class SpriteChooser extends JDialog { JPanel wrapper = new JPanel(); wrapper.setLayout(new BorderLayout()); JScrollPane scroller = new JScrollPane(pane); + scroller.getVerticalScrollBar().setUnitIncrement(16); scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); wrapper.add(scroller, BorderLayout.CENTER); // wrapper.add(buttonPane, BorderLayout.SOUTH);