diff --git a/core/src/zero1hd/polyjet/Polyjet.java b/core/src/zero1hd/polyjet/Polyjet.java index a85bfce..78e042c 100755 --- a/core/src/zero1hd/polyjet/Polyjet.java +++ b/core/src/zero1hd/polyjet/Polyjet.java @@ -41,9 +41,8 @@ public class Polyjet extends Game { public static final int GAME_AREA_HEIGHT = 48; public static final String VERSION = "(0.1)R1-PreAlpha"; - public AssetManager assetManager = new AssetManager(); - public Skin defaultSkin = new Skin(); - public TextureAtlas buttons; + private AssetManager assetManager = new AssetManager(); + private Skin defaultSkin = new Skin(); public FreeTypeFontGenerator default_fontGenerator; public FreeTypeFontGenerator darktech_ldr_fontGenerator; TextureAtlas skinAtlas; @@ -98,7 +97,7 @@ public class Polyjet extends Game { public void dispose() { if (skinAtlas != null) { skinAtlas.dispose(); - defaultSkin.dispose(); + getDefaultSkin().dispose(); default_fontGenerator.dispose(); darktech_ldr_fontGenerator.dispose(); assetManager.dispose(); @@ -123,37 +122,38 @@ public class Polyjet extends Game { public void generateFonts() { initComplete = true; defaultSkin = new Skin(); + Gdx.app.debug("Prelaunch Debug Info", "Generating fonts..."); skinAtlas = assetManager.get("uiskin.atlas", TextureAtlas.class); - defaultSkin.addRegions(skinAtlas); + getDefaultSkin().addRegions(skinAtlas); - defaultSkin.add("window-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { + getDefaultSkin().add("window-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { { size = 18; } })); - defaultSkin.add("sub-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { + getDefaultSkin().add("sub-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { { size = fontScale(0.04f); } })); - defaultSkin.add("default-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { + getDefaultSkin().add("default-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { { size = fontScale(0.07f); } })); - defaultSkin.add("large-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { + getDefaultSkin().add("large-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() { { size = fontScale(0.085f); } })); - defaultSkin.add("special-font", darktech_ldr_fontGenerator.generateFont(new FreeTypeFontParameter() { + getDefaultSkin().add("special-font", darktech_ldr_fontGenerator.generateFont(new FreeTypeFontParameter() { { size = fontScale(0.075f); } @@ -162,68 +162,68 @@ public class Polyjet extends Game { } public void defineSkinStyles() { - defaultSkin.add("default", Color.BLACK); - defaultSkin.add("inverse", Color.WHITE); + getDefaultSkin().add("default", Color.BLACK); + getDefaultSkin().add("inverse", Color.WHITE); TextButtonStyle defaultTextButton = new TextButtonStyle(); - defaultTextButton.up = defaultSkin.getDrawable("default-round"); - defaultTextButton.down = defaultSkin.getDrawable("default-round-down"); - defaultTextButton.font = defaultSkin.getFont("default-font"); - defaultTextButton.fontColor = defaultSkin.getColor("default"); - defaultTextButton.disabled = defaultSkin.getDrawable("default-round-disabled"); - defaultSkin.add("default", defaultTextButton); + defaultTextButton.up = getDefaultSkin().getDrawable("default-round"); + defaultTextButton.down = getDefaultSkin().getDrawable("default-round-down"); + defaultTextButton.font = getDefaultSkin().getFont("default-font"); + defaultTextButton.fontColor = getDefaultSkin().getColor("default"); + defaultTextButton.disabled = getDefaultSkin().getDrawable("default-round-disabled"); + getDefaultSkin().add("default", defaultTextButton); TextButtonStyle subTextbutton = new TextButtonStyle(defaultTextButton); - subTextbutton.font = defaultSkin.getFont("sub-font"); - defaultSkin.add("sub", subTextbutton); + subTextbutton.font = getDefaultSkin().getFont("sub-font"); + getDefaultSkin().add("sub", subTextbutton); TextButtonStyle textButtonLeft = new TextButtonStyle(); - textButtonLeft.up = defaultSkin.getDrawable("left-button"); - textButtonLeft.down = defaultSkin.getDrawable("left-button-down"); - textButtonLeft.font = defaultSkin.getFont("default-font"); - textButtonLeft.fontColor = defaultSkin.getColor("default"); - defaultSkin.add("left", textButtonLeft); + textButtonLeft.up = getDefaultSkin().getDrawable("left-button"); + textButtonLeft.down = getDefaultSkin().getDrawable("left-button-down"); + textButtonLeft.font = getDefaultSkin().getFont("default-font"); + textButtonLeft.fontColor = getDefaultSkin().getColor("default"); + getDefaultSkin().add("left", textButtonLeft); - SliderStyle defaultSlider = new SliderStyle(defaultSkin.getDrawable("default-slider"), defaultSkin.getDrawable("default-slider-knob")); - defaultSkin.add("default-horizontal", defaultSlider); + SliderStyle defaultSlider = new SliderStyle(getDefaultSkin().getDrawable("default-slider"), getDefaultSkin().getDrawable("default-slider-knob")); + getDefaultSkin().add("default-horizontal", defaultSlider); ButtonStyle infoButton = new ButtonStyle(); - infoButton.up = defaultSkin.getDrawable("holo-pane"); - infoButton.down = defaultSkin.getDrawable("holo-pane-down"); - defaultSkin.add("info-button", infoButton); + infoButton.up = getDefaultSkin().getDrawable("holo-pane"); + infoButton.down = getDefaultSkin().getDrawable("holo-pane-down"); + getDefaultSkin().add("info-button", infoButton); LabelStyle defaultLabel = new LabelStyle(); - defaultLabel.font = defaultSkin.getFont("default-font"); - defaultLabel.fontColor = defaultSkin.getColor("default"); - defaultSkin.add("default", defaultLabel); + defaultLabel.font = getDefaultSkin().getFont("default-font"); + defaultLabel.fontColor = getDefaultSkin().getColor("default"); + getDefaultSkin().add("default", defaultLabel); - TextFieldStyle defaultTextField = new TextFieldStyle(defaultSkin.getFont("sub-font"), defaultSkin.getColor("default"), defaultSkin.getDrawable("cursor"), defaultSkin.getDrawable("selection"), defaultSkin.getDrawable("textfield")); - defaultSkin.add("default", defaultTextField); + TextFieldStyle defaultTextField = new TextFieldStyle(getDefaultSkin().getFont("sub-font"), getDefaultSkin().getColor("default"), getDefaultSkin().getDrawable("cursor"), getDefaultSkin().getDrawable("selection"), getDefaultSkin().getDrawable("textfield")); + getDefaultSkin().add("default", defaultTextField); - WindowStyle defaultWindow = new WindowStyle(defaultSkin.getFont("window-font"), defaultSkin.getColor("default"), defaultSkin.getDrawable("default-window")); - defaultSkin.add("default", defaultWindow); + WindowStyle defaultWindow = new WindowStyle(getDefaultSkin().getFont("window-font"), getDefaultSkin().getColor("default"), getDefaultSkin().getDrawable("default-window")); + getDefaultSkin().add("default", defaultWindow); WindowStyle tintedWindow = new WindowStyle(defaultWindow); - tintedWindow.titleFontColor = defaultSkin.getColor("inverse"); - tintedWindow.background = defaultSkin.getDrawable("tinted-window"); - defaultSkin.add("tinted", tintedWindow); + tintedWindow.titleFontColor = getDefaultSkin().getColor("inverse"); + tintedWindow.background = getDefaultSkin().getDrawable("tinted-window"); + getDefaultSkin().add("tinted", tintedWindow); - ListStyle defaultList = new ListStyle(defaultSkin.getFont("sub-font"), defaultSkin.getColor("inverse"), defaultSkin.getColor("default"), defaultSkin.getDrawable("selection")); - defaultSkin.add("default", defaultList); + ListStyle defaultList = new ListStyle(getDefaultSkin().getFont("sub-font"), getDefaultSkin().getColor("inverse"), getDefaultSkin().getColor("default"), getDefaultSkin().getDrawable("selection")); + getDefaultSkin().add("default", defaultList); ScrollPaneStyle defaultScrollPane = new ScrollPaneStyle(); - defaultScrollPane.vScroll = defaultSkin.getDrawable("default-scroll"); - defaultScrollPane.hScrollKnob = defaultSkin.getDrawable("default-round-large"); - defaultScrollPane.hScroll = defaultSkin.getDrawable("default-scroll"); - defaultScrollPane.vScrollKnob = defaultSkin.getDrawable("default-round-large"); - defaultSkin.add("default", defaultScrollPane); + defaultScrollPane.vScroll = getDefaultSkin().getDrawable("default-scroll"); + defaultScrollPane.hScrollKnob = getDefaultSkin().getDrawable("default-round-large"); + defaultScrollPane.hScroll = getDefaultSkin().getDrawable("default-scroll"); + defaultScrollPane.vScrollKnob = getDefaultSkin().getDrawable("default-round-large"); + getDefaultSkin().add("default", defaultScrollPane); - CheckBoxStyle defaultCheckBox = new CheckBoxStyle(defaultSkin.getDrawable("check-off"), defaultSkin.getDrawable("check-on"), defaultSkin.getFont("window-font"), defaultSkin.getColor("default")); - defaultSkin.add("default", defaultCheckBox); + CheckBoxStyle defaultCheckBox = new CheckBoxStyle(getDefaultSkin().getDrawable("check-off"), getDefaultSkin().getDrawable("check-on"), getDefaultSkin().getFont("window-font"), getDefaultSkin().getColor("default")); + getDefaultSkin().add("default", defaultCheckBox); - SelectBoxStyle defaultSelectBox = new SelectBoxStyle(defaultSkin.getFont("default-font"), defaultSkin.getColor("default"), defaultSkin.getDrawable("default-select"), defaultScrollPane, defaultList); - defaultSkin.add("default", defaultSelectBox); + SelectBoxStyle defaultSelectBox = new SelectBoxStyle(getDefaultSkin().getFont("default-font"), getDefaultSkin().getColor("default"), getDefaultSkin().getDrawable("default-select"), defaultScrollPane, defaultList); + getDefaultSkin().add("default", defaultSelectBox); Gdx.app.debug("Prelaunch Debug Info", "UI Skin has been defined."); } @@ -231,7 +231,7 @@ public class Polyjet extends Game { @Override public void resize(int width, int height) { if (initComplete) { - defaultSkin.dispose(); + getDefaultSkin().dispose(); assetManager.clear(); prefs.putInteger("screen-width", width); prefs.putInteger("screen-height", height); @@ -246,4 +246,12 @@ public class Polyjet extends Game { Gdx.app.debug("Font pixel size", MathUtils.round(Gdx.graphics.getDensity()*(fontSize*Gdx.graphics.getHeight())) + "px"); return MathUtils.round(Gdx.graphics.getDensity()*(fontSize*Gdx.graphics.getHeight())); } + + public AssetManager getAssetManager() { + return assetManager; + } + + public Skin getDefaultSkin() { + return defaultSkin; + } } diff --git a/core/src/zero1hd/polyjet/entity/PolyJetEntity.java b/core/src/zero1hd/polyjet/entity/PolyJetEntity.java index 652a364..7b15df3 100755 --- a/core/src/zero1hd/polyjet/entity/PolyJetEntity.java +++ b/core/src/zero1hd/polyjet/entity/PolyJetEntity.java @@ -24,11 +24,11 @@ public class PolyJetEntity extends Actor { setPosition(Polyjet.GAME_AREA_WIDTH/2 - getWidth()/2, -4f); - polyjet = core.assetManager.get("polyjet-" + jet + ".png", Texture.class); - thrust = core.assetManager.get("standard_thrust.p", ParticleEffect.class); + polyjet = core.getAssetManager().get("polyjet-" + jet + ".png", Texture.class); + thrust = core.getAssetManager().get("standard_thrust.p", ParticleEffect.class); thrust.start(); - teleportCloak = core.assetManager.get("teleport-cloak.p", ParticleEffect.class); + teleportCloak = core.getAssetManager().get("teleport-cloak.p", ParticleEffect.class); addAction(Actions.moveTo(getX(), 4f, 0.5f)); } diff --git a/core/src/zero1hd/polyjet/maps/KeyMap.java b/core/src/zero1hd/polyjet/maps/KeyMap.java index e1a5602..00119b9 100755 --- a/core/src/zero1hd/polyjet/maps/KeyMap.java +++ b/core/src/zero1hd/polyjet/maps/KeyMap.java @@ -58,7 +58,7 @@ public class KeyMap { public KeyMap(Polyjet core) { - keyTextures = core.assetManager.get("keyboard.atlas", TextureAtlas.class); + keyTextures = core.getAssetManager().get("keyboard.atlas", TextureAtlas.class); setKeys(Gdx.app.getPreferences("PolyJet_Controls")); updateKeys(); diff --git a/core/src/zero1hd/polyjet/screens/GameScreen.java b/core/src/zero1hd/polyjet/screens/GameScreen.java index 44b7e13..4484ea3 100755 --- a/core/src/zero1hd/polyjet/screens/GameScreen.java +++ b/core/src/zero1hd/polyjet/screens/GameScreen.java @@ -43,11 +43,11 @@ public class GameScreen extends ScreenAdapter implements InputProcessor { // Overlay stuff overlay = new Stage(); - scoreLabel = new Label("Score: 0", core.defaultSkin, "default-font", Color.WHITE); + scoreLabel = new Label("Score: 0", core.getDefaultSkin(), "default-font", Color.WHITE); scoreLabel.setPosition(25, Gdx.graphics.getHeight() - scoreLabel.getHeight() - 25); - ImageButton pause = new ImageButton(core.defaultSkin.getDrawable("pause"), - core.defaultSkin.getDrawable("pause-down")); + ImageButton pause = new ImageButton(core.getDefaultSkin().getDrawable("pause"), + core.getDefaultSkin().getDrawable("pause-down")); pause.setPosition(Gdx.graphics.getWidth() - pause.getWidth() - 25, Gdx.graphics.getHeight() - pause.getHeight() - 25); pause.addListener(new ChangeListener() { @@ -58,13 +58,13 @@ public class GameScreen extends ScreenAdapter implements InputProcessor { }); WidgetGroup healthBar = new WidgetGroup(); - final Image healthBarTank = new Image(core.defaultSkin.getPatch("bar-empty")); + final Image healthBarTank = new Image(core.getDefaultSkin().getPatch("bar-empty")); healthBarTank.setHeight(100); healthBar.setSize(healthBarTank.getWidth(), healthBarTank.getHeight()); healthBar.setPosition(Gdx.graphics.getWidth() - healthBar.getWidth() - 16, pause.getY() - healthBar.getHeight() - 32); - Image healthBarFiller = new Image(core.defaultSkin.getPatch("bar-fill")) { + Image healthBarFiller = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { setHeight( @@ -76,13 +76,13 @@ public class GameScreen extends ScreenAdapter implements InputProcessor { healthBar.addActor(healthBarTank); overlay.addActor(healthBar); - FPSDisplay = new FPSWindow("FPS", core.defaultSkin); + FPSDisplay = new FPSWindow("FPS", core.getDefaultSkin()); overlay.addActor(pause); overlay.addActor(scoreLabel); // Pause menu - pauseMenu = new Window("Paused", core.defaultSkin); - pauseMenu.add(new TextButton("resume", core.defaultSkin) { + pauseMenu = new Window("Paused", core.getDefaultSkin()); + pauseMenu.add(new TextButton("resume", core.getDefaultSkin()) { { addListener(new ChangeListener() { diff --git a/core/src/zero1hd/polyjet/screens/LoadingScreen.java b/core/src/zero1hd/polyjet/screens/LoadingScreen.java index ce03f42..ff56f02 100755 --- a/core/src/zero1hd/polyjet/screens/LoadingScreen.java +++ b/core/src/zero1hd/polyjet/screens/LoadingScreen.java @@ -28,9 +28,9 @@ public class LoadingScreen extends ScreenAdapter { this.reInit = reInit; stage = new Stage(new ScreenViewport()); - core.assetManager.load("splashlogo.png", Texture.class); - core.assetManager.finishLoading(); - zero1HD = new Image(this.core.assetManager.get("splashlogo.png", Texture.class)); + core.getAssetManager().load("splashlogo.png", Texture.class); + core.getAssetManager().finishLoading(); + zero1HD = new Image(this.core.getAssetManager().get("splashlogo.png", Texture.class)); zero1HD.setColor(0f,1f,1f,0f); stage.addActor(zero1HD); @@ -50,7 +50,7 @@ public class LoadingScreen extends ScreenAdapter { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(delta); - if (!zero1HD.hasActions() & core.assetManager.update()) { + if (!zero1HD.hasActions() & core.getAssetManager().update()) { Gdx.app.debug("Loading Screen", "queue has all been loaded. Action is done playing."); zero1HD.remove(); @@ -62,8 +62,8 @@ public class LoadingScreen extends ScreenAdapter { } core.setScreen(gotoScreen); - core.assetManager.unload("splashlogo.png"); - core.assetManager.get("standard_thrust.p", ParticleEffect.class).flipY(); + core.getAssetManager().unload("splashlogo.png"); + core.getAssetManager().get("standard_thrust.p", ParticleEffect.class).flipY(); } stage.draw(); diff --git a/core/src/zero1hd/polyjet/screens/MainMenu.java b/core/src/zero1hd/polyjet/screens/MainMenu.java index 9efd705..83048f8 100755 --- a/core/src/zero1hd/polyjet/screens/MainMenu.java +++ b/core/src/zero1hd/polyjet/screens/MainMenu.java @@ -50,7 +50,7 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter { optionsPage.setPosition(Gdx.graphics.getWidth(), 0); stage.addActor(optionsPage); - creditsPage = new CreditsPage(core.defaultSkin); + creditsPage = new CreditsPage(core.getDefaultSkin()); creditsPage.setPosition(0, Gdx.graphics.getHeight()); stage.addActor(creditsPage); diff --git a/core/src/zero1hd/polyjet/screens/PreGameScreen.java b/core/src/zero1hd/polyjet/screens/PreGameScreen.java index 39f556f..cd5eaca 100755 --- a/core/src/zero1hd/polyjet/screens/PreGameScreen.java +++ b/core/src/zero1hd/polyjet/screens/PreGameScreen.java @@ -51,7 +51,7 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter { public void postTransition() { stage.clear(); - Image cyberCircle1 = new Image(core.assetManager.get("cybercircle3B.png", Texture.class)); + Image cyberCircle1 = new Image(core.getAssetManager().get("cybercircle3B.png", Texture.class)); cyberCircle1.setScale(0.7f); cyberCircle1.setOrigin(cyberCircle1.getWidth()/2, cyberCircle1.getHeight()/2); cyberCircle1.setColor(0.8f,0.8f,0.8f,0.7f); @@ -59,7 +59,7 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter { cyberCircle1.setPosition(Gdx.graphics.getWidth()-cyberCircle1.getWidth()/2-10, -cyberCircle1.getHeight()*2/4f); stage.addActor(cyberCircle1); - analyzePage = new AnalyzePage(core.defaultSkin, cameraTarget, core.assetManager); + analyzePage = new AnalyzePage(core.getDefaultSkin(), cameraTarget, core.getAssetManager()); analyzePage.setPosition(1f*Gdx.graphics.getWidth(), 0); stage.addActor(analyzePage); diff --git a/core/src/zero1hd/polyjet/ui/pages/MainPage.java b/core/src/zero1hd/polyjet/ui/pages/MainPage.java index 2b7b6bd..ce56b4a 100755 --- a/core/src/zero1hd/polyjet/ui/pages/MainPage.java +++ b/core/src/zero1hd/polyjet/ui/pages/MainPage.java @@ -28,15 +28,15 @@ public class MainPage extends Page { private WidgetGroup playButton; public MainPage(final Polyjet core, final Vector3 targetPosition) { - polyjetTitle = new Image(core.assetManager.get("PolyjetTitle.png", Texture.class)); + polyjetTitle = new Image(core.getAssetManager().get("PolyjetTitle.png", Texture.class)); polyjetTitle.setPosition(15, getHeight() - polyjetTitle.getHeight()-15); addActor(polyjetTitle); - polyJetVersion = new Label("Version: " + Polyjet.VERSION, core.defaultSkin, "sub-font", - core.defaultSkin.getColor("default")); + polyJetVersion = new Label("Version: " + Polyjet.VERSION, core.getDefaultSkin(), "sub-font", + core.getDefaultSkin().getColor("default")); polyJetVersion.setPosition(3, 3); addActor(polyJetVersion); - options = new TextButton(" Options ", core.defaultSkin, "left"); + options = new TextButton(" Options ", core.getDefaultSkin(), "left"); options.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -48,7 +48,7 @@ public class MainPage extends Page { options.addAction(Actions.sequence(Actions.delay(0.25f), Actions.moveTo(0, options.getY(), 0.5f))); addActor(options); - credits = new TextButton(" Credits ", core.defaultSkin, "left"); + credits = new TextButton(" Credits ", core.getDefaultSkin(), "left"); credits.addListener(new ChangeListener() { @Override @@ -60,7 +60,7 @@ public class MainPage extends Page { credits.addAction(Actions.sequence(Actions.delay(0.5f), Actions.moveTo(0, credits.getY(), 0.5f))); addActor(credits); - quit = new TextButton(" Quit ", core.defaultSkin, "left"); + quit = new TextButton(" Quit ", core.getDefaultSkin(), "left"); quit.setPosition(-quit.getWidth(), credits.getY() - credits.getHeight() - 10); quit.addListener(new ChangeListener() { @@ -76,14 +76,14 @@ public class MainPage extends Page { // begin play button playButton = new WidgetGroup(); - cyberCircle = new Image(core.assetManager.get("Tech-Circle1.png", Texture.class)); + cyberCircle = new Image(core.getAssetManager().get("Tech-Circle1.png", Texture.class)); cyberCircle.setOrigin(cyberCircle.getWidth() / 2, cyberCircle.getHeight() / 2); cyberCircle.setColor(0.7f, 0.7f, 0.7f, 0.8f); cyberCircle.addAction(Actions.forever(Actions.rotateBy(-360f, 10f))); playButton.addActor(cyberCircle); playButton.setSize(cyberCircle.getWidth(), cyberCircle.getHeight()); - begin = new Label("Play", core.defaultSkin, "special-font", core.defaultSkin.getColor("default")); + begin = new Label("Play", core.getDefaultSkin(), "special-font", core.getDefaultSkin().getColor("default")); begin.setColor(1f, 1f, 1f, 1f); playButton.addActor(begin); begin.setPosition(((playButton.getWidth() - begin.getWidth()) / 2)-10, diff --git a/core/src/zero1hd/polyjet/ui/pages/MoreOptionsPage.java b/core/src/zero1hd/polyjet/ui/pages/MoreOptionsPage.java index 58a9d98..2b0000f 100755 --- a/core/src/zero1hd/polyjet/ui/pages/MoreOptionsPage.java +++ b/core/src/zero1hd/polyjet/ui/pages/MoreOptionsPage.java @@ -24,7 +24,7 @@ public class MoreOptionsPage extends Page { public MoreOptionsPage(Polyjet core, final Vector3 targetLocation) { keymap = new KeyMap(core); - TextButton backArrow = new TextButton("Back", core.defaultSkin); + TextButton backArrow = new TextButton("Back", core.getDefaultSkin()); backArrow.setPosition(15, getHeight()-backArrow.getHeight()-10); backArrow.addListener(new ChangeListener() { @Override @@ -34,16 +34,16 @@ public class MoreOptionsPage extends Page { }); addActor(backArrow); - controlSetter = new SetControls(core.defaultSkin, keymap); - controlsScroller = new ScrollPane(controlSetter, core.defaultSkin); + controlSetter = new SetControls(core.getDefaultSkin(), keymap); + controlsScroller = new ScrollPane(controlSetter, core.getDefaultSkin()); controlsScroller.setFadeScrollBars(false); controlsScroller.setSize(getWidth()-backArrow.getWidth()-backArrow.getX()-10, getHeight()); controlsScroller.setX(backArrow.getWidth()+10+backArrow.getX()); addActor(controlsScroller); controlsScroller.setVisible(false); - graphicsSettings = new GraphicsTable(core.defaultSkin, core.prefs); - graphicsScroller = new ScrollPane(graphicsSettings, core.defaultSkin); + graphicsSettings = new GraphicsTable(core.getDefaultSkin(), core.prefs); + graphicsScroller = new ScrollPane(graphicsSettings, core.getDefaultSkin()); graphicsScroller.setFadeScrollBars(false); graphicsScroller.setSize(getWidth()-backArrow.getWidth()-backArrow.getX()-10, getHeight()); graphicsScroller.setX(backArrow.getWidth()+10+backArrow.getX()); diff --git a/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java index a63eeb0..8582f1c 100755 --- a/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java @@ -34,14 +34,14 @@ public class MusicSelectionPage extends Page { private AnalyzePage ap; public MusicSelectionPage(final Polyjet core, final MainMenu mainMenu, AnalyzePage analyzePage) { - super("Select music", core.defaultSkin); + super("Select music", core.getDefaultSkin()); this.core = core; musicFileAnnotation = Gdx.app.getPreferences("music_file_annotation"); this.ap = analyzePage; - back = new TextButton("Back", core.defaultSkin); + back = new TextButton("Back", core.getDefaultSkin()); back.setPosition(getWidth()-back.getWidth()-15f, getHeightBelowTitle()); back.addListener(new ChangeListener() { @Override @@ -52,7 +52,7 @@ public class MusicSelectionPage extends Page { }); addActor(back); - loadingWindow = new LoadingWindow(core.defaultSkin, "tinted", true, core.assetManager, core.prefs.getFloat("fx vol")); + loadingWindow = new LoadingWindow(core.getDefaultSkin(), "tinted", true, core.getAssetManager(), core.prefs.getFloat("fx vol")); loadingWindow.setPosition((getWidth()-loadingWindow.getWidth())/2f, (getHeight()-loadingWindow.getHeight())/2f); addActor(loadingWindow); loadingWindow.playOpenSound(); @@ -97,7 +97,7 @@ public class MusicSelectionPage extends Page { if (musicFiles.length > 0) { for (int music = 0; music < musicFiles.length && !cancel; music++) { - final MusicSelectable selectable = new MusicSelectable(musicFiles[music], musicFileAnnotation, core.defaultSkin, core.assetManager.get("defaultCover.png", Texture.class)); + final MusicSelectable selectable = new MusicSelectable(musicFiles[music], musicFileAnnotation, core.getDefaultSkin(), core.getAssetManager().get("defaultCover.png", Texture.class)); Gdx.app.postRunnable(new Runnable() { @Override public void run() { @@ -123,7 +123,7 @@ public class MusicSelectionPage extends Page { loadingWindow.remove(); } else { - NoticeWindow notice = new NoticeWindow(core.defaultSkin, "default", "No song's found in:\n\"" + core.prefs.getString("music dir") + "\"\nTo change the search directory, go to game options."); + NoticeWindow notice = new NoticeWindow(core.getDefaultSkin(), "default", "No song's found in:\n\"" + core.prefs.getString("music dir") + "\"\nTo change the search directory, go to game options."); notice.setSize(0.6f*getWidth(), 0.6f*getHeight()); notice.setPosition((getWidth()-notice.getWidth())/2f, (getHeight()-notice.getHeight())/2f); notice.setModal(true); diff --git a/core/src/zero1hd/polyjet/ui/pages/OptionsPage.java b/core/src/zero1hd/polyjet/ui/pages/OptionsPage.java index 3da76cb..7acd4f7 100755 --- a/core/src/zero1hd/polyjet/ui/pages/OptionsPage.java +++ b/core/src/zero1hd/polyjet/ui/pages/OptionsPage.java @@ -32,17 +32,17 @@ public class OptionsPage extends Page { this.core = core; optionsTable.defaults().spaceLeft(40f).padTop(5f).padBottom(5f).left(); - Label optionGeneralTitle = new Label("General", core.defaultSkin, "large-font", core.defaultSkin.getColor("default")); + Label optionGeneralTitle = new Label("General", core.getDefaultSkin(), "large-font", core.getDefaultSkin().getColor("default")); optionsTable.add(optionGeneralTitle).left().spaceBottom(10f); optionsTable.row(); - Label musicVolSliderLabel = new Label("Music Volume: ", core.defaultSkin); + Label musicVolSliderLabel = new Label("Music Volume: ", core.getDefaultSkin()); optionsTable.add(musicVolSliderLabel).padRight(12f).left(); - musicVolSlider = new Slider(0, 100, 0.1f, false, core.defaultSkin); + musicVolSlider = new Slider(0, 100, 0.1f, false, core.getDefaultSkin()); musicVolSlider.setValue(core.prefs.getFloat("music vol", 100f)); optionsTable.add(musicVolSlider).prefWidth(790).left(); - final Label musicVolPercentage = new Label(MathUtils.round(musicVolSlider.getValue()) + "%", core.defaultSkin); + final Label musicVolPercentage = new Label(MathUtils.round(musicVolSlider.getValue()) + "%", core.getDefaultSkin()); musicVolSlider.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -53,12 +53,12 @@ public class OptionsPage extends Page { optionsTable.row(); - Label fxVolSliderLabel = new Label("FX Volume: ", core.defaultSkin); + Label fxVolSliderLabel = new Label("FX Volume: ", core.getDefaultSkin()); optionsTable.add(fxVolSliderLabel).padRight(12f).left(); - fxVolSlider = new Slider(0, 100, 1, false, core.defaultSkin); + fxVolSlider = new Slider(0, 100, 1, false, core.getDefaultSkin()); fxVolSlider.setValue(core.prefs.getFloat("fx vol", 100f)); optionsTable.add(fxVolSlider).prefWidth(790); - final Label fxVolPercentage = new Label(MathUtils.round(fxVolSlider.getValue()) + "%", core.defaultSkin); + final Label fxVolPercentage = new Label(MathUtils.round(fxVolSlider.getValue()) + "%", core.getDefaultSkin()); fxVolSlider.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -70,17 +70,17 @@ public class OptionsPage extends Page { optionsTable.row(); - Label musicDirectoryLabel = new Label("Music Directory: ", core.defaultSkin); + Label musicDirectoryLabel = new Label("Music Directory: ", core.getDefaultSkin()); optionsTable.add(musicDirectoryLabel).left(); - directoryField = new TextField(null, core.defaultSkin); + directoryField = new TextField(null, core.getDefaultSkin()); directoryField.setText(core.prefs.getString("music dir", System.getProperty("user.home")+System.getProperty("file.separator")+"Music")); optionsTable.add(directoryField).prefWidth(810).left(); optionsTable.row(); - Label debugCodeLabel = new Label("Debug Code: ", core.defaultSkin); + Label debugCodeLabel = new Label("Debug Code: ", core.getDefaultSkin()); optionsTable.add(debugCodeLabel).left(); - final TextField debugCodeField = new TextField(null, core.defaultSkin); + final TextField debugCodeField = new TextField(null, core.getDefaultSkin()); debugCodeField.addListener(new InputListener() { @Override public boolean keyUp(InputEvent event, int keycode) { @@ -100,7 +100,7 @@ public class OptionsPage extends Page { //Back button - TextButton backButton = new TextButton("Back", core.defaultSkin); + TextButton backButton = new TextButton("Back", core.getDefaultSkin()); backButton.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -116,7 +116,7 @@ public class OptionsPage extends Page { optionsTable.row(); - TextButton keybindSettings = new TextButton("Set Controls", core.defaultSkin); + TextButton keybindSettings = new TextButton("Set Controls", core.getDefaultSkin()); keybindSettings.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -128,7 +128,7 @@ public class OptionsPage extends Page { optionsTable.row(); - TextButton graphicsSettings = new TextButton("Graphics", core.defaultSkin); + TextButton graphicsSettings = new TextButton("Graphics", core.getDefaultSkin()); graphicsSettings.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -150,7 +150,7 @@ public class OptionsPage extends Page { @Override public void act(float delta) { - if (core.assetManager.update() && goToScreen != 0) { + if (core.getAssetManager().update() && goToScreen != 0) { switch (goToScreen) { case 1: core.setScreen(new CreativeDebugScreen(core, (MainMenu) core.getScreen())); diff --git a/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java b/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java index 97c4698..2a70b34 100755 --- a/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java +++ b/core/src/zero1hd/polyjet/ui/stages/CreativeStage.java @@ -42,16 +42,16 @@ public class CreativeStage extends Stage { public CreativeStage(final Polyjet core, final MainMenu mainMenu) { this.core = core; analyzer = new AudioAnalyzer(); - musicSelector = new MusicSelector("Select Audio File", core.defaultSkin, core.prefs.getString("music dir"), "default"); + musicSelector = new MusicSelector("Select Audio File", core.getDefaultSkin(), core.prefs.getString("music dir"), "default"); musicSelector.postInit(); musicSelector.refresh(); - fpsViewer = new FPSWindow("FPS", core.defaultSkin); - beatViewer = new BeatViewer("Beat", core.defaultSkin, core, analyzer); - graphViewer = new GraphWindow("Peak Values", core.defaultSkin); - volumeWindow = new VolumeWindow("Volume adjustments", core.defaultSkin, core.prefs); + fpsViewer = new FPSWindow("FPS", core.getDefaultSkin()); + beatViewer = new BeatViewer("Beat", core.getDefaultSkin(), core, analyzer); + graphViewer = new GraphWindow("Peak Values", core.getDefaultSkin()); + volumeWindow = new VolumeWindow("Volume adjustments", core.getDefaultSkin(), core.prefs); //Back button - TextButton backButton = new TextButton("Back", core.defaultSkin); + TextButton backButton = new TextButton("Back", core.getDefaultSkin()); backButton.addListener(new ChangeListener() { @Override @@ -64,13 +64,13 @@ public class CreativeStage extends Stage { addActor(backButton); - toolbox = new Window("Tools", core.defaultSkin); + toolbox = new Window("Tools", core.getDefaultSkin()); toolbox.defaults().pad(5f); - Table toolboxToolSet = new Table(core.defaultSkin); + Table toolboxToolSet = new Table(core.getDefaultSkin()); toolboxToolSet.defaults().space(5f); - final CheckBox musicSelectorCheckbox = new CheckBox(" Music selector", core.defaultSkin); + final CheckBox musicSelectorCheckbox = new CheckBox(" Music selector", core.getDefaultSkin()); musicSelectorCheckbox.addListener(new ChangeListener() { @Override @@ -85,7 +85,7 @@ public class CreativeStage extends Stage { toolboxToolSet.add(musicSelectorCheckbox); toolboxToolSet.row(); - final CheckBox musicPlayBackCheckbox = new CheckBox(" Playback controls", core.defaultSkin); + final CheckBox musicPlayBackCheckbox = new CheckBox(" Playback controls", core.getDefaultSkin()); musicPlayBackCheckbox.addListener(new ChangeListener() { @Override @@ -100,7 +100,7 @@ public class CreativeStage extends Stage { toolboxToolSet.add(musicPlayBackCheckbox); toolboxToolSet.row(); - final CheckBox beatViewerCheckbox = new CheckBox(" Beat viewer", core.defaultSkin); + final CheckBox beatViewerCheckbox = new CheckBox(" Beat viewer", core.getDefaultSkin()); beatViewerCheckbox.addListener(new ChangeListener() { @Override @@ -115,7 +115,7 @@ public class CreativeStage extends Stage { toolboxToolSet.add(beatViewerCheckbox); toolboxToolSet.row(); - final CheckBox fpsViewerCheckbox = new CheckBox(" FPS", core.defaultSkin); + final CheckBox fpsViewerCheckbox = new CheckBox(" FPS", core.getDefaultSkin()); fpsViewerCheckbox.addListener(new ChangeListener() { @Override @@ -130,7 +130,7 @@ public class CreativeStage extends Stage { toolboxToolSet.add(fpsViewerCheckbox); toolboxToolSet.row(); - final CheckBox peakGraphCheckbox = new CheckBox(" Peak Graph", core.defaultSkin); + final CheckBox peakGraphCheckbox = new CheckBox(" Peak Graph", core.getDefaultSkin()); peakGraphCheckbox.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -145,7 +145,7 @@ public class CreativeStage extends Stage { toolboxToolSet.add(peakGraphCheckbox); toolboxToolSet.row(); - final CheckBox volumeMixerCheckbox = new CheckBox(" Volume", core.defaultSkin); + final CheckBox volumeMixerCheckbox = new CheckBox(" Volume", core.getDefaultSkin()); volumeMixerCheckbox.addListener(new ChangeListener() { @Override @@ -160,7 +160,7 @@ public class CreativeStage extends Stage { toolboxToolSet.add(volumeMixerCheckbox); - ScrollPane scroller = new ScrollPane(toolboxToolSet, core.defaultSkin); + ScrollPane scroller = new ScrollPane(toolboxToolSet, core.getDefaultSkin()); toolbox.add(scroller).expand().fill(); toolbox.setSize(300, 300); addActor(toolbox); diff --git a/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java b/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java index 3903a1d..a032dc0 100755 --- a/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java +++ b/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java @@ -32,11 +32,11 @@ public class BeatViewer extends Window { WidgetGroup bassBar = new WidgetGroup(); - final Image bgBassBar = new Image(core.defaultSkin.getPatch("bar-empty")); + final Image bgBassBar = new Image(core.getDefaultSkin().getPatch("bar-empty")); bgBassBar.setHeight(50f); bassBar.setSize(bgBassBar.getWidth(), bgBassBar.getHeight()); - final Image bassBarFill = new Image(core.defaultSkin.getPatch("bar-fill")) { + final Image bassBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { if (musicReady && data.getBassPeaks().get(songIndex) >= 1f) { @@ -52,10 +52,10 @@ public class BeatViewer extends Window { add(bassBar).minSize(bassBar.getWidth(), bassBar.getHeight()); WidgetGroup UMBar = new WidgetGroup(); - final Image bgUMBar = new Image(core.defaultSkin.getPatch("bar-empty")); + final Image bgUMBar = new Image(core.getDefaultSkin().getPatch("bar-empty")); bgUMBar.setHeight(50f); UMBar.setSize(bgUMBar.getWidth(), bgUMBar.getHeight()); - Image UMBarFill = new Image(core.defaultSkin.getPatch("bar-fill")) { + Image UMBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { if (musicReady && data.getUMPeaks().get(songIndex) >= 1f) {