Skip to content

Commit

Permalink
Tooltip for assignments in insert mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonN committed Mar 8, 2024
1 parent abf2b94 commit 9f572b2
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 8 deletions.
2 changes: 2 additions & 0 deletions data/transl/catalan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ $gamePriorityInvert [%s] pel darrer lix.
$gameQueueBuilder Torna a fer clic per posar a la cua.
$gameQueuePlatformer Torna a fer clic per posar a la cua.
$gameHoldToScroll Fes clic i manté premut [%s] i mou el ratolí per desplaçar.
$gameClickToInsert Mode d'Inserció: Fes clic per inserir.
$gameClickToCancelReplay Repetitió. Fes clic a l'aire per jugar.
$gameFramestepOrQuit Rebobina el temps (◀▮) o surt amb [%s].
$gameMaxTicksReached Nombre màxim de ticks (%s) assolides. Rebobina o surt.
$gamePause Pausar.
$gameShowSplatRuler Mostra el regle d'esclafades.
$gameHighlightGoals Ressalta els teus propis caus i objectius.
Expand Down
2 changes: 2 additions & 0 deletions data/transl/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ $gamePriorityInvert [%s] for hindmost lix.
$gameQueueBuilder Click again to queue.
$gameQueuePlatformer Click again to queue.
$gameHoldToScroll Hold [%s] and move mouse to scroll.
$gameClickToInsert Insert Mode: Click to insert.
$gameClickToCancelReplay Replaying. Click to play from here.
$gameFramestepOrQuit Rewind time (◀▮) or quit with [%s].
$gameMaxTicksReached Maximal number of ticks (%s) reached. Rewind or quit.
$gamePause Pause.
$gameShowSplatRuler Show splat ruler.
$gameHighlightGoals Highlight own hatches and goals.
Expand Down
2 changes: 2 additions & 0 deletions data/transl/german.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ $gamePriorityInvert [%s] für hintere Lix.
$gameQueueBuilder Klicke zum Vormerken.
$gameQueuePlatformer Klicke zum Vormerken.
$gameHoldToScroll Halte [%s] und bewege Maus zum Scrollen.
$gameClickToInsert Einfügemodus: Klicke, um einzufügen.
$gameClickToCancelReplay Replay läuft. Klicke, um von hier zu spielen.
$gameFramestepOrQuit Gehe zurück (◀▮) oder beende mit [%s].
$gameMaxTicksReached Maximale Anzahl Ticks (%s) erreicht. Spule zurück oder beende.
$gamePause Pause.
$gameShowSplatRuler Fallhöhen-Lineal anzeigen.
$gameHighlightGoals Eigene Klappen und Ziele hervorheben.
Expand Down
2 changes: 2 additions & 0 deletions data/transl/swedish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ $gamePriorityInvert [%s] för lix längst bak
$gameQueueBuilder Klicka igen för att kölägga.
$gameQueuePlatformer Klicka igen för att kölägga.
$gameHoldToScroll Håll [%s] och rör musen för att rulla.
$gameClickToInsert Infogningsläge: Klicka för att infoga.
$gameClickToCancelReplay Repris är på. Klicka i luften för att spela.
$gameFramestepOrQuit Spola tillbaka tid (◀▮) eller avsluta med [%s].
$gameMaxTicksReached Maximalt antal ticks (%s) uppnått. Spola tillbaka eller avsluta.
$gamePause Pausat.
$gameShowSplatRuler Visa splat-linjal.
$gameHighlightGoals Markera egna luckor och mål.
Expand Down
2 changes: 2 additions & 0 deletions src/file/lang/enum_.d
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ enum Lang {
gameQueueBuilder,
gameQueuePlatformer,
gameHoldToScroll,
gameClickToInsert,
gameClickToCancelReplay,
gameFramestepOrQuit,
gameMaxTicksReached,
gamePause,
gameShowSplatRuler,
gameHighlightGoals,
Expand Down
5 changes: 1 addition & 4 deletions src/game/core/active.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ do {
void resolveClickThatWillAssign(Game game, Assignee assignee)
{
if (game.view.canInterruptReplays) {
immutable bool weMayInsert = game._tweaker.shown
? opt.insertAssignmentsWhenTweakerShown.value
: opt.insertAssignmentsWhenTweakerHidden.value;
if (weMayInsert) {
if (game.isInsertMode) {
game.cutSingleLixFutureFromReplay(assignee.passport);
}
else {
Expand Down
3 changes: 0 additions & 3 deletions src/game/core/draw.d
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ void drawTooltips(Game game)
game._panelExplainer.move(game._tweaker.shown
? game._tweaker.xlg : 0, game._panelExplainer.geom.y);
game._mapClickExplainer.move(game._panelExplainer.geom.x, 0);
if (game.canWeClickAirNowToCutGlobalFuture && game.isMouseOnLand) {
game._mapClickExplainer.suggestTooltip(Tooltip.ID.clickToCancelReplay);
}
game._panelExplainer.suggestTooltip(game.pan.hoveredSkillOnlyForTooltip);
if (game.pan.isSuggestingTooltip) {
game._panelExplainer.suggestTooltip(game.pan.suggestedTooltip);
Expand Down
7 changes: 7 additions & 0 deletions src/game/core/game.d
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ package:
&& isMouseOnLand;
}

bool isInsertMode() const
{
return _tweaker.shown
? opt.insertAssignmentsWhenTweakerShown.value
: opt.insertAssignmentsWhenTweakerHidden.value;
}

bool multiplayer() const
{
return nurse.stateOnlyPrivatelyForGame.multiplayer;
Expand Down
6 changes: 6 additions & 0 deletions src/game/core/passive.d
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ calcPassive(
if (! underCursor.best.empty) {
game._effect.changeLocalStyleToAlsoControlled(
underCursor.best.front.lixxie.style);
if (game.isInsertMode && game.canWeClickAirNowToCutGlobalFuture) {
game._mapClickExplainer.suggestTooltip(Tooltip.ID.clickToInsert);
}
}
if (game.canWeClickAirNowToCutGlobalFuture) {
game._mapClickExplainer.suggestTooltip(Tooltip.ID.clickToCancelReplay);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/game/panel/tooltip.d
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ struct Tooltip {
queueBuilder = 0x8000,
queuePlatformer = 0x1_0000,
holdToScroll = 0x2_0000,
clickToCancelReplay = 0x4_0000,
clickToInsert = 0x4_0000,
clickToCancelReplay = 0x8_0000,
framestepOrQuit = 0x20_0000,
}

Expand Down Expand Up @@ -108,6 +109,7 @@ Tooltip makeTooltip(Tooltip.ID id) nothrow @nogc @safe
case ID.queuePlatformer: return none(Lang.gameQueuePlatformer);
case ID.holdToScroll: return key(Lang.gameHoldToScroll, keyScroll);
case ID.clickToCancelReplay: return none(Lang.gameClickToCancelReplay);
case ID.clickToInsert: return none(Lang.gameClickToInsert);

case ID.framestepOrQuit:
return key(Lang.gameFramestepOrQuit, keyGameExit);
Expand Down

0 comments on commit 9f572b2

Please sign in to comment.