Skip to content

Commit

Permalink
debug screen
Browse files Browse the repository at this point in the history
version fixes
  • Loading branch information
bladecoder committed Oct 6, 2014
1 parent 2d0593c commit 8357fea
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,12 @@ public static boolean isSdkUpToDate (String sdkLocation) {
// "You have a more recent version of android build tools than the recommended.\nDo you want to use this version?",
// "Warning!", JOptionPane.YES_NO_OPTION);

int value = 0; // USE THE CURRENT BUILD TOOLS
if (value != 0) {
EditorLogger.error("Using build tools: " + Versions.getBuildToolsVersion());
} else {
// TODO use the current local version if available
// buildToolsVersion = newestLocalTool;
int value = 0; // ALWAYS USE THE CURRENT BUILD TOOLS
if(value == 0) {
Versions.setBuildToolsVersion(newestLocalTool);
}

EditorLogger.error("Using build tools: " + Versions.getBuildToolsVersion());
} else {
if (!hasFileInDirectory(buildTools, Versions.getBuildToolsVersion())) {
EditorLogger.error("Please update your Android SDK, you need build tools: "
Expand All @@ -102,14 +101,13 @@ public static boolean isSdkUpToDate (String sdkLocation) {
// "You have a more recent version of android build tools than the recommended.\nDo you want to use this version?",
// "Warning!", JOptionPane.YES_NO_OPTION);

int value = 0; // USE THE CURRENT API
int value = 0; // ALWAYS USE THE CURRENT API

if (value != 0) {
EditorLogger.error("Using API level: " + Versions.getAndroidAPILevel());
} else {
// TODO use current API if available
// Versions.getAndroidAPILevel() = String.valueOf(newestLocalApi);
if(value == 0) {
Versions.setAndroidAPILevel(Integer.toString(newestLocalApi));
}

EditorLogger.error("Using API level: " + Versions.getAndroidAPILevel());
} else {
if (!hasFileInDirectory(apis, "android-" + Versions.getAndroidAPILevel())) {
EditorLogger.error("Please update your Android SDK, you need the Android API: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ public static String getAndroidAPILevel() {
public static String getGwtVersion() {
return getProperty(GWT_VERSION_PROP,null);
}

public static void setBuildToolsVersion(String v) {
config.setProperty(BUILDTOOLS_VERSION_PROP, v);
}

public static void setAndroidAPILevel(String v) {
config.setProperty(ANDROID_API_LEVEL_PROP, v);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
com.badlogic.gdx.graphics.g2d.BitmapFont: {
default: {file: Roboto-Regular.ttf, size: 20},
debug: {file: Roboto-Regular.ttf, size: 15},
big-font: {file: Roboto-Black.ttf, size: 40},
title-font: {file: Roboto-Black.ttf, size: 70},
big-font: {file: Roboto-Black.ttf, size: 35},
title-font: {file: Roboto-Black.ttf, size: 60},
dialog-font: {file: ArchitectsDaughter_fix.ttf, size: 20},
text-manager-font: {file: ArchitectsDaughter_fix.ttf, size: 18},
desc: {file: Ubuntu-M.ttf, size: 16},
credits_title: {file: Ubuntu-M.ttf, size: 20},
credits-title: {file: Ubuntu-M.ttf, size: 20},
credits: {file: Ubuntu-M.ttf, size: 30}
},
com.badlogic.gdx.graphics.Color: {
Expand All @@ -17,14 +17,15 @@ com.badlogic.gdx.graphics.Color: {
black: { a: 1, b: 0, g: 0, r: 0 },
dark-gray: { a: 1, b: 0.25, g: 0.25, r: 0.25 },
light-gray: { a: 1, b: 0.75, g: 0.75, r: 0.75 },
gray: { a: 1, b: 0.5, g: 0.5, r: 0.5 }
gray: { a: 1, b: 0.5, g: 0.5, r: 0.5 },
text-dark: { a: 1, b: 1, g: 1, r: 1 },
text-light: { a: 1, b: 0.7, g: 0.7, r: 0.7 }
},
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
black08: { name: white_pixel, color: { r: 0, g: 0, b: 0, a: 0.8 } },
white: { name: white_pixel, color: { r: 1, g: 1, b: 1, a: 1 } }
},
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
default: {},
white: { name: white_pixel, color: { r: 1, g: 1, b: 1, a: 1 } },
grey: { name: white_pixel, color: { r: 0.5, g: 0.5, b: 0.5, a: 1 } },
dark-grey: { name: white_pixel, color: { r: 0.2, g: 0.2, b: 0.2, a: 1 } }
},
com.badlogic.gdx.scenes.scene2d.ui.ImageButton$ImageButtonStyle: {
default: { },
Expand All @@ -34,7 +35,7 @@ com.bladecoder.engine.ui.InventoryUI$InventoryUIStyle: {
default: {background: black08}
},
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
default: { font: default, fontColor: white , downFontColor: gray, overFontColor: light-gray, disabledFontColor: dark-gray},
default: { font: default, up: grey, fontColor: white , downFontColor: gray, overFontColor: light-gray, disabledFontColor: dark-gray},
menu: { font: big-font, fontColor: white , downFontColor: gray, overFontColor: light-gray, disabledFontColor: dark-gray}
},
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
Expand All @@ -48,5 +49,20 @@ com.bladecoder.engine.ui.DialogUI$DialogUIStyle: {

com.bladecoder.engine.ui.TextManagerUI$TextManagerUIStyle: {
default: {rectBackground: white, talkBackground: white, font: text-manager-font, talkBubble: bubblepointer}
}
},
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
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 }
},
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
default: {vScroll: dark-grey, hScrollKnob: dark-grey, background: grey, hScroll: dark-grey, vScrollKnob: dark-grey, corner: grey},
opaque: { vScroll: dark-grey, hScrollKnob: dark-grey, background: grey, hScroll: dark-grey, vScrollKnob: dark-grey, corner: grey}
},
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
default: { fontColorUnselected: text-dark, selection: grey, fontColorSelected: text-dark, font: default },
opaque: { fontColorUnselected: text-dark, selection: grey, fontColorSelected: text-dark, font: default }
},

com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
default: { background: dark-grey, backgroundOver: dark-grey, backgroundOpen: dark-grey, listStyle: default, scrollStyle: opaque, font: default, fontColor: white },
}
}
3 changes: 1 addition & 2 deletions adventure-composer/src/main/resources/versions.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version=0.3.0-SNAPSHOT
version=0.3.0
libgdxVersion=1.3.1
libgdxNightlyVersion=1.3.2-SNAPSHOT
roboVMVersion=0.0.14
buildToolsVersion=20.0.0
androidAPILevel=20
Expand Down
2 changes: 2 additions & 0 deletions blade-engine/src/com/bladecoder/engine/ui/BladeSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ else if(size != -1) // TODO set size in points (dpi independent)
}
}

font.setMarkupEnabled(true);

return font;
}
});
Expand Down
47 changes: 45 additions & 2 deletions blade-engine/src/com/bladecoder/engine/ui/DebugScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ public void clicked(InputEvent event, float x, float y) {

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

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

if (!r.isPlaying()) {
r.load("full");
r.load(recordings.getSelected());
r.setPlaying(true);
ui.setCurrentScreen(Screens.SCENE_SCREEN);
} else {
Expand All @@ -134,13 +135,55 @@ public void clicked(InputEvent event, float x, float y) {
}
});

rec.addListener(new ClickListener() {

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

if (r.isPlaying()) {
r.setPlaying(false);
}

r.setRecording(!r.isRecording());
}
});

recordings = new SelectBox<String>(ui.getSkin());
recordings.setItems(EngineAssetManager.getInstance().listAssetFiles("/test"));
recordings.setItems(EngineAssetManager.getInstance().listAssetFiles("/tests"));

table.row();
table.add("Game Recording: ");
table.add(recordings);
table.add(play);
table.add(rec);

// ------------- SCENES
TextButton go = new TextButton("Go", ui.getSkin());
go.addListener(new ClickListener() {

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

if (!r.isPlaying()) {
r.load("full");
r.setPlaying(true);
ui.setCurrentScreen(Screens.SCENE_SCREEN);
} else {
r.setPlaying(false);
ui.setCurrentScreen(Screens.MENU_SCREEN);
}
}
});

recordings = new SelectBox<String>(ui.getSkin());
recordings.setItems(EngineAssetManager.getInstance().listAssetFiles("/tests"));

table.row();
table.add("Game Recording: ");
table.add(recordings);
table.add(play);

// ------------- BACK BUTTON

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,9 @@ public void clicked(InputEvent event, float x, float y) {

table.row();
table.add(credits);

TextButton quit = new TextButton("Quit Game", ui.getSkin(), "menu");
quit.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
World.getInstance().dispose();
Gdx.app.exit();
}
});

table.row();
table.add(quit);

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

TextButton quit = new TextButton("Quit Game", ui.getSkin(), "menu");
quit.addListener(new ClickListener() {
public void clicked(InputEvent event, float x, float y) {
World.getInstance().dispose();
Gdx.app.exit();
}
});

table.row();
table.add(quit);

table.pack();

stage.addActor(table);
Expand Down

0 comments on commit 8357fea

Please sign in to comment.