Feedback round: bots that keep working, Sky Mower, calmer HUD, faster menus, new map

- Robot docks and drone pads with no belt ship straight to Earth; robots widen
  their rings up to 4x once everything in reach is mown, travel 2.5x faster
  empty, hoppers 60/150 kg. Drone reach 70 m + 25 m per upgrade.
- New Sky Mower: a big mowing drone on a pad, 91 sectors, flies over the grass.
- Cut paint follows the blade as a strip, no disc ahead of the machine.
- Sector toasts aggregate, chimes and till sounds throttled, toasts moved and
  narrowed.
- Menus no longer rebuild on every money change (price tint follows the
  wallet), scroll position kept.
- Map drawn as one mesh, opens near the player, ME / + / - / GLOBE, scale bar.
- Key-art still (x_key) and -shotsize for the store stills; -demobots test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NiemandKG
2026-11-09 15:38:37 +06:00
parent d1c3761e58
commit 27d075103b
44 changed files with 6801 additions and 5733 deletions

View File

@ -55,6 +55,9 @@ namespace GrassCutter
foreach (var o in GameDefs.ToolOrder)
if (me && !me.Owns(o)) { _selected = (int)o; break; }
Rebuild(true);
// the wallet moves all the time: it recolours the prices and the pill, it doesn't rebuild the card
UIK.FollowWallet(Card);
Card.schedule.Execute(() => { if (Ts) _money.text = UIK.Money(Ts.Money.Value); }).Every(250);
}
void Refresh() => Rebuild(false);
@ -73,12 +76,12 @@ namespace GrassCutter
string sub = GameDefs.IsBlade(t) ? Loc.F("{0:0.#} cm · {1:0.##} kg", ts.ToolWidth(t) * 100f, ts.ToolCap(t)) : Loc.T("Build menu");
double price = ts.ToolPrice(d);
string tag = me.Owns(t) ? (me.Tools.Belt.Contains(t) ? Loc.T("ON BELT") : Loc.T("OWNED")) : price <= 0d ? Loc.T("FREE") : UIK.Money(price);
Item(i, d.icon, d.name, sub, tag, !me.Owns(t) && ts.Money.Value >= price, animate);
Item(i, d.icon, d.name, sub, tag, me.Owns(t) ? -1d : price, animate);
}
int slots = me.BeltSlots.Value;
bool maxed = slots >= GameDefs.MaxBeltSlots;
long slotPrice = GameDefs.BeltSlotPrice(slots);
Item(SlotItem, "icon_perk_release", Loc.T("Belt Slot"), Loc.F("{0} / {1} slots", slots, GameDefs.MaxBeltSlots), maxed ? Loc.T("MAXED") : UIK.Money(slotPrice), !maxed && ts.Money.Value >= slotPrice, animate);
Item(SlotItem, "icon_perk_release", Loc.T("Belt Slot"), Loc.F("{0} / {1} slots", slots, GameDefs.MaxBeltSlots), maxed ? Loc.T("MAXED") : UIK.Money(slotPrice), maxed ? -1d : slotPrice, animate);
Gear(JetItem, GearId.Jetpack, "icon_perk_jetpack", Loc.T("Jetpack"), Loc.T("Dash in the air"), animate);
Gear(BootItem, GearId.Boots, "icon_perk_boots", Loc.T("Gravity Boots"), Loc.T("G: Earth's pull"), animate);
Gear(NightItem, GearId.NightVision, "icon_perk_pure", Loc.T("Night Vision"), Loc.T("N: see in the dark"), animate);
@ -89,10 +92,10 @@ namespace GrassCutter
{
bool has = Me.HasGear(g);
long price = GameDefs.GearPrice(g);
Item(id, icon, name, sub, has ? Loc.T("OWNED") : UIK.Money(price), !has && Ts.Money.Value >= price, animate);
Item(id, icon, name, sub, has ? Loc.T("OWNED") : UIK.Money(price), has ? -1d : price, animate);
}
void Item(int id, string icon, string name, string sub, string tag, bool afford, bool animate)
void Item(int id, string icon, string name, string sub, string tag, double cost, bool animate)
{
var e = UIK.El("supply-item", _grid);
e.pickingMode = PickingMode.Position;
@ -102,7 +105,7 @@ namespace GrassCutter
UIK.Text(sub, "supply-sub", e, false).pickingMode = PickingMode.Ignore;
var t = UIK.Text(tag, "supply-tag", e, false);
t.pickingMode = PickingMode.Ignore;
t.EnableInClassList("supply-tag-afford", afford);
if (cost >= 0d) UIK.Costs(t, cost, "supply-tag-afford", null);
e.RegisterCallback<ClickEvent>(_ => { _selected = id; Sfx.Play("ui_click", 0.6f, 1.1f); Rebuild(false); });
e.RegisterCallback<MouseEnterEvent>(_ => Sfx.Play("ui_hover", 0.35f, 1.2f));
if (animate) UIK.PopIn(e, 0.03f * id, 0.3f);
@ -172,14 +175,14 @@ namespace GrassCutter
int slots = me.BeltSlots.Value;
if (slots >= GameDefs.MaxBeltSlots) { Done(Loc.T("MAXED OUT!")); return; }
long price = GameDefs.BeltSlotPrice(slots);
Buy(Loc.F("BUY {0}", UIK.Money(price)), ts.Money.Value >= price, () => ts.BuyBeltSlotRpc());
Buy(Loc.F("BUY {0}", UIK.Money(price)), price, () => ts.BuyBeltSlotRpc());
}
else if (_selected >= JetItem)
{
var g = _selected == JetItem ? GearId.Jetpack : _selected == BootItem ? GearId.Boots : GearId.NightVision;
if (me.HasGear(g)) { Done(Loc.T("OWNED")); return; }
long price = GameDefs.GearPrice(g);
Buy(Loc.F("BUY {0}", UIK.Money(price)), ts.Money.Value >= price, () => ts.BuyGearRpc((byte)g));
Buy(Loc.F("BUY {0}", UIK.Money(price)), price, () => ts.BuyGearRpc((byte)g));
}
else
{
@ -188,7 +191,7 @@ namespace GrassCutter
if (!me.Owns(t))
{
double price = ts.ToolPrice(GameDefs.Tool(t));
Buy(price <= 0d ? Loc.T("TAKE IT") : Loc.F("BUY {0}", UIK.Money(price)), ts.Money.Value >= price, () => ts.BuyToolRpc((byte)t));
Buy(price <= 0d ? Loc.T("TAKE IT") : Loc.F("BUY {0}", UIK.Money(price)), price, () => ts.BuyToolRpc((byte)t));
}
else if (tools.Current == t) Done(Loc.T("IN YOUR HANDS"));
else
@ -201,11 +204,11 @@ namespace GrassCutter
void Done(string text) => UIK.Text(text, "price t-green t-outline t-center", _detail);
void Buy(string label, bool afford, Action buy)
void Buy(string label, double cost, Action buy)
{
var b = UIK.Btn(label, () =>
{
if (!afford)
if (!UIK.CanPay(cost))
{
Sfx.Play("error", 0.7f);
Assistant.Say("asst_nocash"); Hud.Toast(Loc.T("Not enough cash: mow more!"), Hud.ToastKind.Warn);
@ -213,7 +216,8 @@ namespace GrassCutter
}
buy();
Sfx.Play("cash_register", 0.9f);
}, afford ? "btn btn-green" : "btn btn-grey", _detail);
}, "btn", _detail);
UIK.Costs(b, cost);
b.style.alignSelf = Align.Stretch;
}
}