mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Don't show command zone if game type doesn't need it
This commit is contained in:
@@ -513,6 +513,21 @@ public class Game {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return whether command zone is needed for this game
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("incomplete-switch")
|
||||||
|
public boolean isCommandZoneNeeded() {
|
||||||
|
switch (type) {
|
||||||
|
case Archenemy:
|
||||||
|
case Commander:
|
||||||
|
case Planechase:
|
||||||
|
case Vanguard:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the activePlane
|
* @return the activePlane
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -94,13 +94,24 @@ public enum VMatchUI implements IVTopLevelUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add extra players alternatively to existing user/AI field panels.
|
if (Singletons.getControl().getObservedGame().isCommandZoneNeeded()) {
|
||||||
for (int i = 2; i < lstCommands.size(); i++) {
|
// Add extra players alternatively to existing user/AI field panels.
|
||||||
// If already in layout, no need to add again.
|
for (int i = 2; i < lstCommands.size(); i++) {
|
||||||
VCommand cmdView = lstCommands.get(i);
|
// If already in layout, no need to add again.
|
||||||
if (cmdView.getParentCell() == null) {
|
VCommand cmdView = lstCommands.get(i);
|
||||||
lstCommands.get(i % 2).getParentCell().addDoc(cmdView);
|
if (cmdView.getParentCell() == null) {
|
||||||
}
|
lstCommands.get(i % 2).getParentCell().addDoc(cmdView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//If game goesn't need command zone, remove it from existing field panels
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
VCommand cmdView = lstCommands.get(i);
|
||||||
|
if (cmdView.getParentCell() != null) {
|
||||||
|
cmdView.getParentCell().removeDoc(cmdView);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add extra hands to existing hand panel.
|
// Add extra hands to existing hand panel.
|
||||||
|
|||||||
Reference in New Issue
Block a user