Skip to content
Snippets Groups Projects
Commit 1627b058 authored by Matyáš Latner's avatar Matyáš Latner
Browse files

Merge branch 'feature-gamemenu2' into 'devel'

Feature gamemenu2



See merge request !316
parents ce9851df d7428b4d
Branches
Tags
No related merge requests found
Showing
with 65 additions and 33 deletions
android/assets/gfx/button/no_icon.png

990 B

android/assets/gfx/button/yes_icon.png

754 B

core/assets/common/screen/encyclopedia/gfx/pause_icon.png

588 B | W: | H:

core/assets/common/screen/encyclopedia/gfx/pause_icon.png

589 B | W: | H:

core/assets/common/screen/encyclopedia/gfx/pause_icon.png
core/assets/common/screen/encyclopedia/gfx/pause_icon.png
core/assets/common/screen/encyclopedia/gfx/pause_icon.png
core/assets/common/screen/encyclopedia/gfx/pause_icon.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/encyclopedia/gfx/play_icon.png

628 B | W: | H:

core/assets/common/screen/encyclopedia/gfx/play_icon.png

612 B | W: | H:

core/assets/common/screen/encyclopedia/gfx/play_icon.png
core/assets/common/screen/encyclopedia/gfx/play_icon.png
core/assets/common/screen/encyclopedia/gfx/play_icon.png
core/assets/common/screen/encyclopedia/gfx/play_icon.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/bankovniloupez_back.png

546 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/bankovniloupez_back.png

284 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/bankovniloupez_back.png
core/assets/common/screen/gamemenu/gfx/bankovniloupez_back.png
core/assets/common/screen/gamemenu/gfx/bankovniloupez_back.png
core/assets/common/screen/gamemenu/gfx/bankovniloupez_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/nocnisledovani_back.png

530 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/nocnisledovani_back.png

286 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/nocnisledovani_back.png
core/assets/common/screen/gamemenu/gfx/nocnisledovani_back.png
core/assets/common/screen/gamemenu/gfx/nocnisledovani_back.png
core/assets/common/screen/gamemenu/gfx/nocnisledovani_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/overscroll_left.png

76.6 KiB

core/assets/common/screen/gamemenu/gfx/overscroll_right.png

35.8 KiB

core/assets/common/screen/gamemenu/gfx/potme_back.png

696 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/potme_back.png

386 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/potme_back.png
core/assets/common/screen/gamemenu/gfx/potme_back.png
core/assets/common/screen/gamemenu/gfx/potme_back.png
core/assets/common/screen/gamemenu/gfx/potme_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/pronasledovani_back.png

681 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/pronasledovani_back.png

354 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/pronasledovani_back.png
core/assets/common/screen/gamemenu/gfx/pronasledovani_back.png
core/assets/common/screen/gamemenu/gfx/pronasledovani_back.png
core/assets/common/screen/gamemenu/gfx/pronasledovani_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/strelnice_back.png

482 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/strelnice_back.png

265 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/strelnice_back.png
core/assets/common/screen/gamemenu/gfx/strelnice_back.png
core/assets/common/screen/gamemenu/gfx/strelnice_back.png
core/assets/common/screen/gamemenu/gfx/strelnice_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/unos_back.png

540 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/unos_back.png

286 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/unos_back.png
core/assets/common/screen/gamemenu/gfx/unos_back.png
core/assets/common/screen/gamemenu/gfx/unos_back.png
core/assets/common/screen/gamemenu/gfx/unos_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/gamemenu/gfx/wall_back.png

607 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/wall_back.png

316 KiB | W: | H:

core/assets/common/screen/gamemenu/gfx/wall_back.png
core/assets/common/screen/gamemenu/gfx/wall_back.png
core/assets/common/screen/gamemenu/gfx/wall_back.png
core/assets/common/screen/gamemenu/gfx/wall_back.png
  • 2-up
  • Swipe
  • Onion skin
core/assets/common/screen/panorama/gfx/swipe/overscroll_right.png

19.7 KiB

......@@ -32,6 +32,8 @@ public class ApplicationInternalTextureManager extends TablexiaTextureManager {
public static final String BUTTON_DISABLED = BUTTON_PATH + "tablexiabutton_disabled" + NINE_PATCH_SUFFIX;
public static final String BUTTON_CLOSE_PRESSED = BUTTON_PATH + "closebutton_pressed" + PNG_SUFFIX;
public static final String BUTTON_CLOSE_UNPRESSED = BUTTON_PATH + "closebutton_unpressed" + PNG_SUFFIX;
public static final String BUTTON_YES_ICON = BUTTON_PATH + "yes_icon" + PNG_SUFFIX;
public static final String BUTTON_NO_ICON = BUTTON_PATH + "no_icon" + PNG_SUFFIX;
public enum InternalNinePatch {
......@@ -105,5 +107,7 @@ public class ApplicationInternalTextureManager extends TablexiaTextureManager {
loadTexture(BUTTON_BLUE_PRESSED);
loadTexture(BUTTON_CLOSE_PRESSED);
loadTexture(BUTTON_CLOSE_UNPRESSED);
loadTexture(BUTTON_YES_ICON);
loadTexture(BUTTON_NO_ICON);
}
}
......@@ -42,6 +42,7 @@ import cz.nic.tablexia.util.Point;
import cz.nic.tablexia.util.ScaleUtil;
import cz.nic.tablexia.util.Utility;
import cz.nic.tablexia.util.ui.ComponentScaleUtil;
import cz.nic.tablexia.util.ui.ScrollPaneWithBorders;
import cz.nic.tablexia.util.ui.TablexiaNoBlendingImage;
import cz.nic.tablexia.util.ui.dialog.TablexiaComponentDialog;
import cz.nic.tablexia.util.ui.dialog.TablexiaComponentDialogFactory;
......@@ -61,7 +62,7 @@ import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent;
* Screen showing street animation and office before user create form
*/
public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
private static Vector2 NEWSPAPER_TITLE_POSITION = new Vector2(0.26f, 0.197f);
private static Vector2 SIGN_POSITION = new Vector2(0.30f, 0.285f);
private static Vector2 PLATE_TITLE_POSITION = new Vector2(0.368f, 0.638f);
......@@ -77,6 +78,9 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
public static final String BALCONY_BLUR = GFX_PATH + "balcony_blur";
public static final String BALCONY_BLUR_WINTER = GFX_PATH + "balcony_blur_winter";
public static final String SWIPE_OVERSCROLL_RIGHT = GFX_PATH + "swipe/overscroll_right";
public static final Color SWIPE_OVERSCROLL_LEFT_COLOR = new Color(118/255f, 133/255f, 200/255f, 1);
private static final String NEWSPAPER_DETAIL = "newspaper/detail0";
public static final String SFX_NEWSPAPER_SPINNER = SFX_PATH + "noviny_prilet.mp3";
......@@ -91,31 +95,34 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
public static final String MUSIC_3 = MFX_PATH + "newspaper/3.mp3";
public static final String MUSIC_4 = MFX_PATH + "newspaper/4.mp3";
public static final float AMBIENT_SOUND_VOLUME = 0.5f;
public static final float AMBIENT_SOUND_VOLUME = 0.5f;
private static final String AMBIENT_RESTAURANT = MFX_PATH + "ambient/restaurant.mp3";
private static final String AMBIENT_STREET = MFX_PATH + "ambient/swipe_street.mp3";
private static final String AMBIENT_RESTAURANT = MFX_PATH + "ambient/restaurant.mp3";
private static final String AMBIENT_STREET = MFX_PATH + "ambient/swipe_street.mp3";
private static final int NUMBER_OF_NEWSPAPER_OPEN_FRAMES = 5;
private static final int NUMBER_OF_OFFICE_KNOCKS = 3;
private static final int NUMBER_OF_OFFICE_DIALOGS = 4;
private static final int NUMBER_OF_NEWSPAPER_OPEN_FRAMES = 5;
private static final int NUMBER_OF_OFFICE_KNOCKS = 3;
private static final int NUMBER_OF_OFFICE_DIALOGS = 4;
private static final Vector2 OFFICE_DIALOG_OFFSET = new Vector2(24, 12);
private static final int OFFICE_DIALOG_TEXT_PADDING_LEFT = 4;
private static final int OFFICE_DIALOG_TEXT_PADDING_RIGHT = 24;
private static final float OVERSCROLL_DISTANCE = 50;
private static final float OVERSCROLL_MIN_SPEED = 30;
private static final float OVERSCROLL_MAX_SPEED = 200;
private static final int NEWSPAPERS_SPEECH_DIALOG_OFFSET = 4;
private static final float NEWSPAPERS_SPEECH_DIALOG_OFFSET_MULTI = 0.6f;
private static final Vector2 OFFICE_DIALOG_OFFSET = new Vector2(24, 12);
private static final int OFFICE_DIALOG_TEXT_PADDING_LEFT = 4;
private static final int OFFICE_DIALOG_TEXT_PADDING_RIGHT = 24;
private static final float NEWSPAPER_DETAIL_DIALOG_DIMMER = 0.6f;
private static final int NEWSPAPERS_SPEECH_DIALOG_OFFSET = 4;
private static final float NEWSPAPERS_SPEECH_DIALOG_OFFSET_MULTI = 0.6f;
private static final float NEWSPAPER_DETAIL_DIALOG_DIMMER = 0.6f;
private static final float NEWS_DIALOG_MAX_WIDTH = 0.85f;
private static final float NEWS_DIALOG_MAX_HEIGHT = 0.85f;
private static final float NEWS_DIALOG_MAX_WIDTH = 0.85f;
private static final float NEWS_DIALOG_MAX_HEIGHT = 0.85f;
private TextureRegion clickmap;
private Group panel;
private ScrollPane scrollpane;
private ScrollPaneWithBorders scrollpane;
private Music ambient;
private Image leftFinger, rightFinger, hint;
......@@ -827,10 +834,16 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
detectiveDoor.setSize(tile3Background.getWidth(), tile3Background.getHeight());
group.add(detectiveDoor);
scrollpane = new ScrollPane(group);
TablexiaNoBlendingImage leftBorder = new TablexiaNoBlendingImage(ApplicationAtlasManager.getInstance().getColorTexture(SWIPE_OVERSCROLL_LEFT_COLOR));
leftBorder.setSize(OVERSCROLL_DISTANCE, getSceneInnerHeight());
TablexiaNoBlendingImage rightBorder = new TablexiaNoBlendingImage(getScreenTextureRegion(SWIPE_OVERSCROLL_RIGHT));
rightBorder.setHeight(getSceneInnerHeight());
scrollpane = new ScrollPaneWithBorders(group, leftBorder, rightBorder);
scrollpane.setFillParent(true);
scrollpane.setScrollingDisabled(false, true);
scrollpane.setupOverscroll(OVERSCROLL_DISTANCE, OVERSCROLL_MIN_SPEED, OVERSCROLL_MAX_SPEED);
return scrollpane;
}
......
......@@ -40,6 +40,9 @@ public final class GameMenuAssets {
public static final String BASE_ASSETS_SHOOTING_RANGE = "strelnice";
public static final String BASE_ASSETS_IN_THE_DARKNESS = "potme";
public static final String LEFT_OVERSCROLL = GFX_PATH + "overscroll_left";
public static final String RIGHT_OVERSCROLL = GFX_PATH + "overscroll_right";
public static final String BASE_ASSETS_FOREGROUND_POSTFIX = "fore";
public static final String BASE_ASSETS_MIDDLE_POSTFIX = "mid";
public static final String BASE_ASSETS_BACKGROUND_POSTFIX = "back";
......
......@@ -123,7 +123,10 @@ public class GameMenuScreen extends AbstractTablexiaScreen<int[][]> {
// /game menu pages list, which will be later used for turning on sounds after first scroll
final List<GameMenuPage> gameMenuPages = new ArrayList<GameMenuPage>();
pagedScrollPane = new PagedScrollPane();
Image leftBorder = new Image(getScreenTextureRegion(GameMenuAssets.LEFT_OVERSCROLL));
Image rightBorder = new Image(getScreenTextureRegion(GameMenuAssets.RIGHT_OVERSCROLL));
pagedScrollPane = new PagedScrollPane(leftBorder, rightBorder);
pagedScrollPane.setBounds(getSceneLeftX(), getSceneOuterBottomY(), getSceneWidth(), getSceneOuterHeight());
vignette = new Image(getScreenPatch(GameMenuAssets.VIGNETTE));
......
......@@ -8,9 +8,10 @@ import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import cz.nic.tablexia.screen.gamemenu.pages.MenuPage;
import cz.nic.tablexia.util.ui.ScrollPaneWithBorders;
/**
* Represents Horizontal Paged Scroll Pane
......@@ -18,8 +19,14 @@ import cz.nic.tablexia.screen.gamemenu.pages.MenuPage;
*
* Created by Drahomir Karchnak on 01/12/15.
*/
public class PagedScrollPane extends ScrollPane {
private static final int BACKGROUND_SPACING_WORKAROUND = -1;
public class PagedScrollPane extends ScrollPaneWithBorders {
private static final int BACKGROUND_SPACING_WORKAROUND = -1;
//TODO - This is overscroll workaround... If you use int distance (like 50) it renders weird gap between menu pages and borders...
private static final float OVERSCROLL_DISTANCE = 49.5f;
private static final float OVERSCROLL_MIN_SPEED = 30f;
private static final float OVERSCROLL_MAX_SPEED = 200f;
private static final int INITIAL_PAGE_NUMBER = GameMenuScreen.GameMenuPageDefinition.OFFICE_PAGE.getPageNumber();
private HorizontalGroup content;
......@@ -34,8 +41,8 @@ public class PagedScrollPane extends ScrollPane {
private int backgroundTotalWidth;
public PagedScrollPane() {
super(null);
public PagedScrollPane(Image leftBorder, Image rightBorder) {
super(null, leftBorder, rightBorder);
prepareScrollPane();
prepareInput();
......@@ -46,13 +53,14 @@ public class PagedScrollPane extends ScrollPane {
* Prepares ScrollPane and it's content
*/
private void prepareScrollPane() {
content = new HorizontalGroup();
content = new HorizontalGroup();
content.space(BACKGROUND_SPACING_WORKAROUND);
super.setWidget(content);
super.setWidget(content);
setFlingTime(0);
setScrollingDisabled(false, true);
setCancelTouchFocus(false);
setupOverscroll(OVERSCROLL_DISTANCE, OVERSCROLL_MIN_SPEED, OVERSCROLL_MAX_SPEED);
}
@Override
......@@ -93,7 +101,7 @@ public class PagedScrollPane extends ScrollPane {
//Is page visible ?
if(posX < getWidth() && posX + page.getWidth() > 0) {
batch.draw(page.getBackgroundTextureRegion(),
posX,
MathUtils.ceil(posX),
getY() + getHeight() - page.getBackgroundTextureRegion().getRegionHeight(),
backgroundWidth,
page.getBackgroundTextureRegion().getRegionHeight());
......
......@@ -99,8 +99,8 @@ public class GameMenuPage extends MenuPage {
private Music introSound;
//Can we play the step sounds on difficulty change ?
private boolean stepSoundsReady = false;
//Enabled playing sound steps on difficulty change
private boolean stepSoundsEnabled = false;
//Step sounds assets
private Music step_easy_medium, step_medium_easy;
......@@ -396,10 +396,8 @@ public class GameMenuPage extends MenuPage {
difficulty = GameDifficulty.DEFAULT_DIFFICULTY;
}
if(stepSoundsReady) {
if (stepSoundsEnabled) {
playStepSound(gameDifficulty, difficulty);
} else {
stepSoundsReady = true;
}
difficultyChanged(difficulty);
......@@ -417,6 +415,9 @@ public class GameMenuPage extends MenuPage {
});
gameDifficulty = TablexiaSettings.getInstance().getGameDifficulty(game);
dragSwitchListener.switchToStep(gameDifficulty.getDifficultyNumber() - 1);
//Enabling step sounds later
//so it doesn't play 'em when initially setting difficulties from database...
stepSoundsEnabled = true;
}
/**
......@@ -568,4 +569,4 @@ public class GameMenuPage extends MenuPage {
public void setIsFirstLogin(boolean isFirstLogin) {
this.isFirstLogin = isFirstLogin;
}
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment