mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Fix so first player's avatar has focus when Forge first opened
This commit is contained in:
@@ -197,6 +197,7 @@ public enum VSubmenuConstructed implements IVSubmenu<CSubmenuConstructed> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
playerPanelWithFocus = playerPanels.get(0);
|
playerPanelWithFocus = playerPanels.get(0);
|
||||||
|
playerPanelWithFocus.setFocused(true);
|
||||||
|
|
||||||
playersFrame.setOpaque(false);
|
playersFrame.setOpaque(false);
|
||||||
playersFrame.add(playersScroll, "w 100%, h 100%-35px");
|
playersFrame.add(playersScroll, "w 100%, h 100%-35px");
|
||||||
@@ -396,7 +397,7 @@ public enum VSubmenuConstructed implements IVSubmenu<CSubmenuConstructed> {
|
|||||||
fdc.getDecksComboBox().addListener(new IDecksComboBoxListener() {
|
fdc.getDecksComboBox().addListener(new IDecksComboBoxListener() {
|
||||||
@Override
|
@Override
|
||||||
public void deckTypeSelected(DecksComboBoxEvent ev) {
|
public void deckTypeSelected(DecksComboBoxEvent ev) {
|
||||||
playerPanels.get(playerWithFocus).focusOnAvatar();
|
playerPanelWithFocus.focusOnAvatar();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -832,24 +833,17 @@ public enum VSubmenuConstructed implements IVSubmenu<CSubmenuConstructed> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void changePlayerFocus(int newFocusOwner, GameType gType) {
|
private void changePlayerFocus(int newFocusOwner, GameType gType) {
|
||||||
|
playerPanelWithFocus.setFocused(false);
|
||||||
playerWithFocus = newFocusOwner;
|
playerWithFocus = newFocusOwner;
|
||||||
playerPanelWithFocus = playerPanels.get(playerWithFocus);
|
playerPanelWithFocus = playerPanels.get(playerWithFocus);
|
||||||
|
playerPanelWithFocus.setFocused(true);
|
||||||
|
|
||||||
changeAvatarFocus();
|
|
||||||
playersScroll.getViewport().scrollRectToVisible(playerPanelWithFocus.getBounds());
|
playersScroll.getViewport().scrollRectToVisible(playerPanelWithFocus.getBounds());
|
||||||
populateDeckPanel(gType);
|
populateDeckPanel(gType);
|
||||||
|
|
||||||
refreshPanels(true, true);
|
refreshPanels(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Changes avatar appearance dependant on focus player. */
|
|
||||||
private void changeAvatarFocus() {
|
|
||||||
for (int i = 0; i < playerPanels.size(); i++) {
|
|
||||||
PlayerPanel pp = playerPanels.get(i);
|
|
||||||
pp.setFocused(i == playerWithFocus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Saves avatar prefs for players one and two. */
|
/** Saves avatar prefs for players one and two. */
|
||||||
private void updateAvatarPrefs() {
|
private void updateAvatarPrefs() {
|
||||||
int pOneIndex = playerPanels.get(0).getAvatarIndex();
|
int pOneIndex = playerPanels.get(0).getAvatarIndex();
|
||||||
|
|||||||
Reference in New Issue
Block a user