From 20f84bdc6914a62febd337d3e983a06fea407af5 Mon Sep 17 00:00:00 2001 From: Jared Gould Date: Mon, 30 Oct 2006 20:40:09 +0000 Subject: [PATCH] Fixed CEL fix table inheritance not working properly git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@317 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d --- src/enginuity/maps/TableSwitch.java | 18 ++++++++++++++++++ src/enginuity/xml/DOMRomUnmarshaller.java | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/enginuity/maps/TableSwitch.java b/src/enginuity/maps/TableSwitch.java index bd91d710..25d7f3ea 100644 --- a/src/enginuity/maps/TableSwitch.java +++ b/src/enginuity/maps/TableSwitch.java @@ -78,6 +78,15 @@ public class TableSwitch extends Table { on[i] = (byte) RomAttributeParser.parseHexString(tokens.nextToken()); } } + + public String getOnValues() { + StringBuffer values = new StringBuffer(); + for (int i = 0; i < on.length; i++) { + values.append(on[i]); + if (i < on.length) values.append(" "); + } + return values+""; + } public void setOffValues(String input) { StringTokenizer tokens = new StringTokenizer(input); @@ -86,6 +95,15 @@ public class TableSwitch extends Table { } } + public String getOffValues() { + StringBuffer values = new StringBuffer(); + for (int i = 0; i < off.length; i++) { + values.append(off[i]); + if (i < off.length) values.append(" "); + } + return values+""; + } + public Dimension getFrameSize() { int height = verticalOverhead + 75; int width = horizontalOverhead; diff --git a/src/enginuity/xml/DOMRomUnmarshaller.java b/src/enginuity/xml/DOMRomUnmarshaller.java index 2fbf9e83..b081a669 100644 --- a/src/enginuity/xml/DOMRomUnmarshaller.java +++ b/src/enginuity/xml/DOMRomUnmarshaller.java @@ -445,10 +445,10 @@ public final class DOMRomUnmarshaller { } else if (n.getNodeName().equalsIgnoreCase("state")) { // set on/off values for switch type if (unmarshallAttribute(n, "name", "").equalsIgnoreCase("on")) { - ((TableSwitch) table).setOnValues(unmarshallAttribute(n, "data", "0")); + ((TableSwitch) table).setOnValues(unmarshallAttribute(n, "data", ((TableSwitch)table).getOnValues())); } else if (unmarshallAttribute(n, "name", "").equalsIgnoreCase("off")) { - ((TableSwitch) table).setOffValues(unmarshallAttribute(n, "data", "0")); + ((TableSwitch) table).setOffValues(unmarshallAttribute(n, "data", ((TableSwitch)table).getOffValues())); }