diff --git a/forge-gui-mobile/src/forge/adventure/util/UIActor.java b/forge-gui-mobile/src/forge/adventure/util/UIActor.java index 40e314098a6..31aa69cf44a 100644 --- a/forge-gui-mobile/src/forge/adventure/util/UIActor.java +++ b/forge-gui-mobile/src/forge/adventure/util/UIActor.java @@ -9,6 +9,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.ImageButton; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; +import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.ui.TextField; import com.badlogic.gdx.scenes.scene2d.ui.Window; @@ -50,6 +51,10 @@ public class UIActor extends Group { newActor = new Label("", Controls.GetSkin()); readLabelProperties((Label) newActor, new OrderedMap.OrderedMapEntries<>(element)); break; + case "Table": + newActor = new Table(Controls.GetSkin()); + readTableProperties((Table) newActor, new OrderedMap.OrderedMapEntries<>(element)); + break; case "Image": newActor = new Image(); readImageProperties((Image) newActor, new OrderedMap.OrderedMapEntries<>(element)); @@ -161,6 +166,16 @@ public class UIActor extends Group { } } + private void readTableProperties(Table newActor, ObjectMap.Entries entries) { + for (ObjectMap.Entry property : entries) { + switch (property.key.toString()) { + case "font": + newActor.getSkin().get(Label.LabelStyle.class).font = Controls.GetSkin().getFont(property.value.toString()); + break; + } + } + } + private void readSelectorProperties(Selector newActor, ObjectMap.Entries entries) { } diff --git a/forge-gui/res/adventure/Shandalar/ui/save_load.json b/forge-gui/res/adventure/Shandalar/ui/save_load.json index cb856c72996..a89b02dd8e7 100644 --- a/forge-gui/res/adventure/Shandalar/ui/save_load.json +++ b/forge-gui/res/adventure/Shandalar/ui/save_load.json @@ -1,51 +1,51 @@ { - "width": 480, - "height": 270, - "yDown": true, - "elements":[ + "width": 480, + "height": 270, + "yDown": true, + "elements": [ { - "type" : "Image", - "image":"ui/title_bg.png", + "type": "Image", + "image": "ui/title_bg.png", "width": 480, "height": 270 - } , - + }, { - "type" : "Image", + "type": "Image", "name": "preview", - "x": 364, - "y": 10 , + "x": 364, + "y": 10, "width": 96, "height": 54 - } , - + }, { - "type" : "Scroll", + "type": "Scroll", "name": "saveSlots", - "x": 10, - "y": 10 , + "x": 10, + "y": 10, "width": 344, "height": 235 - } , + }, { - "type" : "TextButton", - "name" : "return" , - "text" : "Back" , - "width": 48, - "height": 16, - "x": 15, - "y": 250 - } , + "type": "TextButton", + "name": "return", + "text": "Back", + "width": 48, + "height": 16, + "x": 15, + "y": 250 + }, { - "type" : "TextButton", - "name" : "save" , - "text" : "saveLoad" , - "width": 48, - "height": 16, - "x": 115, - "y": 250 - } - ] - - + "type": "TextButton", + "name": "save", + "text": "saveLoad", + "width": 48, + "height": 16, + "x": 115, + "y": 250 + }, + { + "type": "Table", + "font": "default" + } + ] } \ No newline at end of file diff --git a/forge-gui/res/adventure/Shandalar/ui/statistic.json b/forge-gui/res/adventure/Shandalar/ui/statistic.json index 2de78c04541..729111c988d 100644 --- a/forge-gui/res/adventure/Shandalar/ui/statistic.json +++ b/forge-gui/res/adventure/Shandalar/ui/statistic.json @@ -2,96 +2,103 @@ "width": 480, "height": 270, "yDown": true, - "elements":[ + "elements": [ { - "type" : "Image", - "image":"ui/title_bg.png", + "type": "Image", + "image": "ui/title_bg.png", "width": 480, "height": 270 - } , - + }, { - "type" : "Scroll", + "type": "Scroll", "name": "enemies", "x": 206, - "y": 10 , + "y": 10, "width": 256, "height": 235 - } , + }, { - "type" : "Image", + "type": "Image", "name": "avatar", "x": 10, - "y": 10 , + "y": 10, "width": 64, "height": 64 - } , + }, { - "type" : "Label", + "type": "Label", "name": "totalWins", "x": 90, - "y": 84 , + "y": 84, "width": 80, - "height": 24 - } , + "height": 24, + "font": "default" + }, { - "type" : "Label", + "type": "Label", "text": "Win:", "x": 10, - "y": 84 , + "y": 84, "width": 80, - "height": 24 - } , + "height": 24, + "font": "default" + }, { - "type" : "Label", + "type": "Label", "name": "totalLoss", "x": 90, - "y": 104 , + "y": 104, "width": 80, - "height": 24 - } , + "height": 24, + "font": "default" + }, { - "type" : "Label", + "type": "Label", "text": "Loss:", "x": 10, - "y": 104 , + "y": 104, "width": 80, - "height": 24 - } , + "height": 24, + "font": "default" + }, { - "type" : "Label", + "type": "Label", "name": "lossWinRatio", "x": 90, - "y": 124 , + "y": 124, "width": 80, - "height": 24 - } , + "height": 24, + "font": "default" + }, { - "type" : "Label", + "type": "Label", "text": "Win Loss Ratio:", "x": 10, - "y": 124 , + "y": 124, "width": 80, - "height": 24 - } , + "height": 24, + "font": "default" + }, { - "type" : "Image", - "image" : "ui/avatarhud.png" , + "type": "Image", + "image": "ui/avatarhud.png", "x": 10, - "y": 10 , + "y": 10, "width": 64, "height": 64 - } , + }, { - "type" : "TextButton", - "name" : "return" , - "text" : "Back" , + "type": "TextButton", + "name": "return", + "text": "Back", "width": 48, "height": 16, "x": 15, "y": 250 + }, + { + "type": "Table", + "font": "default" } ] - - } \ No newline at end of file