Update schema with the last modifications of gui_rw_test2 commit
This commit is contained in:
parent
c1f70b1eb0
commit
329bec23ed
@ -8,8 +8,10 @@ public class NBTWriter {
|
|||||||
{
|
{
|
||||||
NBTOutput out = new NBTOutput();
|
NBTOutput out = new NBTOutput();
|
||||||
|
|
||||||
out.put(NBTTags.IsInGame.value(), scr.IsInGame);
|
if (scr.IsPanorama != null)
|
||||||
out.put(NBTTags.IsPanorama.value(), scr.IsPanorama);
|
out.put(NBTTags.IsPanorama.value(), scr.IsPanorama);
|
||||||
|
if (scr.Background != null)
|
||||||
|
out.put(NBTTags.Background.value(), scr.Background);
|
||||||
|
|
||||||
if (!scr.Children.isEmpty())
|
if (!scr.Children.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -38,16 +38,18 @@ public class XMLReader {
|
|||||||
|
|
||||||
Node scrXml = nodes.item(0);
|
Node scrXml = nodes.item(0);
|
||||||
|
|
||||||
Node panorama = scrXml.getAttributes().getNamedItem("panorama");
|
|
||||||
if (panorama == null)
|
|
||||||
return null;
|
|
||||||
Node ingame = scrXml.getAttributes().getNamedItem("ingame");
|
|
||||||
if (ingame == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
Screen scr = new Screen();
|
Screen scr = new Screen();
|
||||||
scr.IsInGame = Boolean.parseBoolean(ingame.getNodeValue());
|
|
||||||
scr.IsPanorama = Boolean.parseBoolean(panorama.getNodeValue());
|
NamedNodeMap attrs = scrXml.getAttributes();
|
||||||
|
for (int i = 0; i < attrs.getLength(); i++)
|
||||||
|
{
|
||||||
|
Node attr = attrs.item(i);
|
||||||
|
switch (attr.getNodeName())
|
||||||
|
{
|
||||||
|
case "panorama" -> scr.IsPanorama = Boolean.parseBoolean(attr.getNodeValue());
|
||||||
|
case "background" -> scr.Background = Integer.parseInt(attr.getNodeValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NodeList children = scrXml.getChildNodes();
|
NodeList children = scrXml.getChildNodes();
|
||||||
int childrenlen = children.getLength();
|
int childrenlen = children.getLength();
|
||||||
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Screen {
|
public class Screen {
|
||||||
public boolean IsPanorama = false;
|
public Boolean IsPanorama = null;
|
||||||
public boolean IsInGame = false;
|
public Integer Background = null;
|
||||||
public List<BaseGui> Children = new ArrayList<>();
|
public List<BaseGui> Children = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,9 @@ public enum NBTTags {
|
|||||||
AnchorX,
|
AnchorX,
|
||||||
AnchorY,
|
AnchorY,
|
||||||
// Screen tags
|
// Screen tags
|
||||||
IsInGame,
|
|
||||||
IsPanorama,
|
IsPanorama,
|
||||||
Childs,
|
Childs,
|
||||||
|
Background,
|
||||||
// Label tags
|
// Label tags
|
||||||
Rotation,
|
Rotation,
|
||||||
Scale,
|
Scale,
|
||||||
@ -36,6 +36,7 @@ public enum NBTTags {
|
|||||||
DrawRight,
|
DrawRight,
|
||||||
DrawTop,
|
DrawTop,
|
||||||
DrawBottom;
|
DrawBottom;
|
||||||
|
// end of Version 1 tags
|
||||||
|
|
||||||
public String value()
|
public String value()
|
||||||
{
|
{
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute name="panorama" type="xs:boolean" default="false" />
|
<xs:attribute name="panorama" type="xs:boolean" default="false" />
|
||||||
<xs:attribute name="ingame" type="xs:boolean" default="false" />
|
<xs:attribute name="background" type="xs:integer" />
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
Loading…
x
Reference in New Issue
Block a user