Key hints follow the player's own keys; down in fly mode is Ctrl only

The prompts on the HUD and in build mode named E, R, T, LMB and the rest
outright, so they were wrong for anyone who had set other keys. Sixteen of
them now take the key from Binds.Cap: throw / drop / turn, hop off, piece
upgrades, the build help strip, belt laying and moving, the pickup's bed,
'too far', and the three opening hints. The build help strip redraws when
a key is set.

The English text is the key of every translation, so the eleven tables
and the translators' context notes carry the same placeholders
(extract.py --strict: nothing missing, no placeholder mismatch). Turkish
drops the case endings that hung on the key letter.

Ctl: C no longer means 'down' in the cheat fly mode (it is Cruise; the
console's help already said Ctrl), and ShakePressed, which nothing called,
is gone.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Bonchellon
2026-11-22 19:51:30 +03:00
parent 755faf3c62
commit c7ca594b53
18 changed files with 277 additions and 270 deletions

View File

@ -109,7 +109,7 @@ namespace GrassCutter
// ───────────────────────── seat ─────────────────────────
public string Prompt => HasDriver ? null : OnAuto ? Loc.F("Take over the {0} ({1}, {2} / {3})", Def.name, AutoPrompt, GameDefs.Kilos(Tank.Value), GameDefs.Kilos(Capacity)) : Def.bed > 0 ? Loc.F("Ride the {0} ({1} of {2} bundles, E with a bundle loads it)", Def.name, Bed.Count, Def.bed) : Loc.F("Ride the {0} ({1} / {2})", Def.name, GameDefs.Kilos(Tank.Value), GameDefs.Kilos(Capacity));
public string Prompt => HasDriver ? null : OnAuto ? Loc.F("Take over the {0} ({1}, {2} / {3})", Def.name, AutoPrompt, GameDefs.Kilos(Tank.Value), GameDefs.Kilos(Capacity)) : Def.bed > 0 ? Loc.F("Ride the {0} ({1} of {2} bundles, {3} with a bundle loads it)", Def.name, Bed.Count, Def.bed, Binds.Cap(Act.Interact)) : Loc.F("Ride the {0} ({1} / {2})", Def.name, GameDefs.Kilos(Tank.Value), GameDefs.Kilos(Capacity));
public bool CanInteract => !HasDriver;
public void Interact()

View File

@ -80,7 +80,8 @@ namespace GrassCutter
static bool s_sprintOn;
static int s_sprintFrame = -1;
public static bool JumpHeld => !Blocked && (Binds.Held(Act.Jump) || (G != null && G.buttonSouth.isPressed));
public static bool DownHeld => !Blocked && ((K != null && (K.leftCtrlKey.isPressed || K.cKey.isPressed)) || (G != null && G.buttonEast.isPressed));
/// <summary>Down while flying (the cheat fly mode). Ctrl only: C is Cruise.</summary>
public static bool DownHeld => !Blocked && ((K != null && K.leftCtrlKey.isPressed) || (G != null && G.buttonEast.isPressed));
/// <summary>~ / Ё (the key under Esc) or F1: the cheat console. Works even while UI is open.</summary>
public static bool ConsolePressed => Application.isFocused && !Typing && K != null && (K.backquoteKey.wasPressedThisFrame || K.f1Key.wasPressedThisFrame);
public static bool JumpPressed => BotJumpPressed || !Blocked && (Binds.Pressed(Act.Jump) || (G != null && G.buttonSouth.wasPressedThisFrame));
@ -89,7 +90,6 @@ namespace GrassCutter
public static bool AltPressed => BotAltPressed || !Blocked && (Binds.Pressed(Act.Alt) || (G != null && G.leftTrigger.wasPressedThisFrame));
public static bool AltHeld => BotAltHeld || !Blocked && (Binds.Held(Act.Alt) || (G != null && G.leftTrigger.isPressed));
public static bool RotatePressed => !Blocked && (Binds.Pressed(Act.Rotate) || (G != null && G.buttonNorth.wasPressedThisFrame));
public static bool ShakePressed => !Blocked && ((K != null && K.fKey.wasPressedThisFrame) || (G != null && G.dpad.up.wasPressedThisFrame));
public static bool BuildPressed => !Blocked && Binds.Pressed(Act.Build);
public static bool BotMovePressed, BotCopyPressed;
public static bool CtrlHeld => !Blocked && K != null && K.leftCtrlKey.isPressed;

View File

@ -339,7 +339,8 @@ namespace GrassCutter
{
HideGhosts();
Valid = false;
Reason = Target ? (Target.Def.company ? Loc.T("Company property") : Target.Run ? Loc.F("{0:0.#} m of belt · MMB copy · RMB remove", Target.Run.Metres) : Loc.T("T move · MMB copy · RMB remove")) : null;
Reason = Target ? (Target.Def.company ? Loc.T("Company property") : Target.Run ? Loc.F("{0:0.#} m of belt · {1} copy · {2} remove", Target.Run.Metres, Binds.Cap(Act.Copy), Binds.Cap(Act.Alt))
: Loc.F("{0} move · {1} copy · {2} remove", Binds.Cap(Act.MovePiece), Binds.Cap(Act.Copy), Binds.Cap(Act.Alt))) : null;
}
static void Refuse(string reason)
@ -375,7 +376,7 @@ namespace GrassCutter
var at = port ? from.at : Lifted();
Valid = port || BuildRules.CutUnder(at);
Reason = Valid ? null : BuildRules.Uncut;
Note = port ? Loc.T("LMB: go on from this end") : Loc.F("LMB where the belt starts · height {0:0.0} m", Height);
Note = port ? Loc.F("{0}: go on from this end", Binds.Cap(Act.Use)) : Loc.F("{1} where the belt starts · height {0:0.0} m", Height, Binds.Cap(Act.Use));
ShowRun(at, at + (port ? from.dir : Heading(Planet.Up(at))), Valid);
if (!Ctl.UsePressed) return;
if (Valid) { _from = at; Laying = true; }
@ -396,7 +397,7 @@ namespace GrassCutter
double price = GameDefs.BeltPrice(Vector3.Distance(_from, to));
if (Valid && ts && ts.Money.Value < price) { Valid = false; reason = Loc.T("Not enough cash"); }
Reason = reason;
Note = Loc.F("{0:0.#} m, {1} · height {2:0.0} m · RMB stops", Vector3.Distance(_from, to), UIK.Money(price), Height);
Note = Loc.F("{0:0.#} m, {1} · height {2:0.0} m · {3} stops", Vector3.Distance(_from, to), UIK.Money(price), Height, Binds.Cap(Act.Alt));
ShowRun(_from, to, Valid);
if (!Ctl.UsePressed) return;
if (!Valid) { Refuse(reason); return; }
@ -586,7 +587,7 @@ namespace GrassCutter
{
var p = Moving;
if (!p || !p.IsSpawned || Ctl.AltPressed) { EndMove(); HideGhosts(); return; }
Note = Loc.F("Moving {0}: LMB put down · R rotate · RMB cancel", p.Def.name);
Note = Loc.F("Moving {0}: {1} put down · {2} rotate · {3} cancel", p.Def.name, Binds.Cap(Act.Use), Binds.Cap(Act.Rotate), Binds.Cap(Act.Alt));
if (!_aimed) { HideGhosts(); Valid = false; Reason = null; return; }
Spot(p.piece, out var at, out var rot);
Valid = BuildRules.CanPlace(p.Def, at, rot, p, out var reason);

View File

@ -172,7 +172,7 @@ namespace GrassCutter
_buildCats = UIK.El("build-cats", _build);
_buildRow = UIK.El("build-row", _build);
_buildReason = UIK.Text("", "t-body t-outline build-reason", _build, false);
_buildHelp = UIK.Text(Loc.T("WHEEL piece · LMB place · R rotate · T move · MMB copy · RMB remove · CTRL+WHEEL height · F free"), "t-small t-outline", _build, false);
_buildHelp = UIK.Text(BuildHelp(), "t-small t-outline", _build, false);
_build.style.display = DisplayStyle.None;
// how wide the blade in hand cuts, drawn to scale across the aim
@ -227,8 +227,13 @@ namespace GrassCutter
{
foreach (var (cap, act) in _caps) cap.text = Binds.Cap(act);
if (_hints != null) _hints.style.display = GameSettings.KeyHints ? DisplayStyle.Flex : DisplayStyle.None;
if (_buildHelp != null) _buildHelp.text = BuildHelp();
}
/// <summary>The line under the build palette, with the player's own keys.</summary>
static string BuildHelp() => Loc.F("WHEEL piece · {0} place · {1} rotate · {2} move · {3} copy · {4} remove · CTRL+WHEEL height · {5} free",
Binds.Cap(Act.Use), Binds.Cap(Act.Rotate), Binds.Cap(Act.MovePiece), Binds.Cap(Act.Copy), Binds.Cap(Act.Alt), Binds.Cap(Act.Free));
// ───────────────────────── static api ─────────────────────────
/// <summary>Every toast off the screen at once.</summary>
@ -620,12 +625,12 @@ namespace GrassCutter
// only when it matters: standing still, unloading, feeding a belt or full. The markers show where to go.
var v = p.Vehicle;
bool still = v && v.Body && v.Body.linearVelocity.magnitude < 0.6f;
if (v && v.Def.bed > 0) { key = Binds.Cap(Act.MovePiece); prompt = v.Bed.Count > 0 ? Loc.T("Tip the bundles out behind") : still ? Loc.T("Empty bed · E with a bundle in your arms loads it") : null; }
if (v && v.Def.bed > 0) { key = Binds.Cap(Act.MovePiece); prompt = v.Bed.Count > 0 ? Loc.T("Tip the bundles out behind") : still ? Loc.F("Empty bed · {0} with a bundle in your arms loads it", Binds.Cap(Act.Interact)) : null; }
else if (v && v.Baling) { key = ""; prompt = Loc.T("Baling onto the belt…"); }
else if (v && v.Unloading) { key = ""; prompt = Loc.T("Unloading…"); hot = true; }
else if (v && v.Capacity > 0f && v.Load >= v.Capacity * 0.9f) { key = ""; prompt = Loc.T("Hopper full: drive to an UNLOAD marker"); }
else if (v && VehicleShed.Near(v.transform.position)) { key = Binds.Cap(Act.Boots); prompt = Loc.T("Garage: upgrade this machine"); hot = true; }
else if (still) prompt = Loc.T("Hop off [R] View");
else if (still) prompt = Loc.F("Hop off [{0}] View", Binds.Cap(Act.View));
}
else if (active && p.Grab.Holding)
{
@ -638,7 +643,8 @@ namespace GrassCutter
else
{
key = Binds.Cap(Act.Use);
prompt = bundle ? Loc.T("Throw it in the DEPOT or onto a belt [E] Drop [R] Turn") : Loc.T("Throw [E] Drop [R] Turn");
string drop = Binds.Cap(Act.Interact), turn = Binds.Cap(Act.Rotate);
prompt = bundle ? Loc.F("Throw it in the DEPOT or onto a belt [{0}] Drop [{1}] Turn", drop, turn) : Loc.F("Throw [{0}] Drop [{1}] Turn", drop, turn);
}
}
else if (active && p.HasAim && p.AimHit.collider)
@ -653,7 +659,7 @@ namespace GrassCutter
if (aimed && !building)
{
string tier = aimed.Upgrades != UpgradeKind.None ? aimed.Switched ? Loc.F("{0}, stopped", GameDefs.TierName(aimed.Tier.Value)) : GameDefs.TierName(aimed.Tier.Value) : "";
prompt = Loc.F("{0} [T] Upgrades & settings", prompt ?? aimed.Def.name + (tier.Length > 0 ? " " + tier : ""));
prompt = Loc.F("{0} [{1}] Upgrades & settings", prompt ?? aimed.Def.name + (tier.Length > 0 ? " " + tier : ""), Binds.Cap(Act.MovePiece));
}
else if (prompt == null && p.AimGrabbable && !p.AimGrabbable.IsHeld)
{
@ -664,7 +670,7 @@ namespace GrassCutter
}
else if (active && !tools.IsCutting && Ctl.UseHeld && tools.OutOfRange && GameDefs.IsBlade(tools.Current))
{
key = "LMB";
key = Binds.Cap(Act.Use);
prompt = Loc.T("Too far — get closer to the grass");
}
@ -843,19 +849,19 @@ namespace GrassCutter
float cap = tools.CurrentCap;
if (tools.Belt.Count == 0)
{
hint = Loc.T("Empty hands! Walk to the SUPPLY WALL on the west side of the deck and take the nail scissors (E).");
hint = Loc.F("Empty hands! Walk to the SUPPLY WALL on the west side of the deck and take the nail scissors ({0}).", Binds.Cap(Act.Interact));
voice = "asst_tools";
}
else if (ts.Shipped.Value < 5d)
{
if (GameDefs.IsBlade(tools.Current) && _local.Tank.Value >= cap - 0.01f)
{
hint = Loc.T("Container full! Press E at the DEPOT to hand it all in, or Q to tie a 1 kg bundle you can carry and throw.");
hint = Loc.F("Container full! Press {0} at the DEPOT to hand it all in, or {1} to tie a 1 kg bundle you can carry and throw.", Binds.Cap(Act.Interact), Binds.Cap(Act.Pack));
voice = "asst_full";
}
else if (GameDefs.IsBlade(tools.Current) && _local.Tank.Value < 0.01f)
{
hint = Loc.T("Hop down to the meadow (SPACE at the railing) and HOLD LEFT CLICK: sweep the blade over the grass. Earth needs every blade of it.");
hint = Loc.F("Hop down to the meadow ({0} at the railing) and HOLD {1}: sweep the blade over the grass. Earth needs every blade of it.", Binds.Cap(Act.Jump), Binds.Cap(Act.Use));
voice = "asst_mow";
}
}