Commit 59843b87 authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'feature-protocol-center-room' into 'V3.6.2'

#840 Protocol resize

See merge request !646
parents 6e6d1fb9 2294140a
......@@ -258,7 +258,7 @@ public class ProtocolGame extends AbstractTablexiaGame<ProtocolGameState> {
getStage().addActor(roundButton);
getStage().addActor(dimmerScreen);
setComponentsPositionAndSize();
setComponentsPositionAndSize(false);
initFurniture();
createGameObjects();
......@@ -283,7 +283,7 @@ public class ProtocolGame extends AbstractTablexiaGame<ProtocolGameState> {
@Override
public void screenResized(int width, int height) {
setComponentsPositionAndSize();
setComponentsPositionAndSize(true);
}
@Override
......@@ -383,7 +383,7 @@ public class ProtocolGame extends AbstractTablexiaGame<ProtocolGameState> {
protocolLabel.setText(getData().getProtocolText());
}
private void setComponentsPositionAndSize() {
private void setComponentsPositionAndSize(boolean afterResize) {
float labelHeight = getViewportHeight() * PROTOCOL_GROUP_HEIGHT;
//Room group
......@@ -403,14 +403,16 @@ public class ProtocolGame extends AbstractTablexiaGame<ProtocolGameState> {
draggedLayout.setBounds(xRoom, yRoom, roomWidth, roomHeight);
//Protocol Label
protocolBackground.setBounds(getViewportLeftX(), getViewportHeight() - labelHeight, getViewportWidth(), labelHeight + getViewportBottomY());
protocolLabel.setBounds(getViewportLeftX() + AbstractMenu.MAX_OPEN_CLOSE_BUTTON_WIDTH, getViewportHeight() - labelHeight + PROTOCOL_TEXT_PADDING, getViewportWidth() - AbstractMenu.MAX_OPEN_CLOSE_BUTTON_WIDTH
- PANEL_WIDTH, labelHeight + getViewportBottomY() - PROTOCOL_TEXT_PADDING);
protocolBackground.setBounds(getViewportLeftX(), getViewportTopY() - labelHeight, getViewportWidth(), labelHeight);
protocolLabel.setBounds(getViewportLeftX() + AbstractMenu.MAX_OPEN_CLOSE_BUTTON_WIDTH, getViewportTopY() - labelHeight + PROTOCOL_TEXT_PADDING, getViewportWidth() - AbstractMenu.MAX_OPEN_CLOSE_BUTTON_WIDTH
- PANEL_WIDTH, labelHeight - PROTOCOL_TEXT_PADDING);
//Menu
cardsWidgetBackground.setBounds(getViewportWidth() - PANEL_WIDTH, getViewportBottomY(), PANEL_WIDTH, getViewportHeight());
cardsWidget.setBounds(getViewportWidth() - PANEL_WIDTH, getViewportBottomY(), PANEL_WIDTH, getViewportHeight());
if(afterResize) {
cardsWidget.screenResize();
}
//Round button
int buttonWidth = (ComponentScaleUtil.isUnderThreshold() ? FINISH_BUTTON_THRESHOLD_WIDTH : FINISH_BUTTON_WIDTH);
......
Markdown is supported
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