From 3c70a4d3f8c96b0d78e419650f26ab843942cad1 Mon Sep 17 00:00:00 2001 From: Recrown Date: Wed, 17 Jan 2018 12:43:38 -0600 Subject: [PATCH] added better background controls --- android/assets/gradients.png | Bin 545 -> 862 bytes .../rhythmbullet/desktop/audio/Mp3Manager.java | 10 +++++----- .../desktop/graphics/ui/pages/AnalysisPage.java | 2 ++ .../graphics/ui/pages/KeybindOptionsPage.java | 2 ++ .../desktop/graphics/ui/pages/MainPage.java | 2 ++ .../graphics/ui/pages/MusicSelectionPage.java | 2 ++ .../desktop/graphics/ui/pages/OptionsPage.java | 2 ++ .../desktop/graphics/ui/pages/Page.java | 9 ++++++++- .../graphics/ui/pages/VideoOptionsPage.java | 2 ++ 9 files changed, 25 insertions(+), 6 deletions(-) mode change 100755 => 100644 android/assets/gradients.png diff --git a/android/assets/gradients.png b/android/assets/gradients.png old mode 100755 new mode 100644 index 2ed51fc8c549084875dc60815b6db53b93ad780a..184961f5ae5c41d2dad3d5b9dbacfc92956123c7 GIT binary patch literal 862 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSoCO|{#S9F5hd`K7RKp9TLZ&Jt zqQtSZBqP6wfq`RYx6awsK4-kc3p~$yvopvgv2>;GdC1Pd!1Th?#WAEJ?(KBLycP$B zBYhgGj~K6i;`$f=fh%gC;}KDh=}(^AtMD$9Iv=5JD0BSdi#yvJ-wW49PO}$V^V+KB zSKa+xHBa;z&l#Wp?7BU7cE8D@dg&c37WwnfKTp2@eS1REj*_$A&9Yfi{|Fnr(V nF`Xe|qV=eOqhW}YZ0xgU%Feof-|{XnZ!mbe`njxgN@xNAc%@!P literal 545 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSEa{HEjtmSN`?>!lvI6;>1s;*b z3=DjSK$uZf!>a)(C|TkfQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QBXJ~GmH$RzyfpMOv zi(^Pd+}kS`a}OJc91UQPT(vu;!EeIPyB;f=4kZ{joaq0|^5MIb-MP;_H*Dh9KYtZ` z-tL*?VY|NHx21l)|8V-n&Eq!7Hw^!L{vPYRzV5HVrvA!*(p7uzAAh@+Kf(TUPvZJ8 s`TEw>uWy)>Z48c$62ynWBbz#gUm{=Uwn(*Q0Hc$^)78&qol`;+0FMX2h5!Hn diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java b/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java index 6384312..f8605c6 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/audio/Mp3Manager.java @@ -159,10 +159,10 @@ public class Mp3Manager implements MusicManager { try { decoder.decodeFrame(header, bitstream); - } catch (ArrayIndexOutOfBoundsException e) { + } catch (ArrayIndexOutOfBoundsException ae) { Gdx.app.debug("Mp3Manager", "Last buffer reached since array was out of bounds."); - } catch (DecoderException e) { - Gdx.app.error("MP3 Decoder Error", e.toString()); + } catch (DecoderException de) { + Gdx.app.error("MP3 Decoder Error", de.toString()); } bitstream.closeFrame(); bytesRead = sampleBuffer.reset(); @@ -170,8 +170,8 @@ public class Mp3Manager implements MusicManager { } else { currentByteSet = null; } - } catch (BitstreamException e1) { - e1.printStackTrace(); + } catch (BitstreamException be) { + be.printStackTrace(); } return bytesRead; } else { diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java index 6bbc9f6..ea8b926 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java @@ -1,6 +1,7 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.pages; import com.badlogic.gdx.assets.AssetManager; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Actor; @@ -30,6 +31,7 @@ public class AnalysisPage extends Page { public AnalysisPage(Skin skin, AssetManager assets) { setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); + setBgColor(Color.toFloatBits(82,111,157, 255)); table = new Table(); table.setFillParent(true); table.defaults().space(10f); diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/KeybindOptionsPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/KeybindOptionsPage.java index 5f7069e..9036b03 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/KeybindOptionsPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/KeybindOptionsPage.java @@ -1,6 +1,7 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.pages; import com.badlogic.gdx.assets.AssetManager; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.scenes.scene2d.Actor; @@ -17,6 +18,7 @@ public class KeybindOptionsPage extends Page { private TextButton backButton; public KeybindOptionsPage(Skin skin, AssetManager assets, final Vector3 cameraPosition) { setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); + setBgColor(Color.toFloatBits(186,238,255, 255)); keyMap = new KeyMap(assets); controlTable = new ControlOptions(skin, keyMap); diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java index 4afa021..73bcad9 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MainPage.java @@ -4,6 +4,7 @@ import java.util.Observable; import java.util.Observer; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.math.Vector3; @@ -39,6 +40,7 @@ public class MainPage extends Page implements Observer { public MainPage(RhythmBullet core, final Vector3 targetPosition, MusicListController mlc, final MainMenu mainMenu) { this.mlc = mlc; setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-linear")); + setBgColor(Color.toFloatBits(83,100,170, 255)); this.mMenu = mainMenu; titleBar = new TitleBarVisualizer(core.getAssetManager()); addActor(titleBar); diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java index 1cb6828..e63e760 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/MusicSelectionPage.java @@ -8,6 +8,7 @@ import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.files.FileHandle; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -67,6 +68,7 @@ public class MusicSelectionPage extends Page implements Observer { public MusicSelectionPage(Skin skin, MusicListController musicListController, MusicInfoController musicInfoController, AssetManager assetManager, final Vector3 cameraTarget, final AnalysisPage ap) { setTextureBackground(assetManager.get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); + setBgColor(Color.toFloatBits(110,164,193, 255)); this.assets = assetManager; this.skin = skin; this.mc = musicListController; diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/OptionsPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/OptionsPage.java index 75b89a4..c746fac 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/OptionsPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/OptionsPage.java @@ -1,6 +1,7 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.pages; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.math.MathUtils; @@ -27,6 +28,7 @@ public class OptionsPage extends Page { public OptionsPage(final RhythmBullet core, final Vector3 targetPosition, KeybindOptionsPage moreOptionsPage, final MusicListController sc) { super("General", core.getDefaultSkin()); setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); + setBgColor(Color.toFloatBits(93,75,144, 255)); //Back button TextButton backButton = new TextButton("Back", core.getDefaultSkin()); backButton.addListener(new ChangeListener() { diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/Page.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/Page.java index 9adf101..b05dcc8 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/Page.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/Page.java @@ -1,6 +1,7 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.pages; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Group; @@ -12,10 +13,11 @@ import com.badlogic.gdx.utils.Disposable; public class Page extends Group implements Disposable { private Label pageTitle; private TextureRegion background; - + private float bgColor; public Page() { setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); setTouchable(Touchable.childrenOnly); + bgColor = Color.toFloatBits(255, 255, 255, 255); } public Page(String titleText, Skin skin) { @@ -33,11 +35,16 @@ public class Page extends Group implements Disposable { @Override public void draw(Batch batch, float parentAlpha) { if (background != null) { + batch.setColor(bgColor); batch.draw(background, getX(), getY(), getWidth(), getHeight()); } super.draw(batch, parentAlpha); } + public void setBgColor(float bgColor) { + this.bgColor = bgColor; + } + public void addSpaceToTitle(float space) { pageTitle.moveBy(space, 0); } diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/VideoOptionsPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/VideoOptionsPage.java index bc96402..7644877 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/VideoOptionsPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/VideoOptionsPage.java @@ -2,6 +2,7 @@ package zero1hd.rhythmbullet.desktop.graphics.ui.pages; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.assets.AssetManager; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.scenes.scene2d.Actor; @@ -20,6 +21,7 @@ public class VideoOptionsPage extends Page { public VideoOptionsPage(Skin skin, Preferences prefs, final MainMenu menu, AssetManager assets) { setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round")); + setBgColor(Color.toFloatBits(110,164,193, 255)); graphicsTable = new GraphicsOptions(menu, skin, prefs); scrollPane = new ScrollPane(graphicsTable, skin); scrollPane.setFadeScrollBars(false);