Commit 8d33cf69 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'V3.6.3' into 907-doplnit-gdpr

parents 5a0ed053 0b6ee040
...@@ -15,47 +15,68 @@ ...@@ -15,47 +15,68 @@
before_script: before_script:
- ./gradlew unlockIOSKeyChain - ./gradlew unlockIOSKeyChain
- git submodule update --init --recursive - git submodule update --init --recursive
stages: stages:
- build - build
- unitTest - unitTest
- iTest-desktop - iTest-desktop
pre-release:
# Development build
# Runs for every commit
# Connects to development server
dev_debug:
stage: build
except:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
expire_in: 2 weeks
paths:
- android/build/outputs/apk/*debug*.apk
- android/build/outputs/apk/*iTest*.apk
- ios/build/robovm/*debug*.ipa
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
# Release debug build
# Runs only on tags
# Connects to development server
release-debug:
stage: build stage: build
only: only:
- master - tags
- devel
script: script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true - ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts: artifacts:
paths: paths:
- android/build/outputs/apk/*debug*.apk - android/build/outputs/apk/*debug*.apk
- android/build/outputs/apk/*iTest*.apk
- ios/build/robovm/*debug*.ipa - ios/build/robovm/*debug*.ipa
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
- desktop/build/libs/*iTest*.jar
- desktop/build/libs/*debug*.deb - desktop/build/libs/*debug*.deb
- desktop/build/outputs/*debug*.exe - desktop/build/outputs/*debug*.exe
- desktop/build/outputApp/*debug*.app
debug: # Actual release build
# Runs only on tags
# Connects to production server
# -PTABLEXIA_RELEASE_BUILD=true - Tells Tablexia to use production server
release:
stage: build stage: build
except: only:
- pre-release - tags
- release
script: script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true - ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_RELEASE_BUILD=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts: artifacts:
expire_in: 2 weeks paths:
paths: - android/build/outputs/apk/*release*.apk
- android/build/outputs/apk/*debug*.apk - ios/build/robovm/*release*.ipa
- android/build/outputs/apk/*iTest*.apk - desktop/build/libs/*release*.deb
- ios/build/robovm/*debug*.ipa - desktop/build/outputs/*release*.exe
- ios/build/robovm/*iTest*.ipa
- desktop/build/libs/*debug*.jar
unitTest: unitTest:
stage: unitTest stage: unitTest
script: script:
- ./gradlew test -x prepareAssets -x prepareGraphicAssets -x prepareSoundAssets -x prepareJsonAssets -x processAssets -x runChecksum - ./gradlew test -x prepareAssets -x prepareGraphicAssets -x prepareSoundAssets -x prepareJsonAssets -x processAssets -x runChecksum
iTest-desktop: iTest-desktop:
stage: iTest-desktop stage: iTest-desktop
script: script:
...@@ -65,18 +86,4 @@ iTest-desktop: ...@@ -65,18 +86,4 @@ iTest-desktop:
expire_in: 3 days expire_in: 3 days
paths: paths:
- desktop/build/libs/iTest_results/*.log - desktop/build/libs/iTest_results/*.log
- desktop/build/libs/iTest_results/*error.png - desktop/build/libs/iTest_results/*error.png
release: \ No newline at end of file
stage: build
only:
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true
artifacts:
paths:
- android/build/outputs/apk/*release*.apk
- ios/build/robovm/*release*.ipa
- desktop/build/libs/*release*.jar
- desktop/build/libs/*release*.deb
- desktop/build/outputs/*release*.exe
- desktop/build/outputApp/*release*.app
This diff is collapsed.
...@@ -32,8 +32,8 @@ import net.engio.mbassy.listener.Handler; ...@@ -32,8 +32,8 @@ import net.engio.mbassy.listener.Handler;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -156,7 +156,7 @@ public class Tablexia extends TablexiaApplication { ...@@ -156,7 +156,7 @@ public class Tablexia extends TablexiaApplication {
this(buildType, systemLocale, sqlConnectionType, connManager, cameraOpener, fileSystemManager, qrCodeScanner, sentryDSN, hasSoftBackButton, supportAlternativeControls, reset, hwSerial, DEFAULT_HD_ASSETS); this(buildType, systemLocale, sqlConnectionType, connManager, cameraOpener, fileSystemManager, qrCodeScanner, sentryDSN, hasSoftBackButton, supportAlternativeControls, reset, hwSerial, DEFAULT_HD_ASSETS);
} }
public Tablexia(String buildType, Locale systemLocale, SQLConnectionType sqlConnectionType, IConnectionManager connManager, CameraOpener cameraOpener, IFileSystemManager fileSystemManager, public Tablexia(String buildType, Locale systemLocale, SQLConnectionType sqlConnectionType, IConnectionManager connManager, CameraOpener cameraOpener, IFileSystemManager fileSystemManager,
QRCodeScanner qrCodeScanner, String sentryDSN, boolean hasSoftBackButton, boolean supportAlternativeControls, boolean reset, String hwSerial, boolean hdAssets) { QRCodeScanner qrCodeScanner, String sentryDSN, boolean hasSoftBackButton, boolean supportAlternativeControls, boolean reset, String hwSerial, boolean hdAssets) {
this.reset = reset; this.reset = reset;
this.connectionManager = validateConnectionManager(connManager); this.connectionManager = validateConnectionManager(connManager);
...@@ -186,15 +186,16 @@ public class Tablexia extends TablexiaApplication { ...@@ -186,15 +186,16 @@ public class Tablexia extends TablexiaApplication {
} }
private void initializeLogging() { private void initializeLogging() {
if(TablexiaSettings.getInstance().getBuildType().isLogFile()) { if (TablexiaSettings.getInstance().getBuildType().isLogFile()) {
try { try {
File file = new File(TablexiaAbstractFileManager.RootStorageType.LOCAL.getStoragePath(), LOG_FILE_NAME); File file = TablexiaAbstractFileManager.RootStorageType.LOCAL.getResolver().resolve(TablexiaAbstractFileManager.RootStorageType.LOCAL.getStoragePath() + LOG_FILE_NAME).file();
if(file.exists()) file.mkdirs(); if (file.exists()) file.delete();
file.getParentFile().mkdirs();
file.createNewFile();
PrintStream stream = new PrintStream(new FileOutputStream(file)); PrintStream stream = new PrintStream(new FileOutputStream(file));
TeeStream teeStream = new TeeStream(System.out, stream); TeeStream teeStream = new TeeStream(System.out, stream);
System.setOut(new PrintStream(teeStream)); System.setOut(new PrintStream(teeStream));
} catch (FileNotFoundException e) { } catch (IOException e) {
Log.info(getClass(), "Cannot create a log file!"); Log.info(getClass(), "Cannot create a log file!");
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -463,8 +463,8 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> { ...@@ -463,8 +463,8 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
highlightedGameObjectLayer.addActor(gameObject); highlightedGameObjectLayer.addActor(gameObject);
gameObject.getAction().setBounds(0, 0, ACTION_CARD_EXTRA_LARGE, ACTION_CARD_EXTRA_LARGE); gameObject.getAction().setBounds(0, 0, ACTION_CARD_EXTRA_LARGE, ACTION_CARD_EXTRA_LARGE);
gameObject.setPosition(getViewportWidth() / 2 - ACTION_CARD_EXTRA_LARGE / 2 - actionsStripWidget.getWidth() / 2, gameObject.setPosition(getViewportWidth() / 2 - gameObject.getAction().getWidth() / 2 - actionsStripWidget.getWidth() / 2,
getViewportHeight() / 2 - ACTION_CARD_EXTRA_LARGE / 2); getViewportHeight() / 2 - gameObject.getAction().getHeight() / 2);
setDimmerVisible(true); setDimmerVisible(true);
replayMusic(gameObject); replayMusic(gameObject);
......
...@@ -24,12 +24,14 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent; ...@@ -24,12 +24,14 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.utils.DragListener; import com.badlogic.gdx.scenes.scene2d.utils.DragListener;
import com.badlogic.gdx.utils.Timer; import com.badlogic.gdx.utils.Timer;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.AbstractTablexiaGame; import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.util.entity.Touch; import cz.nic.tablexia.util.entity.Touch;
class DesktopCrimeSceneAction extends CrimeSceneAction { class DesktopCrimeSceneAction extends CrimeSceneAction {
private static final float DELAY = 0.15f; private static final float DELAY = 0.15f;
private static final float DEFAULT_DESKTOP_DOWNSCALE = 0.45f;
private Touch lastRecordedTouchDown; private Touch lastRecordedTouchDown;
private boolean lastTapValid; private boolean lastTapValid;
...@@ -40,6 +42,9 @@ class DesktopCrimeSceneAction extends CrimeSceneAction { ...@@ -40,6 +42,9 @@ class DesktopCrimeSceneAction extends CrimeSceneAction {
public DesktopCrimeSceneAction(String texturePath, int orderNumber, int actionSize, AbstractTablexiaGame tablexiaGame, int actionNumber, GameObject gameObject) { public DesktopCrimeSceneAction(String texturePath, int orderNumber, int actionSize, AbstractTablexiaGame tablexiaGame, int actionNumber, GameObject gameObject) {
super(texturePath, orderNumber, actionSize, tablexiaGame, actionNumber, gameObject); super(texturePath, orderNumber, actionSize, tablexiaGame, actionNumber, gameObject);
if (TablexiaSettings.getInstance().isUseHdAssets()){
setSize(getWidth() * DEFAULT_DESKTOP_DOWNSCALE, getHeight() * DEFAULT_DESKTOP_DOWNSCALE);
}
timer = new Timer(); timer = new Timer();
} }
......
...@@ -27,6 +27,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image; ...@@ -27,6 +27,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Align;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.games.protocol.ProtocolGame; import cz.nic.tablexia.game.games.protocol.ProtocolGame;
import cz.nic.tablexia.game.games.protocol.controller.RoomPosition; import cz.nic.tablexia.game.games.protocol.controller.RoomPosition;
import cz.nic.tablexia.game.games.protocol.gameobjects.furniture.Furniture; import cz.nic.tablexia.game.games.protocol.gameobjects.furniture.Furniture;
...@@ -65,6 +66,9 @@ public class GameObject extends ObjectModel { ...@@ -65,6 +66,9 @@ public class GameObject extends ObjectModel {
private static final float LABEL_WITH_RATIO = 0.95f; private static final float LABEL_WITH_RATIO = 0.95f;
private static final float LABEL_PADDING_BOTTOM = 18f; private static final float LABEL_PADDING_BOTTOM = 18f;
private static final float DEFAULT_SCALE_NONE = 1f;
private static final float DEFAULT_SCALE_DESKTOP_HD = 0.45f;
private boolean biggerScale = false; private boolean biggerScale = false;
private boolean inRoom = false; private boolean inRoom = false;
...@@ -149,9 +153,10 @@ public class GameObject extends ObjectModel { ...@@ -149,9 +153,10 @@ public class GameObject extends ObjectModel {
} }
private void changeSize() { private void changeSize() {
if (isInRoom()) if (isInRoom()) {
objectImage.setSize(objectImage.getDrawable().getMinWidth(), objectImage.getDrawable().getMinHeight()); float scaleFactor = TablexiaSettings.getInstance().isUseHdAssets() ? DEFAULT_SCALE_DESKTOP_HD : DEFAULT_SCALE_NONE;
else objectImage.setSize(objectImage.getDrawable().getMinWidth() * scaleFactor, objectImage.getDrawable().getMinHeight() * scaleFactor);
} else
objectImage.setSize(ProtocolGame.CARD_SMALL_SIZE, ProtocolGame.CARD_SMALL_SIZE); objectImage.setSize(ProtocolGame.CARD_SMALL_SIZE, ProtocolGame.CARD_SMALL_SIZE);
} }
......
...@@ -26,6 +26,7 @@ import java.util.ArrayList; ...@@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.games.protocol.controller.RoomPosition; import cz.nic.tablexia.game.games.protocol.controller.RoomPosition;
import cz.nic.tablexia.game.games.protocol.gameobjects.ObjectModel; import cz.nic.tablexia.game.games.protocol.gameobjects.ObjectModel;
import cz.nic.tablexia.game.games.protocol.utils.ObjectsPositionComparator; import cz.nic.tablexia.game.games.protocol.utils.ObjectsPositionComparator;
...@@ -42,14 +43,19 @@ public class Furniture extends ObjectModel { ...@@ -42,14 +43,19 @@ public class Furniture extends ObjectModel {
private List<ObjectModel> objectOnFurniture; private List<ObjectModel> objectOnFurniture;
private static final float DEFAULT_SCALE_NONE = 1f;
private static final float DEFAULT_SCALE_DESKTOP_HD = 0.45f;
public Furniture(FurnitureType type, TextureRegion texture, float resizePercent) { public Furniture(FurnitureType type, TextureRegion texture, float resizePercent) {
this.type = type; this.type = type;
this.texture = texture; this.texture = texture;
furnitureImage = new Image(texture); furnitureImage = new Image(texture);
furnitureImage.setWidth((furnitureImage.getDrawable().getMinWidth() * resizePercent) / 100); float scaleFactor = TablexiaSettings.getInstance().isUseHdAssets() ? DEFAULT_SCALE_DESKTOP_HD : DEFAULT_SCALE_NONE;
furnitureImage.setHeight((furnitureImage.getDrawable().getMinHeight() * resizePercent / 100));
furnitureImage.setWidth((furnitureImage.getDrawable().getMinWidth() * resizePercent * scaleFactor) / 100);
furnitureImage.setHeight((furnitureImage.getDrawable().getMinHeight() * resizePercent * scaleFactor) / 100);
float xMiddle = furnitureImage.getWidth() * type.getMiddleRatio()[0] - 5; float xMiddle = furnitureImage.getWidth() * type.getMiddleRatio()[0] - 5;
float yMiddle = furnitureImage.getHeight() * type.getMiddleRatio()[1] - 5; float yMiddle = furnitureImage.getHeight() * type.getMiddleRatio()[1] - 5;
......
...@@ -165,14 +165,14 @@ public class RunesHolder extends Group { ...@@ -165,14 +165,14 @@ public class RunesHolder extends Group {
} }
public void unfold() { public void unfold() {
if (folded) { if (folded && getStage() != null) {
for (Actor a : getChildren()) { for (Actor a : getChildren()) {
a.setTouchable(Touchable.enabled); a.setTouchable(Touchable.enabled);
} }
setTouchable(Touchable.childrenOnly); setTouchable(Touchable.childrenOnly);
toFront(); toFront();
prevX = getX(); prevX = getX();
float stageWidth = getStage().getWidth() * (1-RunesGame.SIDEBAR_RELATIVE_WIDTH); float stageWidth = getStage().getWidth() * (1 - RunesGame.SIDEBAR_RELATIVE_WIDTH);
float prevMid = prevX + getWidth() * 0.5f * getScaleX(); float prevMid = prevX + getWidth() * 0.5f * getScaleX();
setScale(UNFOLDED_SCALE); setScale(UNFOLDED_SCALE);
float newX = prevMid - getWidth() * getScaleX() * 0.5f; float newX = prevMid - getWidth() * getScaleX() * 0.5f;
......
...@@ -725,12 +725,4 @@ public abstract class AbstractMenu extends Stack implements Disposable { ...@@ -725,12 +725,4 @@ public abstract class AbstractMenu extends Stack implements Disposable {
} }
}; };
//////////////////////////// MENU SCROLL
public ScrollPane getScrollPaneByDevice(Actor widget){
if(TablexiaSettings.getInstance().getPlatform() != TablexiaSettings.Platform.DESKTOP)
return new ScrollPane(widget);
return new ScrollPaneWithBars(widget, false, true);
}
} }
...@@ -41,6 +41,7 @@ import cz.nic.tablexia.menu.AbstractMenu; ...@@ -41,6 +41,7 @@ import cz.nic.tablexia.menu.AbstractMenu;
import cz.nic.tablexia.menu.IMenuItem; import cz.nic.tablexia.menu.IMenuItem;
import cz.nic.tablexia.menu.main.user.UserSelectBox; import cz.nic.tablexia.menu.main.user.UserSelectBox;
import cz.nic.tablexia.util.ui.dialog.TablexiaComponentDialog; import cz.nic.tablexia.util.ui.dialog.TablexiaComponentDialog;
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
/** /**
* MainMenu container * MainMenu container
...@@ -121,7 +122,7 @@ public class MainMenu extends AbstractMenu { ...@@ -121,7 +122,7 @@ public class MainMenu extends AbstractMenu {
Table layoutTable = new Table(); Table layoutTable = new Table();
UserSelectBox userSelectBox = new UserSelectBox(SELECTBOX_USER_HEIGHT); UserSelectBox userSelectBox = new UserSelectBox(SELECTBOX_USER_HEIGHT);
scrollPane = getScrollPaneByDevice(mainMenuVerticalGroup); scrollPane = new ScrollPaneWithBars(mainMenuVerticalGroup, false, true);
scrollPane.setFillParent(true); scrollPane.setFillParent(true);
scrollPaneContainer = new Container(); scrollPaneContainer = new Container();
......
...@@ -68,6 +68,7 @@ import cz.nic.tablexia.util.ui.dialog.components.TextContentDialogComponent; ...@@ -68,6 +68,7 @@ import cz.nic.tablexia.util.ui.dialog.components.TextContentDialogComponent;
import cz.nic.tablexia.util.ui.dialog.components.TwoButtonContentDialogComponent; import cz.nic.tablexia.util.ui.dialog.components.TwoButtonContentDialogComponent;
import cz.nic.tablexia.util.ui.dialog.components.UserUuidSyncDialogComponent; import cz.nic.tablexia.util.ui.dialog.components.UserUuidSyncDialogComponent;
import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent; import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent;
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
/** /**
* UserMenu container * UserMenu container
...@@ -228,7 +229,7 @@ public class UserMenu extends AbstractMenu { ...@@ -228,7 +229,7 @@ public class UserMenu extends AbstractMenu {
menuItemsLayout.expand().fill(); menuItemsLayout.expand().fill();
} }
scrollPane = getScrollPaneByDevice(menuItemsLayout); scrollPane = new ScrollPaneWithBars(menuItemsLayout, false, true);
scrollPane.setFillParent(true); scrollPane.setFillParent(true);
container = new Container<>(scrollPane).fill(); container = new Container<>(scrollPane).fill();
container.align(Align.top); container.align(Align.top);
......
...@@ -56,6 +56,7 @@ import cz.nic.tablexia.util.ui.dialog.components.ResizableSpaceContentDialogComp ...@@ -56,6 +56,7 @@ import cz.nic.tablexia.util.ui.dialog.components.ResizableSpaceContentDialogComp
import cz.nic.tablexia.util.ui.dialog.components.ScrollPaneDialogComponent; import cz.nic.tablexia.util.ui.dialog.components.ScrollPaneDialogComponent;
import cz.nic.tablexia.util.ui.dialog.components.TablexiaDialogComponentAdapter; import cz.nic.tablexia.util.ui.dialog.components.TablexiaDialogComponentAdapter;
import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent; import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent;
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
public class AboutScreen extends AbstractTablexiaScreen<Void> { public class AboutScreen extends AbstractTablexiaScreen<Void> {
...@@ -205,7 +206,7 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> { ...@@ -205,7 +206,7 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> {
prepareContent(); prepareContent();
contentScrollPane = new ScrollPane(content); contentScrollPane = new ScrollPaneWithBars(content, false, true);
contentScrollPane.setScrollingDisabled(true, false); contentScrollPane.setScrollingDisabled(true, false);
contentScrollPane.setFillParent(true); contentScrollPane.setFillParent(true);
......
...@@ -570,7 +570,9 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> { ...@@ -570,7 +570,9 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
} }
private void moveToStreet() { private void moveToStreet() {
for (Actor a : getStage().getActors()) { if (newsDetailDialog != null && newsDetailDialog.isVisible()) newsDetailDialog.hide();
for (Actor a : getStage().getActors()) {
a.setTouchable(Touchable.disabled); a.setTouchable(Touchable.disabled);