Commit f1e0116f authored by Vitaliy Vashchenko's avatar Vitaliy Vashchenko

Merge branch 'feature-scrolling-after-promotion' into 'V3.7'

Enabled scrolling in Hall of Fame after rank up

See merge request !759
parents 0d5be875 8b0bbec1
...@@ -38,6 +38,8 @@ import com.badlogic.gdx.utils.Scaling; ...@@ -38,6 +38,8 @@ import com.badlogic.gdx.utils.Scaling;
import com.badlogic.gdx.utils.viewport.ExtendViewport; import com.badlogic.gdx.utils.viewport.ExtendViewport;
import com.badlogic.gdx.utils.viewport.Viewport; import com.badlogic.gdx.utils.viewport.Viewport;
import net.engio.mbassy.listener.Handler;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
...@@ -171,6 +173,8 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti ...@@ -171,6 +173,8 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
private ScrollPaneWithBorders scrollPane; private ScrollPaneWithBorders scrollPane;
private Image mouseImage; private Image mouseImage;
private Timer mouseTimer; private Timer mouseTimer;
private long rankUpTime;
private long visitTime;
@Override @Override
protected Viewport createViewport() { protected Viewport createViewport() {
...@@ -239,8 +243,8 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti ...@@ -239,8 +243,8 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
scrollToTrophy(screenState.get(SCROLL_TO_TROPHY_KEY)); scrollToTrophy(screenState.get(SCROLL_TO_TROPHY_KEY));
} }
handleMouseRankUpDialog(); rankUpTime = UserRankManager.getInstance().getLastTimeRankedUp(getSelectedUser());
visitTime = ScreenDAO.getScreenLastVisitTime(getSelectedUser().getId(), getClass().getName());
getStage().setScrollFocus(scrollPane); getStage().setScrollFocus(scrollPane);
} }
...@@ -593,10 +597,14 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti ...@@ -593,10 +597,14 @@ public class HallOfFameScreen extends AbstractTablexiaScreen<Map<ITrophyDefiniti
foregroundGroup.addActor(mouseImage); foregroundGroup.addActor(mouseImage);
} }
private void handleMouseRankUpDialog() { @Handler
long rankUpTime = UserRankManager.getInstance().getLastTimeRankedUp(getSelectedUser()); private void onScreenVisibleEvent(AbstractTablexiaScreen.ScreenVisibleEvent screenVisibleEvent) {
long visitTime = ScreenDAO.getScreenLastVisitTime(getSelectedUser().getId(), getClass().getName()); if(screenVisibleEvent.getActualScreenClass()==HallOfFameScreen.class){
handleMouseRankUpDialog();
}
}
private void handleMouseRankUpDialog() {
long timeInMs = rankUpTime - visitTime; long timeInMs = rankUpTime - visitTime;
if(timeInMs > 0 && (visitTime == 0 || timeInMs <= MOUSE_RANK_UP_TIMEOUT)) { if(timeInMs > 0 && (visitTime == 0 || timeInMs <= MOUSE_RANK_UP_TIMEOUT)) {
......
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