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 @@
before_script:
- ./gradlew unlockIOSKeyChain
- git submodule update --init --recursive
stages:
- build
- unitTest
- 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
only:
- master
- devel
- tags
script:
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true
- ./gradlew clean assemble -PTABLEXIA_ASSETS_UPLOAD=true -PTABLEXIA_HD_ASSETS=true -PTABLEXIA_ASSETS_OPTIMIZE=true
artifacts:
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
- desktop/build/libs/*iTest*.jar
- desktop/build/libs/*debug*.deb
- 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
except:
- pre-release
- release
only:
- tags
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:
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
paths:
- android/build/outputs/apk/*release*.apk
- ios/build/robovm/*release*.ipa
- desktop/build/libs/*release*.deb
- desktop/build/outputs/*release*.exe
unitTest:
stage: unitTest
script:
- ./gradlew test -x prepareAssets -x prepareGraphicAssets -x prepareSoundAssets -x prepareJsonAssets -x processAssets -x runChecksum
iTest-desktop:
stage: iTest-desktop
script:
......@@ -65,18 +86,4 @@ iTest-desktop:
expire_in: 3 days
paths:
- desktop/build/libs/iTest_results/*.log
- desktop/build/libs/iTest_results/*error.png
release:
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
- desktop/build/libs/iTest_results/*error.png
\ No newline at end of file
This diff is collapsed.
......@@ -32,8 +32,8 @@ import net.engio.mbassy.listener.Handler;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
......@@ -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);
}
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) {
this.reset = reset;
this.connectionManager = validateConnectionManager(connManager);
......@@ -186,15 +186,16 @@ public class Tablexia extends TablexiaApplication {
}
private void initializeLogging() {
if(TablexiaSettings.getInstance().getBuildType().isLogFile()) {
if (TablexiaSettings.getInstance().getBuildType().isLogFile()) {
try {
File file = new File(TablexiaAbstractFileManager.RootStorageType.LOCAL.getStoragePath(), LOG_FILE_NAME);
if(file.exists()) file.mkdirs();
File file = TablexiaAbstractFileManager.RootStorageType.LOCAL.getResolver().resolve(TablexiaAbstractFileManager.RootStorageType.LOCAL.getStoragePath() + LOG_FILE_NAME).file();
if (file.exists()) file.delete();
file.getParentFile().mkdirs();
file.createNewFile();
PrintStream stream = new PrintStream(new FileOutputStream(file));
TeeStream teeStream = new TeeStream(System.out, stream);
System.setOut(new PrintStream(teeStream));
} catch (FileNotFoundException e) {
} catch (IOException e) {
Log.info(getClass(), "Cannot create a log file!");
e.printStackTrace();
}
......
......@@ -463,8 +463,8 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
highlightedGameObjectLayer.addActor(gameObject);
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,
getViewportHeight() / 2 - ACTION_CARD_EXTRA_LARGE / 2);
gameObject.setPosition(getViewportWidth() / 2 - gameObject.getAction().getWidth() / 2 - actionsStripWidget.getWidth() / 2,
getViewportHeight() / 2 - gameObject.getAction().getHeight() / 2);
setDimmerVisible(true);
replayMusic(gameObject);
......
......@@ -24,12 +24,14 @@ import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.utils.DragListener;
import com.badlogic.gdx.utils.Timer;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.util.entity.Touch;
class DesktopCrimeSceneAction extends CrimeSceneAction {
private static final float DELAY = 0.15f;
private static final float DEFAULT_DESKTOP_DOWNSCALE = 0.45f;
private Touch lastRecordedTouchDown;
private boolean lastTapValid;
......@@ -40,6 +42,9 @@ class DesktopCrimeSceneAction extends CrimeSceneAction {
public DesktopCrimeSceneAction(String texturePath, int orderNumber, int actionSize, AbstractTablexiaGame tablexiaGame, int actionNumber, GameObject gameObject) {
super(texturePath, orderNumber, actionSize, tablexiaGame, actionNumber, gameObject);
if (TablexiaSettings.getInstance().isUseHdAssets()){
setSize(getWidth() * DEFAULT_DESKTOP_DOWNSCALE, getHeight() * DEFAULT_DESKTOP_DOWNSCALE);
}
timer = new Timer();
}
......
......@@ -27,6 +27,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
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.controller.RoomPosition;
import cz.nic.tablexia.game.games.protocol.gameobjects.furniture.Furniture;
......@@ -65,6 +66,9 @@ public class GameObject extends ObjectModel {
private static final float LABEL_WITH_RATIO = 0.95f;
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 inRoom = false;
......@@ -149,9 +153,10 @@ public class GameObject extends ObjectModel {
}
private void changeSize() {
if (isInRoom())
objectImage.setSize(objectImage.getDrawable().getMinWidth(), objectImage.getDrawable().getMinHeight());
else
if (isInRoom()) {
float scaleFactor = TablexiaSettings.getInstance().isUseHdAssets() ? DEFAULT_SCALE_DESKTOP_HD : DEFAULT_SCALE_NONE;
objectImage.setSize(objectImage.getDrawable().getMinWidth() * scaleFactor, objectImage.getDrawable().getMinHeight() * scaleFactor);
} else
objectImage.setSize(ProtocolGame.CARD_SMALL_SIZE, ProtocolGame.CARD_SMALL_SIZE);
}
......
......@@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.Collections;
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.gameobjects.ObjectModel;
import cz.nic.tablexia.game.games.protocol.utils.ObjectsPositionComparator;
......@@ -42,14 +43,19 @@ public class Furniture extends ObjectModel {
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) {
this.type = type;
this.texture = texture;
furnitureImage = new Image(texture);
furnitureImage.setWidth((furnitureImage.getDrawable().getMinWidth() * resizePercent) / 100);
furnitureImage.setHeight((furnitureImage.getDrawable().getMinHeight() * resizePercent / 100));
float scaleFactor = TablexiaSettings.getInstance().isUseHdAssets() ? DEFAULT_SCALE_DESKTOP_HD : DEFAULT_SCALE_NONE;
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 yMiddle = furnitureImage.getHeight() * type.getMiddleRatio()[1] - 5;
......
......@@ -165,14 +165,14 @@ public class RunesHolder extends Group {
}
public void unfold() {
if (folded) {
if (folded && getStage() != null) {
for (Actor a : getChildren()) {
a.setTouchable(Touchable.enabled);
}
setTouchable(Touchable.childrenOnly);
toFront();
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();
setScale(UNFOLDED_SCALE);
float newX = prevMid - getWidth() * getScaleX() * 0.5f;
......
......@@ -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;
import cz.nic.tablexia.menu.IMenuItem;
import cz.nic.tablexia.menu.main.user.UserSelectBox;
import cz.nic.tablexia.util.ui.dialog.TablexiaComponentDialog;
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
/**
* MainMenu container
......@@ -121,7 +122,7 @@ public class MainMenu extends AbstractMenu {
Table layoutTable = new Table();
UserSelectBox userSelectBox = new UserSelectBox(SELECTBOX_USER_HEIGHT);
scrollPane = getScrollPaneByDevice(mainMenuVerticalGroup);
scrollPane = new ScrollPaneWithBars(mainMenuVerticalGroup, false, true);
scrollPane.setFillParent(true);
scrollPaneContainer = new Container();
......
......@@ -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.UserUuidSyncDialogComponent;
import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent;
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
/**
* UserMenu container
......@@ -228,7 +229,7 @@ public class UserMenu extends AbstractMenu {
menuItemsLayout.expand().fill();
}
scrollPane = getScrollPaneByDevice(menuItemsLayout);
scrollPane = new ScrollPaneWithBars(menuItemsLayout, false, true);
scrollPane.setFillParent(true);
container = new Container<>(scrollPane).fill();
container.align(Align.top);
......
......@@ -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.TablexiaDialogComponentAdapter;
import cz.nic.tablexia.util.ui.dialog.components.ViewportMaximumSizeComponent;
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
public class AboutScreen extends AbstractTablexiaScreen<Void> {
......@@ -205,7 +206,7 @@ public class AboutScreen extends AbstractTablexiaScreen<Void> {
prepareContent();
contentScrollPane = new ScrollPane(content);
contentScrollPane = new ScrollPaneWithBars(content, false, true);
contentScrollPane.setScrollingDisabled(true, false);
contentScrollPane.setFillParent(true);
......
......@@ -570,7 +570,9 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
}
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.addAction(Actions.sequence(Actions.moveBy(-getStage().getWidth(), 0, PanoramaActorsLayout.NEWSPAPERS_STREET_TRANSITION_SPEED), Actions.removeActor()));
}
......
......@@ -44,7 +44,7 @@ import cz.nic.tablexia.screen.encyclopedia.content.actors.PlaybackStateButton;
import cz.nic.tablexia.screen.encyclopedia.content.model.Content;
import cz.nic.tablexia.screen.encyclopedia.menu.MenuItem;
import cz.nic.tablexia.screen.encyclopedia.menu.MenuWidget;
import cz.nic.tablexia.screen.encyclopedia.widget.ResizableScrollPane;
import cz.nic.tablexia.screen.encyclopedia.widget.ResizableScrollPaneWithBars;
import cz.nic.tablexia.screen.encyclopedia.widget.ResizableWidgetGroup;
import cz.nic.tablexia.util.Log;
import cz.nic.tablexia.util.MusicUtil;
......@@ -208,7 +208,7 @@ public class EncyclopediaScreen extends AbstractTablexiaScreen<Void> {
content = new Table();
content.padLeft(CONTENT_PAD_LEFT);
content.align(Align.top);
contentScrollPane = new ResizableScrollPane(content);
contentScrollPane = new ResizableScrollPaneWithBars(content, false, true);
contentScrollPane.setScrollingDisabled(true, false);
contentScrollPane.setSize(CONTENT_RELATIVE_WIDTH * getViewportWidth(), getViewportHeight());
......@@ -219,6 +219,7 @@ public class EncyclopediaScreen extends AbstractTablexiaScreen<Void> {
container.add(contentStack);
}
private void prepareRightMenu() {
float rightPanelWidth = (1 - CONTENT_RELATIVE_WIDTH) * getSceneWidth();
menu = new MenuWidget(this, new Point(rightPanelWidth, getSceneInnerHeight() * MENU_RELATIVE_HEIGHT), EncyclopediaAssets.BOOKMARK, new MenuWidget.OnMenuItemClickListener() {
......@@ -231,7 +232,7 @@ public class EncyclopediaScreen extends AbstractTablexiaScreen<Void> {
});
menuScrollPane = new ResizableScrollPane(menu);
menuScrollPane = new ResizableScrollPaneWithBars(menu, false, true);
menuScrollPane.setScrollingDisabled(true, false);
menuScrollPane.setSize(rightPanelWidth, getViewportHeight() * MENU_RELATIVE_HEIGHT);
......
......@@ -31,6 +31,7 @@ import com.badlogic.gdx.utils.Array;
import java.util.HashMap;
import java.util.Map;
import cz.nic.tablexia.TablexiaSettings;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.util.Point;
import cz.nic.tablexia.util.ui.button.TablexiaButton;
......@@ -40,6 +41,7 @@ import cz.nic.tablexia.util.ui.button.TablexiaButton;
*/
public class MenuWidget extends VerticalGroup {
private static final float BUTTON_TOP_BOTTOM_PADDING = 20f;
private static final float SCROLL_PANE_SIZE = 15f;
Array<MenuItem> menuItemValues;
private Map<MenuItem, TablexiaButton> menuItems;
......@@ -99,7 +101,7 @@ public class MenuWidget extends VerticalGroup {
if(btn == null) continue;
btn.setWidth(width);
btn.setWidth(width-SCROLL_PANE_SIZE);
btn.setHeight(btn.getLabel().getTablexiaLabelStyle().getFontType().getSize() + 2 * BUTTON_TOP_BOTTOM_PADDING);
}
}
......
/*
* Copyright (C) 2016 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
* Copyright (C) 2018 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -18,14 +18,12 @@
package cz.nic.tablexia.screen.encyclopedia.widget;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
/**
* Created by Václav Tarantík on 25.8.15.
*/
public class ResizableScrollPane extends ScrollPane {
public ResizableScrollPane(Actor widget) {
super(widget);
import cz.nic.tablexia.util.ui.scrollpane.ScrollPaneWithBars;
public class ResizableScrollPaneWithBars extends ScrollPaneWithBars {
public ResizableScrollPaneWithBars(Actor widget, boolean hBar, boolean vBar) {
super(widget, hBar, vBar);
}
@Override
......
......@@ -74,6 +74,9 @@ public class GamePageGroup extends Group {
private static final float TITLE_MIN_HEIGHT = 0.25f;
private static final float TITLE_MAX_HEIGHT = 0.37f;
private static final float DESKTOP_SCALE_HD = 0.7f;
private static final float DESKTOP_SCALE_NONE = 1f;
/*
* offset to the center of edge buttons on difficulty bar
* multiply this value with difficulty bars width to get offset for current screens coord system
......@@ -255,7 +258,9 @@ public class GamePageGroup extends Group {
//Difficulty Thumb
final TextureRegion diff = getScreen().getCommonGamePageTextureRegion(GamePageAssets.DIFF_THUMB_EASY);
float diffWidth = getScreen().getSceneWidth() * DIFFICULTY_THUMB_WIDTH;
float scaleFactor = TablexiaSettings.getInstance().isUseHdAssets() ? DESKTOP_SCALE_HD : DESKTOP_SCALE_NONE;
float diffWidth = getScreen().getSceneWidth() * DIFFICULTY_THUMB_WIDTH * scaleFactor;
float diffHeight = (int) (diffWidth * (diff.getRegionHeight() / (float) diff.getRegionWidth()));
//Centers thumb difficulty button to difficulty bar
......
......@@ -104,6 +104,9 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
private static final float MOUSE_DIALOG_PADDING_TRESHOLD_SCALE = 1.7f;
private static final int MOUSE_RANK_UP_TIMEOUT = 2 * 24 * 60 * 60 * 1000; //2 days in ms
private static final int HEAP_WIDTH = 418;
private static final int HEAP_HEIGHT = 578;
private static final Vector2 MOUSE_DIALOG_OFFSET = new Vector2(32, 16);
public static final String HALL_OF_FAME_SPEECH = MFX_PATH + "halloffame.mp3";
......@@ -491,7 +494,7 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
float heapScale = heapProperties.getThird();
heapImage.setPosition(heapX, heapY);
heapImage.setScale(heapScale);
heapImage.setSize(418,578);
heapImage.setSize(HEAP_WIDTH,HEAP_HEIGHT);