Skip to content

Commit 8357fea

Browse files
committed
debug screen
version fixes
1 parent 2d0593c commit 8357fea

File tree

7 files changed

+104
-38
lines changed

7 files changed

+104
-38
lines changed

adventure-composer/src/main/java/com/bladecoder/engineeditor/setup/BladeEngineSetup.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ public static boolean isSdkUpToDate (String sdkLocation) {
8181
// "You have a more recent version of android build tools than the recommended.\nDo you want to use this version?",
8282
// "Warning!", JOptionPane.YES_NO_OPTION);
8383

84-
int value = 0; // USE THE CURRENT BUILD TOOLS
85-
if (value != 0) {
86-
EditorLogger.error("Using build tools: " + Versions.getBuildToolsVersion());
87-
} else {
88-
// TODO use the current local version if available
89-
// buildToolsVersion = newestLocalTool;
84+
int value = 0; // ALWAYS USE THE CURRENT BUILD TOOLS
85+
if(value == 0) {
86+
Versions.setBuildToolsVersion(newestLocalTool);
9087
}
88+
89+
EditorLogger.error("Using build tools: " + Versions.getBuildToolsVersion());
9190
} else {
9291
if (!hasFileInDirectory(buildTools, Versions.getBuildToolsVersion())) {
9392
EditorLogger.error("Please update your Android SDK, you need build tools: "
@@ -102,14 +101,13 @@ public static boolean isSdkUpToDate (String sdkLocation) {
102101
// "You have a more recent version of android build tools than the recommended.\nDo you want to use this version?",
103102
// "Warning!", JOptionPane.YES_NO_OPTION);
104103

105-
int value = 0; // USE THE CURRENT API
104+
int value = 0; // ALWAYS USE THE CURRENT API
106105

107-
if (value != 0) {
108-
EditorLogger.error("Using API level: " + Versions.getAndroidAPILevel());
109-
} else {
110-
// TODO use current API if available
111-
// Versions.getAndroidAPILevel() = String.valueOf(newestLocalApi);
106+
if(value == 0) {
107+
Versions.setAndroidAPILevel(Integer.toString(newestLocalApi));
112108
}
109+
110+
EditorLogger.error("Using API level: " + Versions.getAndroidAPILevel());
113111
} else {
114112
if (!hasFileInDirectory(apis, "android-" + Versions.getAndroidAPILevel())) {
115113
EditorLogger.error("Please update your Android SDK, you need the Android API: "

adventure-composer/src/main/java/com/bladecoder/engineeditor/utils/Versions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,12 @@ public static String getAndroidAPILevel() {
6868
public static String getGwtVersion() {
6969
return getProperty(GWT_VERSION_PROP,null);
7070
}
71+
72+
public static void setBuildToolsVersion(String v) {
73+
config.setProperty(BUILDTOOLS_VERSION_PROP, v);
74+
}
75+
76+
public static void setAndroidAPILevel(String v) {
77+
config.setProperty(ANDROID_API_LEVEL_PROP, v);
78+
}
7179
}

adventure-composer/src/main/resources/projectTmpl/android/assets/ui/ui.json

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
com.badlogic.gdx.graphics.g2d.BitmapFont: {
33
default: {file: Roboto-Regular.ttf, size: 20},
44
debug: {file: Roboto-Regular.ttf, size: 15},
5-
big-font: {file: Roboto-Black.ttf, size: 40},
6-
title-font: {file: Roboto-Black.ttf, size: 70},
5+
big-font: {file: Roboto-Black.ttf, size: 35},
6+
title-font: {file: Roboto-Black.ttf, size: 60},
77
dialog-font: {file: ArchitectsDaughter_fix.ttf, size: 20},
88
text-manager-font: {file: ArchitectsDaughter_fix.ttf, size: 18},
99
desc: {file: Ubuntu-M.ttf, size: 16},
10-
credits_title: {file: Ubuntu-M.ttf, size: 20},
10+
credits-title: {file: Ubuntu-M.ttf, size: 20},
1111
credits: {file: Ubuntu-M.ttf, size: 30}
1212
},
1313
com.badlogic.gdx.graphics.Color: {
@@ -17,14 +17,15 @@ com.badlogic.gdx.graphics.Color: {
1717
black: { a: 1, b: 0, g: 0, r: 0 },
1818
dark-gray: { a: 1, b: 0.25, g: 0.25, r: 0.25 },
1919
light-gray: { a: 1, b: 0.75, g: 0.75, r: 0.75 },
20-
gray: { a: 1, b: 0.5, g: 0.5, r: 0.5 }
20+
gray: { a: 1, b: 0.5, g: 0.5, r: 0.5 },
21+
text-dark: { a: 1, b: 1, g: 1, r: 1 },
22+
text-light: { a: 1, b: 0.7, g: 0.7, r: 0.7 }
2123
},
2224
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
2325
black08: { name: white_pixel, color: { r: 0, g: 0, b: 0, a: 0.8 } },
24-
white: { name: white_pixel, color: { r: 1, g: 1, b: 1, a: 1 } }
25-
},
26-
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
27-
default: {},
26+
white: { name: white_pixel, color: { r: 1, g: 1, b: 1, a: 1 } },
27+
grey: { name: white_pixel, color: { r: 0.5, g: 0.5, b: 0.5, a: 1 } },
28+
dark-grey: { name: white_pixel, color: { r: 0.2, g: 0.2, b: 0.2, a: 1 } }
2829
},
2930
com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: {
3031
default: { },
@@ -34,7 +35,7 @@ com.bladecoder.engine.ui.InventoryUI$InventoryUIStyle: {
3435
default: {background: black08}
3536
},
3637
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
37-
default: { font: default, fontColor: white , downFontColor: gray, overFontColor: light-gray, disabledFontColor: dark-gray},
38+
default: { font: default, up: grey, fontColor: white , downFontColor: gray, overFontColor: light-gray, disabledFontColor: dark-gray},
3839
menu: { font: big-font, fontColor: white , downFontColor: gray, overFontColor: light-gray, disabledFontColor: dark-gray}
3940
},
4041
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
@@ -48,5 +49,20 @@ com.bladecoder.engine.ui.DialogUI$DialogUIStyle: {
4849

4950
com.bladecoder.engine.ui.TextManagerUI$TextManagerUIStyle: {
5051
default: {rectBackground: white, talkBackground: white, font: text-manager-font, talkBubble: bubblepointer}
51-
}
52+
},
53+
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
54+
default: { selection: grey, background: dark-grey, focusedBackground: dark-grey, disabledBackground: grey, font: default, fontColor: white, focusedFontColor: text-dark, disabledFontColor: text-dark, cursor: white, messageFont: default, messageFontColor: text-dark }
55+
},
56+
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
57+
default: {vScroll: dark-grey, hScrollKnob: dark-grey, background: grey, hScroll: dark-grey, vScrollKnob: dark-grey, corner: grey},
58+
opaque: { vScroll: dark-grey, hScrollKnob: dark-grey, background: grey, hScroll: dark-grey, vScrollKnob: dark-grey, corner: grey}
59+
},
60+
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
61+
default: { fontColorUnselected: text-dark, selection: grey, fontColorSelected: text-dark, font: default },
62+
opaque: { fontColorUnselected: text-dark, selection: grey, fontColorSelected: text-dark, font: default }
63+
},
64+
65+
com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
66+
default: { background: dark-grey, backgroundOver: dark-grey, backgroundOpen: dark-grey, listStyle: default, scrollStyle: opaque, font: default, fontColor: white },
67+
}
5268
}

adventure-composer/src/main/resources/versions.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
version=0.3.0-SNAPSHOT
1+
version=0.3.0
22
libgdxVersion=1.3.1
3-
libgdxNightlyVersion=1.3.2-SNAPSHOT
43
roboVMVersion=0.0.14
54
buildToolsVersion=20.0.0
65
androidAPILevel=20

blade-engine/src/com/bladecoder/engine/ui/BladeSkin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ else if(size != -1) // TODO set size in points (dpi independent)
9090
}
9191
}
9292

93+
font.setMarkupEnabled(true);
94+
9395
return font;
9496
}
9597
});

blade-engine/src/com/bladecoder/engine/ui/DebugScreen.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,15 @@ public void clicked(InputEvent event, float x, float y) {
117117

118118
Recorder r = ((SceneScreen) ui.getScreen(Screens.SCENE_SCREEN)).getRecorder();
119119
TextButton play = new TextButton(r.isPlaying() ? "Stop" : "Play", ui.getSkin());
120+
TextButton rec = new TextButton(r.isRecording() ? "Stop Rec" : "Rec", ui.getSkin());
120121
play.addListener(new ClickListener() {
121122

122123
public void clicked(InputEvent event, float x, float y) {
123124
SceneScreen scnScr = (SceneScreen) ui.getScreen(Screens.SCENE_SCREEN);
124125
Recorder r = scnScr.getRecorder();
125126

126127
if (!r.isPlaying()) {
127-
r.load("full");
128+
r.load(recordings.getSelected());
128129
r.setPlaying(true);
129130
ui.setCurrentScreen(Screens.SCENE_SCREEN);
130131
} else {
@@ -134,13 +135,55 @@ public void clicked(InputEvent event, float x, float y) {
134135
}
135136
});
136137

138+
rec.addListener(new ClickListener() {
139+
140+
public void clicked(InputEvent event, float x, float y) {
141+
SceneScreen scnScr = (SceneScreen) ui.getScreen(Screens.SCENE_SCREEN);
142+
Recorder r = scnScr.getRecorder();
143+
144+
if (r.isPlaying()) {
145+
r.setPlaying(false);
146+
}
147+
148+
r.setRecording(!r.isRecording());
149+
}
150+
});
151+
137152
recordings = new SelectBox<String>(ui.getSkin());
138-
recordings.setItems(EngineAssetManager.getInstance().listAssetFiles("/test"));
153+
recordings.setItems(EngineAssetManager.getInstance().listAssetFiles("/tests"));
139154

140155
table.row();
141156
table.add("Game Recording: ");
142157
table.add(recordings);
143158
table.add(play);
159+
table.add(rec);
160+
161+
// ------------- SCENES
162+
TextButton go = new TextButton("Go", ui.getSkin());
163+
go.addListener(new ClickListener() {
164+
165+
public void clicked(InputEvent event, float x, float y) {
166+
SceneScreen scnScr = (SceneScreen) ui.getScreen(Screens.SCENE_SCREEN);
167+
Recorder r = scnScr.getRecorder();
168+
169+
if (!r.isPlaying()) {
170+
r.load("full");
171+
r.setPlaying(true);
172+
ui.setCurrentScreen(Screens.SCENE_SCREEN);
173+
} else {
174+
r.setPlaying(false);
175+
ui.setCurrentScreen(Screens.MENU_SCREEN);
176+
}
177+
}
178+
});
179+
180+
recordings = new SelectBox<String>(ui.getSkin());
181+
recordings.setItems(EngineAssetManager.getInstance().listAssetFiles("/tests"));
182+
183+
table.row();
184+
table.add("Game Recording: ");
185+
table.add(recordings);
186+
table.add(play);
144187

145188
// ------------- BACK BUTTON
146189

blade-engine/src/com/bladecoder/engine/ui/MenuScreenTextButtons.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,9 @@ public void clicked(InputEvent event, float x, float y) {
147147

148148
table.row();
149149
table.add(credits);
150-
151-
TextButton quit = new TextButton("Quit Game", ui.getSkin(), "menu");
152-
quit.addListener(new ClickListener() {
153-
public void clicked(InputEvent event, float x, float y) {
154-
World.getInstance().dispose();
155-
Gdx.app.exit();
156-
}
157-
});
158-
159-
table.row();
160-
table.add(quit);
161150

162151
if(EngineLogger.debugMode()) {
163-
TextButton debug = new TextButton("Debug screen", ui.getSkin(), "menu");
152+
TextButton debug = new TextButton("[RED]Debug[]", ui.getSkin(), "menu");
164153
debug.addListener(new ClickListener() {
165154
public void clicked(InputEvent event, float x, float y) {
166155
ui.setCurrentScreen(new DebugScreen(ui));
@@ -171,6 +160,17 @@ public void clicked(InputEvent event, float x, float y) {
171160
table.add(debug);
172161
}
173162

163+
TextButton quit = new TextButton("Quit Game", ui.getSkin(), "menu");
164+
quit.addListener(new ClickListener() {
165+
public void clicked(InputEvent event, float x, float y) {
166+
World.getInstance().dispose();
167+
Gdx.app.exit();
168+
}
169+
});
170+
171+
table.row();
172+
table.add(quit);
173+
174174
table.pack();
175175

176176
stage.addActor(table);

0 commit comments

Comments
 (0)