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