Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn Details Overlay on Boardview #4513

Merged
merged 16 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,17 @@ BoardView1.ConversionMode.TRACKED=Tracked
BoardView1.ConversionMode.WHEELED=Wheeled
BoardView1.ConversionMode.WIGE=AirMech
BoardView1.ConversionMode.AERODYNE=Fighter
BoardView1.charge=Charges. Needs {0}
BoardView1.charge1=(Charging)
BoardView1.ChargeAttackAction=Charges. Needs {0}
BoardView1.ChargeAttackAction1=(Charging)
BoardView1.CrewDead=CREW DEAD
BoardView1.DFA1=(Executing DFA)
BoardView1.DfaAttackAction1=(Executing DFA)
BoardView1.Drop=Drop
BoardView1.Command-=Command-
BoardView1.Command=Command
BoardView1.Conventional=Conv (
BoardView1.DEPTH=DEPTH
BoardView1.detonated=detonated (
BoardView1.DFA=DFA. Needs {0}
BoardView1.DfaAttackAction=DFA. Needs {0}
BoardView1.Disconnect=Disconnect
BoardView1.ecmSource=ECM Source
BoardView1.eccmSource=ECCM Source
Expand All @@ -340,7 +340,7 @@ BoardView1.Height=Height
BoardView1.HEIGHT=HEIGHT
BoardView1.Hex=Hex
BoardView1.HIDDEN=HIDDEN
BoardView1.hit=Hits with {0}. Needs {1}
BoardView1.ClubAttackAction=Hits with {0}. Needs {1}
BoardView1.Hover=Hover
BoardView1.ID=\ ID:
BoardView1.IMMOBILE=IMMOBILE
Expand Down Expand Up @@ -384,14 +384,15 @@ BoardView1.on=on
BoardView1.pilot=\ Pilot
BoardView1.PRONE=PRONE
BoardView1.NO_GYRO=NO GYRO
BoardView1.proto=Makes a protomech frenzy attack. Needs {0}
BoardView1.ProtomechPhysicalAttackAction=Makes a protomech frenzy attack. Needs {0}
BoardView1.punchBoth=Punches with both arms. Left needs {0}; Right needs {1}
BoardView1.punchLeft=Punches with left arm. Needs {0}
BoardView1.punchRight=Punches with right arm. Needs {0}
BoardView1.push=Pushes. Needs {0}
BoardView1.PushAttackAction=Pushes. Needs {0}
BoardView1.Rubble=Rubble
BoardView1.Searchlight=Illuminates with searchlight.
BoardView1.SearchlightAttackAction=Illuminates with searchlight.
BoardView1.Smoke={0} smoke hex(es) in line of sight.\n
BoardView1.SpotAction=Spot {0}
BoardView1.STUCK=STUCK
BoardView1.STUNNED=STUNNED:{0}
BoardView1.SWARMED=SWARMED
Expand Down Expand Up @@ -1051,6 +1052,7 @@ CommonMenuBar.physicalPush=Push
CommonMenuBar.physicalThrash=Thrash
CommonMenuBar.physicalVibro=Vibro Claw
CommonMenuBar.PrintMenu=Print
CommonMenuBar.turnDetailsOverlay=Show turn details overlay
CommonMenuBar.SpecialMenu=Special
CommonMenuBar.UnitListMenu=Units
CommonMenuBar.Vibrabomb=Vibrabomb({0})
Expand Down Expand Up @@ -1804,6 +1806,8 @@ KeyBinds.cmdNames.toggleKeybinds=Keybindings Display
KeyBinds.cmdDesc.toggleKeybinds=Toggles the map overlay showing various key shortcuts
KeyBinds.cmdNames.togglePlanetaryConditions=Planetary Conditions Display
KeyBinds.cmdDesc.togglePlanetaryConditions=Toggles the map overlay showing Planetary Conditions
KeyBinds.cmdNames.toggleTurnDetails=Turn Details Display
KeyBinds.cmdDesc.toggleTurnDetails=Toggles the map overlay showing Turn Details
KeyBinds.cmdNames.toggleHexCoords=Toggle Hex Coords
KeyBinds.cmdDesc.toggleHexCoords=Toggles the map showing the coords on each hex
KeyBinds.cmdNames.toggleMinimap=Toggle Minimap
Expand Down Expand Up @@ -3456,6 +3460,8 @@ TriggerBPodDialog.title=Trigger ABA Pods
TriggerBPodDialog.ChooseTargetDialog.message=Hex {0} contains the following targets.\n\nWhich target do you want to attack?"
TriggerBPodDialog.ChooseTargetDialog.title=Choose Target

TurnDetailsOverlay.heading=Turn Details - {0} to toggle

UnitDisplay.SwitchLocation=switch location
UnitDisplay.SwitchView=switch view

Expand Down
14 changes: 7 additions & 7 deletions megamek/i18n/megamek/client/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ BoardView1.Armor=Panzerung
BoardView1.Attacker=Angreifer({0}) hex ist {1}.\n
BoardView1.AttackerPartialCover=Angreifer hat {0} Teilweise Deckung.\n
BoardView1.CF=, KF:
BoardView1.charge=Rammt. Ben�tigt {0}
BoardView1.charge1=(Rammangriff)
BoardView1.DFA1=(Todessprung)
BoardView1.ChargeAttackAction=Rammt. Ben�tigt {0}
BoardView1.ChargeAttackAction1=(Rammangriff)
BoardView1.DfaAttackAction1=(Todessprung)
BoardView1.Command-=Kommando-
BoardView1.Conventional=Konventionell
BoardView1.DEPTH=TIEFE
BoardView1.detonated=detoniert
BoardView1.DFA=Todessprung. Ben�tigt {0}
BoardView1.DfaAttackAction=Todessprung. Ben�tigt {0}
BoardView1.Heat=\ Hitze
BoardView1.HeavySmoke={0} Feld(er) mit dichtem Rauch in der Sichtlinie.\n
BoardView1.HeavyWoods={0} Feld(er) mit dichtem Wald in der Sichtlinie.\n
BoardView1.Height=H�he
BoardView1.HEIGHT=H\u00D6HE
BoardView1.Hex=Hex
BoardView1.hit=Trifft mit {0}. Ben�tigt {1}
BoardView1.ClubAttackAction=Trifft mit {0}. Ben�tigt {1}
BoardView1.ID=\ ID:
BoardView1.IMMOBILE=IMMOBIL
BoardView1.internal=; Intern
Expand All @@ -140,11 +140,11 @@ BoardView1.NonMech=Nicht-Mech
BoardView1.on=auf
BoardView1.pilot=\ Pilot
BoardView1.PRONE=LIEGT
BoardView1.proto=F�hrt Protomech Nahkampfattacke durch. Ben�tigt {0}
BoardView1.ProtomechPhysicalAttackAction=F�hrt Protomech Nahkampfattacke durch. Ben�tigt {0}
BoardView1.punchBoth=Schl�gt mit beiden Armen. Linker Arm ben�tigt {0}; Rechter Arm ben�tigt {1}
BoardView1.punchLeft=Schl�gt mit dem linken Arm. Ben�tigt {0}
BoardView1.punchRight=Schl�gt mit dem rechten Arm. Ben�tigt {0}
BoardView1.push=Schubst. Ben�tigt {0}
BoardView1.PushAttackAction=Schubst. Ben�tigt {0}
BoardView1.Rubble=Unrat
BoardView1.Smoke={0} Rauchfeld(er) in der Sichtlinie\n
BoardView1.STUCK=STECKT
Expand Down
16 changes: 8 additions & 8 deletions megamek/i18n/megamek/client/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,17 @@ BoardView1.ConversionMode.TRACKED=Con orugas
BoardView1.ConversionMode.WHEELED=Con ruedas
BoardView1.ConversionMode.WIGE=AirMech
BoardView1.ConversionMode.AERODYNE=Caza
BoardView1.charge=Cargas. Necesita {0}
BoardView1.charge1=(Cargando)
BoardView1.ChargeAttackAction=Cargas. Necesita {0}
BoardView1.ChargeAttackAction1=(Cargando)
BoardView1.CrewDead=EQUIPO MUERTO
BoardView1.DFA1=(Ejecutando MDC)
BoardView1.DfaAttackAction1=(Ejecutando MDC)
BoardView1.Drop=Soltar
BoardView1.Command-=Comando-
BoardView1.Command=Comando
BoardView1.Conventional=Conv (
BoardView1.DEPTH=PROF.
BoardView1.detonated=detonado (
BoardView1.DFA=MDC. Necesita {0}
BoardView1.DfaAttackAction=MDC. Necesita {0}
BoardView1.Disconnect=Desconectar
BoardView1.ecmSource=Fuente ECM
BoardView1.eccmSource=Fuente ECCM
Expand All @@ -410,7 +410,7 @@ BoardView1.Height=Altura
BoardView1.HEIGHT=ALTURA
BoardView1.Hex=Hex
BoardView1.HIDDEN=OCULTO
BoardView1.hit=Golpes con {0}. Necesita {1}
BoardView1.ClubAttackAction=Golpes con {0}. Necesita {1}
BoardView1.Hover=Flotar
BoardView1.ID=\ ID:
BoardView1.IMMOBILE=INMÓVIL
Expand Down Expand Up @@ -454,13 +454,13 @@ BoardView1.on=activado
BoardView1.pilot=\ Piloto
BoardView1.PRONE=CAIDO
BoardView1.NO_GYRO=NO GYRO
BoardView1.proto=Hace un ataque frenético de protomech. Necesita {0}
BoardView1.ProtomechPhysicalAttackAction=Hace un ataque frenético de protomech. Necesita {0}
BoardView1.punchBoth=Golpea con ambos brazos. Izquierdo necesita {0}; Derecho necesita {1}
BoardView1.punchLeft=Golpea con el brazo izquierdo. Necesita {0}
BoardView1.punchRight=Golpea con el brazo derecho. Necesita {0}
BoardView1.push=Empuja. Necesita {0}
BoardView1.PushAttackAction=Empuja. Necesita {0}
BoardView1.Rubble=Escombros
BoardView1.Searchlight=Se ilumina con un reflector.
BoardView1.SearchlightAttackAction=Se ilumina con un reflector.
BoardView1.Smoke={0} hex de humo en el campo visual.\n
BoardView1.STUCK=ATASCADO
BoardView1.STUNNED=ATURDIDO:{0}
Expand Down
16 changes: 8 additions & 8 deletions megamek/i18n/megamek/client/messages_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ BoardView1.Climb=Забраться наверх
BoardView1.ClimbOff=Пройти через
BoardView1.WIGEClimb=Держать высоту
BoardView1.WIGEClimbOff=Перестать держать высоту
BoardView1.charge=Таранит. Нужно {0}
BoardView1.charge1=(Таранит)
BoardView1.ChargeAttackAction=Таранит. Нужно {0}
BoardView1.ChargeAttackAction1=(Таранит)
BoardView1.CrewDead=ЭКИПАЖ МЕРТВ
BoardView1.DFA1=(Выполняет DFA)
BoardView1.DfaAttackAction1=(Выполняет DFA)
BoardView1.Drop=Drop
BoardView1.Command-=Командование-
BoardView1.Command=Командование
BoardView1.Conventional=Обчн
BoardView1.DEPTH=ГЛУБИНА
BoardView1.detonated=взорваны (
BoardView1.DFA=DFA. Нужно {0}
BoardView1.DfaAttackAction=DFA. Нужно {0}
BoardView1.ecmSource=Источник ECM
BoardView1.eccmSource=Источник ECCM
BoardView1.Evade=\ (Уход)
Expand All @@ -125,7 +125,7 @@ BoardView1.HeavyWoods={0} гексов густого леса на линии
BoardView1.Height=Высота
BoardView1.HEIGHT=ВЫСОТА
BoardView1.Hex=Гекс
BoardView1.hit=Попадание при {0}. Нужно {1}
BoardView1.ClubAttackAction=Попадание при {0}. Нужно {1}
BoardView1.Hover=Парить
BoardView1.ID=\ ID:
BoardView1.IMMOBILE=ОБЕЗДВИЖЕН
Expand Down Expand Up @@ -166,13 +166,13 @@ BoardView1.NonMech=не Мех
BoardView1.on=на
BoardView1.pilot=\ Пилот
BoardView1.PRONE=ЛЕЖИТ
BoardView1.proto=Выполняет яростную атаку протомеха. Нужно {0}
BoardView1.ProtomechPhysicalAttackAction=Выполняет яростную атаку протомеха. Нужно {0}
BoardView1.punchBoth=Бьет обеими руками. Левой нужно {0}; Правой нужно {1}
BoardView1.punchLeft=Бьет левой рукой. Нужно {0}
BoardView1.punchRight=Бьет правой рукой. Нужно {0}
BoardView1.push=Толкает. Нужно {0}
BoardView1.PushAttackAction=Толкает. Нужно {0}
BoardView1.Rubble=Мусор
BoardView1.Searchlight=Светит поисковым прожектором.
BoardView1.SearchlightAttackAction=Светит поисковым прожектором.
BoardView1.Smoke={0} дымных гекса(ов) на линии обзора.\n
BoardView1.STUCK=ЗАСТРЯЛ
BoardView1.STUNNED=ОГЛУШЕН:{0}
Expand Down
7 changes: 7 additions & 0 deletions megamek/mmconf/defaultKeyBinds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@
<isRepeatable>false</isRepeatable>
</KeyBind>

<KeyBind>
<command>toggleTurnDetails</command> <!-- Ctrl-P -->
<keyCode>84</keyCode>
<modifier>128</modifier>
<isRepeatable>false</isRepeatable>
</KeyBind>

<KeyBind>
<command>clientSettings</command> <!-- Alt-C -->
<keyCode>67</keyCode>
Expand Down
6 changes: 5 additions & 1 deletion megamek/src/megamek/client/ui/swing/ActionPhaseDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import megamek.client.ui.swing.util.UIUtil;
import megamek.client.ui.swing.widget.MegamekButton;
import megamek.client.ui.swing.widget.SkinSpecification;
import megamek.common.annotations.Nullable;
import megamek.common.preference.PreferenceChangeEvent;

import javax.swing.*;
Expand Down Expand Up @@ -135,7 +136,8 @@ protected boolean needNagForNoAction() {
* @param skipButtonLabel
* @param isDoingAction true if user has entered actions for this turn, false if not.
*/
protected void updateDonePanelButtons(String doneButtonLabel, String skipButtonLabel, boolean isDoingAction) {
protected void updateDonePanelButtons(final String doneButtonLabel, final String skipButtonLabel, final boolean isDoingAction,
@Nullable java.util.List<String> turnDetails) {
this.isDoingAction = isDoingAction;
if (GUIP.getNagForNoAction()) {
butDone.setText("<html><b>" + doneButtonLabel + "</b></html>");
Expand All @@ -161,5 +163,7 @@ protected void updateDonePanelButtons(String doneButtonLabel, String skipButtonL
butDone.setEnabled(!GUIP.getNagForNoAction());
butSkipTurn.setEnabled(true);
}

clientgui.getBoardView().turnDetailsOverlay.setLines(turnDetails);
}
}
10 changes: 6 additions & 4 deletions megamek/src/megamek/client/ui/swing/AttackPhaseDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package megamek.client.ui.swing;

import megamek.client.ui.swing.tooltip.EntityActionLog;
import megamek.common.actions.*;

import java.util.*;
Expand All @@ -26,10 +27,11 @@

public abstract class AttackPhaseDisplay extends ActionPhaseDisplay {
// client list of attacks user has input
protected Vector<EntityAction> attacks;
protected EntityActionLog attacks;

protected AttackPhaseDisplay(ClientGUI cg) {
super(cg);
attacks = new EntityActionLog(clientgui.getClient());
}

/**
Expand All @@ -52,9 +54,9 @@ protected void updateDonePanel()
{
if (attacks.isEmpty() || (attacks.size() == 1 && attacks.firstElement() instanceof TorsoTwistAction)){
// a torso twist alone should not trigger Done button
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), false);
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), false, null);
} else {
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), true);
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), true, attacks.getDescriptions());
}
}

Expand All @@ -67,7 +69,7 @@ protected void removeAttack(Object o)
/** removes all elements from the local temporary attack list */
protected void removeAllAttacks()
{
attacks.removeAllElements();
attacks.clear();
updateDonePanel();
}

Expand Down
6 changes: 6 additions & 0 deletions megamek/src/megamek/client/ui/swing/ClientGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public class ClientGUI extends JPanel implements BoardViewListener,
public static final String VIEW_TOGGLE_FOV_HIGHLIGHT = "viewToggleFovHighlight";
public static final String VIEW_TOGGLE_FIRING_SOLUTIONS = "viewToggleFiringSolutions";
public static final String VIEW_MOVE_ENV = "viewMovementEnvelope";
public static final String VIEW_TURN_DETAILS_OVERLAY = "viewTurnDetailsOverlay";
public static final String VIEW_MOVE_MOD_ENV = "viewMovModEnvelope";
public static final String VIEW_CHANGE_THEME = "viewChangeTheme";
public static final String VIEW_ROUND_REPORT = "viewRoundReport";
Expand Down Expand Up @@ -963,6 +964,11 @@ public void actionPerformed(ActionEvent event) {
((MovementDisplay) curPanel).computeMovementEnvelope(getUnitDisplay().getCurrentEntity());
}
break;
case VIEW_TURN_DETAILS_OVERLAY:
if (curPanel instanceof ActionPhaseDisplay) {
GUIP.setTurnDetailsOverlay(!GUIP.getTurnDetailsOverlay());
}
break;
case VIEW_MOVE_MOD_ENV:
if (curPanel instanceof MovementDisplay) {
((MovementDisplay) curPanel).computeModifierEnvelope();
Expand Down
Loading