Show a shutdown button upon death (closes #23), update to v0.6.1

This commit is contained in:
Lonami Exo 2017-07-08 11:32:39 +02:00
parent 6781e49998
commit cbb13f672f
12 changed files with 55 additions and 22 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

@ -22,8 +22,8 @@ android {
minSdkVersion 8
targetSdkVersion 25
versionCode 600
versionName "0.6"
versionCode 610
versionName "0.6.1"
}
}

View file

@ -16,7 +16,7 @@ allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '0.6'
version = '0.6.1'
ext {
appName = "1010! Klooni"
gdxVersion = '1.9.5'

View file

@ -28,7 +28,7 @@ public class SkinLoader {
private static String[] ids = {
"play", "play_saved", "star", "stopwatch", "palette", "home", "replay",
"share", "sound_on", "sound_off", "snap_on", "snap_off", "issues", "credits",
"web", "back", "ok", "cancel"
"web", "back", "ok", "cancel", "power_off"
};
private static float bestMultiplier;

View file

@ -53,6 +53,7 @@ class PauseMenuStage extends Stage {
private final Band band;
private final BaseScorer scorer;
private final SoftButton playButton;
private final SoftButton customButton; // Customize & "Shut down"
//endregion
@ -98,22 +99,14 @@ class PauseMenuStage extends Stage {
table.row();
// Palette button (buy colors)
final SoftButton paletteButton = new SoftButton(1, "palette_texture");
table.add(paletteButton).space(16);
paletteButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
// Don't dispose because then it needs to take us to the previous screen
game.transitionTo(new CustomizeScreen(game, game.getScreen()), false);
}
});
// Palette button OR shutdown game (if game over)
customButton = new SoftButton(1, "palette_texture");
table.add(customButton).space(16);
customButton.addListener(customChangeListener);
// Continue playing OR share (if game over) button
playButton = new SoftButton(2, "play_texture");
table.add(playButton).space(16);
playButton.addListener(playChangeListener);
}
@ -139,6 +132,14 @@ class PauseMenuStage extends Stage {
scorer.resume();
}
private final ChangeListener customChangeListener = new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
// Don't dispose because then it needs to take us to the previous screen
game.transitionTo(new CustomizeScreen(game, game.getScreen()), false);
}
};
private final ChangeListener playChangeListener = new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
@ -166,13 +167,22 @@ class PauseMenuStage extends Stage {
}
void showGameOver(final String gameOverReason, final boolean timeMode) {
// Allow the players to exit the game (issue #23)
customButton.removeListener(customChangeListener);
customButton.updateImage("power_off_texture");
customButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
Gdx.app.exit();
}
});
if (game.shareChallenge != null) {
playButton.removeListener(playChangeListener);
playButton.updateImage("share_texture");
playButton.addListener(new ChangeListener() {
public void changed(ChangeEvent event, Actor actor) {
// Don't dispose because then it needs to take us to the previous screen
game.transitionTo(new ShareScoreScreen(
game, game.getScreen(), scorer.getCurrentScore(), timeMode), false);
}

View file

@ -15,7 +15,7 @@
viewBox="0 0 500.00001 500.00001"
id="svg2"
version="1.1"
inkscape:version="0.92.1 r15371"
inkscape:version="0.92.1 r"
sodipodi:docname="buttons.svg">
<defs
id="defs4">
@ -125,14 +125,14 @@
borderopacity="1"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="4.6421393"
inkscape:cx="162.81422"
inkscape:cy="251.69867"
inkscape:zoom="0.82062205"
inkscape:cx="328.41208"
inkscape:cy="62.530961"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1366"
inkscape:window-height="742"
inkscape:window-height="739"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
@ -1133,5 +1133,27 @@
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.1729759;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
<g
id="power_off">
<rect
y="848.36218"
x="-1.7763568e-15"
height="64.000313"
width="64.000313"
id="rect4660"
style="fill:none;fill-opacity:1;stroke:none;stroke-width:2.16577601;stroke-opacity:1" />
<path
sodipodi:nodetypes="ssssssssssss"
inkscape:connector-curvature="0"
id="path4662"
d="m 45.036191,857.69924 c 5.203104,-3.79965 9.388151,4.33734 11.779635,8.22107 5.165057,8.38797 5.975717,19.35861 0.89549,28.1922 -5.366639,9.33161 -15.15808,16.39433 -26.245535,15.66611 C 18.331227,908.91594 5.6536704,899.49369 3.3341588,886.10284 1.6199931,876.20673 4.6666459,866.10771 11.962852,858.7082 c 5.148946,-5.22185 9.55443,0.629 5.270728,5.67046 -3.365214,3.9605 -6.611104,7.9085 -7.177727,13.23675 -1.1402987,10.72284 5.741703,21.44966 16.073318,24.33824 11.932388,3.33614 25.142774,-5.26317 27.283423,-17.41893 1.239676,-7.03955 -2.535275,-14.29484 -6.245168,-19.54582 -1.440336,-2.03865 -4.832856,-5.31676 -2.131235,-7.28966 z"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.93750006px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
sodipodi:nodetypes="sssssssssss"
inkscape:connector-curvature="0"
id="path4664"
d="m 28.96558,851.96616 c 0.835392,-0.69063 1.986545,-1.09077 3.070271,-1.07103 1.047321,0.0191 2.170527,0.41835 2.927466,1.14243 0.977909,0.93545 1.646441,2.3596 1.642238,3.71288 l -0.0714,22.99133 c -0.0026,0.83573 -0.291448,1.74078 -0.85682,2.35626 -0.958108,1.04302 -2.439879,1.8216 -3.855688,1.78503 -1.479356,-0.0382 -3.055098,-0.87499 -3.927089,-2.07064 -0.484195,-0.66392 -0.425936,-1.60594 -0.428411,-2.42766 l -0.0714,-23.70534 c -0.0031,-1.04505 0.765383,-2.04738 1.570833,-2.71326 z"
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.93750006px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View file

@ -25,6 +25,7 @@ ids = [
'palette',
'play',
'play_saved',
'power_off',
'replay',
'share',
'snap_off',