Skip to content
Snippets Groups Projects
Commit f5a470d4 authored by Drahomír Karchňák's avatar Drahomír Karchňák
Browse files

Merge branch 'devel' into feature-panoramascreen

parents c9a382d2 f4ed89e4
No related branches found
No related tags found
No related merge requests found
Showing
with 106 additions and 39 deletions
android/assets/gfx/bar_foreground.png

742 B | W: | H:

android/assets/gfx/bar_foreground.png

6.29 KiB | W: | H:

android/assets/gfx/bar_foreground.png
android/assets/gfx/bar_foreground.png
android/assets/gfx/bar_foreground.png
android/assets/gfx/bar_foreground.png
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/launch_cs.png

23.7 KiB | W: | H:

android/assets/gfx/launch_cs.png

14.2 KiB | W: | H:

android/assets/gfx/launch_cs.png
android/assets/gfx/launch_cs.png
android/assets/gfx/launch_cs.png
android/assets/gfx/launch_cs.png
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/launch_de.png

24 KiB | W: | H:

android/assets/gfx/launch_de.png

15.7 KiB | W: | H:

android/assets/gfx/launch_de.png
android/assets/gfx/launch_de.png
android/assets/gfx/launch_de.png
android/assets/gfx/launch_de.png
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/launch_sk.png

23.4 KiB | W: | H:

android/assets/gfx/launch_sk.png

14.3 KiB | W: | H:

android/assets/gfx/launch_sk.png
android/assets/gfx/launch_sk.png
android/assets/gfx/launch_sk.png
android/assets/gfx/launch_sk.png
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/lines_de.png

46 KiB | W: | H:

android/assets/gfx/lines_de.png

46.9 KiB | W: | H:

android/assets/gfx/lines_de.png
android/assets/gfx/lines_de.png
android/assets/gfx/lines_de.png
android/assets/gfx/lines_de.png
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/lines_sk.png

46 KiB | W: | H:

android/assets/gfx/lines_sk.png

51.5 KiB | W: | H:

android/assets/gfx/lines_sk.png
android/assets/gfx/lines_sk.png
android/assets/gfx/lines_sk.png
android/assets/gfx/lines_sk.png
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/login_cs.png

28.3 KiB

android/assets/gfx/login_de.png

41.1 KiB

android/assets/gfx/login_sk.png

44.2 KiB

android/assets/gfx/screen_loader_background.jpg

748 KiB | W: | H:

android/assets/gfx/screen_loader_background.jpg

745 KiB | W: | H:

android/assets/gfx/screen_loader_background.jpg
android/assets/gfx/screen_loader_background.jpg
android/assets/gfx/screen_loader_background.jpg
android/assets/gfx/screen_loader_background.jpg
  • 2-up
  • Swipe
  • Onion skin
android/assets/gfx/screen_loader_background_winter.jpg

740 KiB

......@@ -5,8 +5,11 @@ language_german=Němčina
system_exit=Konec
system_retry=Znovu
system_confirm=Potvrdit
zipassetloader_error=Chyba: Nemohu stáhnout dodatečná data! Zkontrolujte prosím připojení k internetu.
zipassetloader_download_request: Právě využíváte mobilní připojení k internetu. Tablexia potřebuje stáhnout ~150 MB herních dat. Přejete si je stáhnout nyní ?
zipassetloader_not_enough_space Na vašem zařízení není dostatek volného místa pro uložení potřebných souborů hry.
mainmenu_games=Hry
mainmenu_halloffame=Síň slávy
......@@ -148,4 +151,4 @@ user_consecutivelyallgames0stars_description=Za hraní všech her v jeden den
user_consecutivelyallgames2stars=Hlídací pes
user_consecutivelyallgames2stars_description=Za všechny hry po sobě na střední obtížnost a tři poháry
user_consecutivelyallgames3stars=Detektivní šelma
user_consecutivelyallgames3stars_description=Za všechny hry po sobě na těžkou obtížnost a tři poháry
\ No newline at end of file
user_consecutivelyallgames3stars_description=Za všechny hry po sobě na těžkou obtížnost a tři poháry
......@@ -5,8 +5,11 @@ language_german=Deutsch
system_exit=Verlassen
system_retry=Wieder
system_confirm=Bestätigen
zipassetloader_error=Fehler: Nicht, um zusätzliche Daten Download! Bitte überprüfen Sie Ihre Internetverbindung.
zipassetloader_download_request: [DE - Upravit v application_de.properities] Právě využíváte mobilní připojení k internetu. Tablexia potřebuje stáhnout ~150 MB herních dat. Přejete si je stáhnout nyní ?
zipassetloader_not_enough_space [DE - Upravit v application_de.properities] Na vašem zařízení není dostatek volného místa pro uložení potřebných souborů hry.
mainmenu_games=Spiele
mainmenu_halloffame=Ruhmeshalle
......@@ -148,4 +151,4 @@ user_consecutivelyallgames0stars_description=Für das Spielen aller Spiele an ei
user_consecutivelyallgames2stars=Wachhund
user_consecutivelyallgames2stars_description=Für alle Spiele nacheinander auf der mittleren Stufe mit drei Pokalen
user_consecutivelyallgames3stars=Als Detektiv ein Raubtier
user_consecutivelyallgames3stars_description=Für alle Spiele nacheinander auf der schwierigen Stufe mit drei Pokalen
\ No newline at end of file
user_consecutivelyallgames3stars_description=Für alle Spiele nacheinander auf der schwierigen Stufe mit drei Pokalen
......@@ -5,8 +5,11 @@ language_german=Nemčina
system_exit=Koniec
system_retry=Znovu
system_confirm=Potvrdiť
zipassetloader_error=Chyba: Nemôžem stiahnuť dodatočná dáta! Skontrolujte prosím pripojenie k internetu.
zipassetloader_download_request: [SK upravit v application_sk.properties] Právě využíváte mobilní připojení k internetu. Tablexia potřebuje stáhnout ~150 MB herních dat. Přejete si je stáhnout nyní ?
zipassetloader_not_enough_space [SK upravit v application_sk.properties] Na vašem zařízení není dostatek volného místa pro uložení potřebných souborů hry.
mainmenu_games=Hry
mainmenu_halloffame=Sieň slávy
......
package cz.nic.tablexia.android;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.net.ConnectivityManager;
import android.os.Bundle;
import com.badlogic.gdx.Gdx;
......@@ -16,6 +18,7 @@ import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.TablexiaBuildConfig;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.debug.BuildConfig;
import cz.nic.tablexia.screen.loader.IConnectionManager;
import cz.nic.tablexia.util.Log;
public class AndroidLauncher extends AndroidApplication {
......@@ -38,6 +41,8 @@ public class AndroidLauncher extends AndroidApplication {
FlurryAgent.setVersionName(TablexiaSettings.getInstance().getFullName());
FlurryAgent.init(this, TablexiaBuildConfig.FLURRY_KEY);
}
Tablexia.connectionManager = new AndroidConnectionManager(getContext());
}
/**
......@@ -75,4 +80,33 @@ public class AndroidLauncher extends AndroidApplication {
});
}
private static class AndroidConnectionManager implements IConnectionManager {
private Context androidContext;
public AndroidConnectionManager(Context androidContext) {
this.androidContext = androidContext;
}
@Override
public boolean isUsingMobileData() {
ConnectivityManager conMan = (ConnectivityManager) androidContext.getSystemService(Context.CONNECTIVITY_SERVICE);
//We are not connected to the internet at all...
if(conMan == null || conMan.getActiveNetworkInfo() == null)
return false;
//Is user using any of mobile internet types ? Hope I didn't miss any...
switch (conMan.getActiveNetworkInfo().getType()) {
case ConnectivityManager.TYPE_MOBILE:
case ConnectivityManager.TYPE_MOBILE_DUN:
case ConnectivityManager.TYPE_MOBILE_HIPRI:
case ConnectivityManager.TYPE_MOBILE_MMS:
case ConnectivityManager.TYPE_MOBILE_SUPL:
return true;
default:
return false;
}
}
}
}
......@@ -18,12 +18,14 @@ import java.util.Map;
import cz.nic.tablexia.bus.ApplicationBus;
import cz.nic.tablexia.bus.ApplicationBus.ApplicationEvent;
import cz.nic.tablexia.loader.application.ApplicationAtlasManager;
import cz.nic.tablexia.loader.application.ApplicationExternalSoundManager;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
import cz.nic.tablexia.loader.application.ApplicationSoundManager;
import cz.nic.tablexia.loader.application.ApplicationInternalSoundManager;
import cz.nic.tablexia.loader.application.ApplicationTextManager;
import cz.nic.tablexia.loader.zip.ZipAssetLoader;
import cz.nic.tablexia.menu.MenuController;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.screen.loader.IConnectionManager;
import cz.nic.tablexia.util.Log;
import cz.nic.tablexia.util.Utility;
import cz.nic.tablexia.util.ui.TablexiaButton;
......@@ -36,7 +38,7 @@ import cz.nic.tablexia.util.ui.dialog.text.DialogTextContent;
*/
public class Tablexia extends TablexiaApplication {
private static final String INTERNAL_GFX_ASSETS_PATH = "gfx/";
public static final String INTERNAL_GFX_ASSETS_PATH = "gfx/";
public static final String ERROR_DIALOG_BACKGROUND_INTERNAL = INTERNAL_GFX_ASSETS_PATH + "dialog_square_borderlines.9.png";
public static final String ERROR_BUTTON_BLUE_UNPRESSED_INTERNAL = INTERNAL_GFX_ASSETS_PATH + "tablexiabutton_blank_blue_unpressed.9.png";
public static final String ERROR_BUTTON_BLUE_PRESSED_INTERNAL = INTERNAL_GFX_ASSETS_PATH + "tablexiabutton_blank_blue_pressed.9.png";
......@@ -45,6 +47,8 @@ public class Tablexia extends TablexiaApplication {
public static final int ERROR_DIALOG_WIDTH = 400;
public static final int ERROR_DIALOG_HEIGHT = 250;
public static IConnectionManager connectionManager;
private final SQLConnectionType sqlConnectionType;
private MenuController menuController;
private ZipAssetLoader zipAssetLoader;
......@@ -119,14 +123,17 @@ public class Tablexia extends TablexiaApplication {
setScreenIfIsDifferent(Utility.getScreenForScreenClass(TablexiaSettings.LOADER_SCREEN, null));
// async internal assets loading
ApplicationFontManager.getInstance().load();
ApplicationTextManager.getInstance().load(locale);
// async zip extraction
zipAssetLoader = new ZipAssetLoader();
zipAssetLoader.load(locale, Utility.createChecksumMapFromString(TablexiaBuildConfig.ASSETS_CHECKSUM));
// async external assets loading
ApplicationAtlasManager.getInstance().load();
ApplicationSoundManager.getInstance().load();
ApplicationFontManager.getInstance().load();
ApplicationTextManager.getInstance().load(locale);
ApplicationInternalSoundManager.getInstance().load();
// async zip extraction
zipAssetLoader = new ZipAssetLoader(getStage());
zipAssetLoader.load(locale, Utility.createChecksumMapFromString(TablexiaBuildConfig.ASSETS_CHECKSUM));
// async external assets loading
ApplicationExternalSoundManager.getInstance().load();
ApplicationAtlasManager.getInstance().load();
loadingComplete = false;
}
......@@ -142,10 +149,11 @@ public class Tablexia extends TablexiaApplication {
// dispose all loaders
ApplicationFontManager.getInstance().dispose();
ApplicationTextManager.getInstance().dispose();
zipAssetLoader.dispose();
zipAssetLoader = null;
ApplicationAtlasManager.getInstance().dispose();
ApplicationSoundManager.getInstance().dispose();
ApplicationExternalSoundManager.getInstance().dispose();
zipAssetLoader.dispose();
zipAssetLoader = null;
ApplicationAtlasManager.getInstance().dispose();
ApplicationInternalSoundManager.getInstance().dispose();
}
......@@ -224,15 +232,16 @@ public class Tablexia extends TablexiaApplication {
// process loading
if (!loadingComplete) {
// load internal assets
if (!ApplicationFontManager.getInstance().update()) return;
if (!ApplicationTextManager.getInstance().update()) return;
if (!ApplicationFontManager.getInstance().update()) return;
if (!ApplicationTextManager.getInstance().update()) return;
if (!ApplicationInternalSoundManager.getInstance().update()) return;
// load external assets
if (!zipAssetLoader.update()) return;
if (processLoaderError(zipAssetLoader.getError())) return;
// load external assets
if (!zipAssetLoader.update()) return;
if (processLoaderError(zipAssetLoader.getError())) return;
if (!ApplicationAtlasManager.getInstance().update()) return;
if (!ApplicationSoundManager.getInstance().update()) return;
if (!ApplicationExternalSoundManager.getInstance().update()) return;
if (!ApplicationAtlasManager.getInstance().update()) return;
prepareMenu();
loadingComplete();
......@@ -396,4 +405,4 @@ public class Tablexia extends TablexiaApplication {
}
});
}
}
}
\ No newline at end of file
......@@ -5,6 +5,8 @@ import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.scenes.scene2d.Stage;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import cz.nic.tablexia.bus.ApplicationBus;
......@@ -18,7 +20,6 @@ import cz.nic.tablexia.screen.loader.LoaderScreen;
import cz.nic.tablexia.util.Log;
public class TablexiaSettings {
private static final int DEFAULT_SCREEN_WIDTH = 1000;
private static final double MAXIMUM_RATIO = 9.0 / 16.0;
private static final int MIN_SCREEN_HEIGHT = (int) (DEFAULT_SCREEN_WIDTH * MAXIMUM_RATIO);
......@@ -36,6 +37,12 @@ public class TablexiaSettings {
public static final String LOCALE_KEY = "locale";
private static final String SELECTED_USER = "selected_user";
//Interval <start month; end month>
private static final int WINTER_MODE_START_MONTH = 10;
private static final int WINTER_MODE_END_MONTH = 1;
private static boolean winterMode = false;
public static final String DEV_VERSION_TYPE = "-SNAPSHOT-";
......@@ -164,7 +171,10 @@ public class TablexiaSettings {
preferences = Gdx.app.getPreferences(PREFERENCES_KEY + BUILD_TYPE.getKey());
selectedLocale = LocaleDefinition.getLocaleDefinitionForKey(preferences.getString(LOCALE_KEY));
selectedUser = reset ? null : User.selectUser(preferences.getLong(SELECTED_USER));
}
Calendar calendar = GregorianCalendar.getInstance();
winterMode = (calendar.get(Calendar.MONTH) > WINTER_MODE_START_MONTH) || (calendar.get(Calendar.MONTH) < WINTER_MODE_END_MONTH);
}
//////////////////////////// SETTINGS ACCESS
......@@ -181,6 +191,8 @@ public class TablexiaSettings {
return VERSION_NAME;
}
public boolean isWinterMode() { return winterMode; }
public boolean isShowBoundingBoxes() {
return getBuildType().isBoundingBoxes();
}
......
......@@ -15,7 +15,7 @@ import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.TablexiaApplication;
import cz.nic.tablexia.bus.ApplicationBus;
import cz.nic.tablexia.loader.application.ApplicationFontManager;
import cz.nic.tablexia.loader.application.ApplicationSoundManager;
import cz.nic.tablexia.loader.application.ApplicationInternalSoundManager;
import cz.nic.tablexia.loader.application.ApplicationTextManager;
import cz.nic.tablexia.screen.halloffame.HallOfFameScreen;
import cz.nic.tablexia.util.Point;
......@@ -78,7 +78,7 @@ public class TrophyReceivedDialog extends TablexiaDialog {
@Override
public void clicked(InputEvent event, float x, float y) {
if ((x >= 0 || x <= (dialogWidth)) || (y >= 0 || y <= dialogHeight)) {
ApplicationSoundManager.getInstance().getSound(ApplicationSoundManager.MAINMENU_BUTTON).play();
ApplicationInternalSoundManager.getInstance().getSound(ApplicationInternalSoundManager.BUTTON_CLICKED).play();
HashMap<String, String> screenState = new HashMap<String, String>();
screenState.put(HallOfFameScreen.SCROLL_TO_TROPHY_KEY, trophy.name());
ApplicationBus.getInstance().post(new Tablexia.ChangeScreenEvent(HallOfFameScreen.class, TablexiaApplication.ScreenTransaction.FADE, screenState)).asynchronously();
......
......@@ -6,16 +6,21 @@ import cz.nic.tablexia.loader.IApplicationLoader;
import cz.nic.tablexia.loader.TablexiaSoundManager;
import cz.nic.tablexia.util.Utility;
/**
* Application Sounds Manager, which is loading sounds from the internal path...
* Useful for sounds that you need to play before game has downloaded all the assets
*/
public class ApplicationExternalSoundManager extends TablexiaSoundManager implements IApplicationLoader {
public class ApplicationSoundManager extends TablexiaSoundManager implements IApplicationLoader {
private static ApplicationExternalSoundManager instance;
private static ApplicationSoundManager instance;
private ApplicationSoundManager() {}
private ApplicationExternalSoundManager() {
super(AssetsStorageType.EXTERNAL);
}
public static ApplicationSoundManager getInstance() {
public static ApplicationExternalSoundManager getInstance() {
if (instance == null) {
instance = new ApplicationSoundManager();
instance = new ApplicationExternalSoundManager();
}
return instance;
}
......@@ -26,17 +31,15 @@ public class ApplicationSoundManager extends TablexiaSoundManager implements IAp
instance = null;
}
private static final String APPLICATION_PATH = "_global/application/";
private static final String MAINMENU_PATH = "mainmenu/";
private static final String APPLICATION_PATH = "_global/application/";
private static final String MAINMENU_PATH = "mainmenu/";
public static final String MAINMENU_OPEN = MAINMENU_PATH + "mainmenu_open.mp3";
public static final String MAINMENU_CLOSE = MAINMENU_PATH + "mainmenu_close.mp3";
public static final String MAINMENU_BUTTON = MAINMENU_PATH + "mainmenu_button.mp3";
public void load() {
loadSound(MAINMENU_OPEN);
loadSound(MAINMENU_CLOSE);
loadSound(MAINMENU_BUTTON);
}
private String createAssetPath(String fileName) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment