Release checklist: no cheat console for players, Steam required, Steam's language wins when changed, menu links, head bob toggle
- The cheat console opens only in the editor, a development build, or with -gcdev - Without steam_appid.txt next to the exe, a failed Steam start says so and quits instead of running offline; -nosteam only works in our own builds - A language picked in the game's Steam properties overrides the one saved in the game, if it changed since - Main menu: language button, Steam page (overlay, else browser), feedback (Steam discussions); "early build" and the AppID gone from the footer - Settings > Game: head bob on/off - The cursor stays inside the window while it's free - -resetsettings puts every setting back as it comes out of the box Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -13,6 +13,9 @@ namespace GrassCutter
|
||||
/// </summary>
|
||||
public static class Cheats
|
||||
{
|
||||
/// <summary>The console is for the team: the editor, a development build, or a build started with -gcdev.</summary>
|
||||
public static readonly bool Allowed = Application.isEditor || Debug.isDebugBuild || CommandLine.Has("-gcdev");
|
||||
|
||||
public class Command
|
||||
{
|
||||
public string name, args, desc;
|
||||
|
||||
@ -11,6 +11,7 @@ namespace GrassCutter
|
||||
Layers.SetupCollisions();
|
||||
Fx.Warmup();
|
||||
_ = Sfx.I;
|
||||
if (CommandLine.Has("-resetsettings")) { for (int t = 0; t <= 5; t++) GameSettings.Defaults(t); Debug.Log("[Boot] settings reset"); }
|
||||
GameSettings.Apply();
|
||||
if (CommandLine.Has("-resetsave")) { TeamState.DeleteSave(); Debug.Log("[Boot] save reset"); }
|
||||
foreach (var d in UnityEngine.InputSystem.InputSystem.devices) Debug.Log($"[Input] device: {d.name} ({d.layout}) {d.description.product}");
|
||||
|
||||
@ -37,6 +37,8 @@ namespace GrassCutter
|
||||
/// <summary>The assistant chips in with tips.</summary>
|
||||
public static bool Tips { get => PlayerPrefs.GetInt("s_tips", 1) == 1; set => PlayerPrefs.SetInt("s_tips", value ? 1 : 0); }
|
||||
/// <summary>The key caps down the right of the screen.</summary>
|
||||
/// <summary>The view rocks a little with each step.</summary>
|
||||
public static bool HeadBob { get => PlayerPrefs.GetInt("s_bob", 1) == 1; set => PlayerPrefs.SetInt("s_bob", value ? 1 : 0); }
|
||||
public static bool KeyHints { get => PlayerPrefs.GetInt("s_hints", 1) == 1; set => PlayerPrefs.SetInt("s_hints", value ? 1 : 0); }
|
||||
|
||||
// ───────────────────────── controls ─────────────────────────
|
||||
@ -127,7 +129,7 @@ namespace GrassCutter
|
||||
{
|
||||
string[][] keys =
|
||||
{
|
||||
new[] { "s_shake", "s_tips", "s_hints" },
|
||||
new[] { "s_shake", "s_bob", "s_tips", "s_hints" },
|
||||
new[] { "s_dmode", "s_fs", "s_resw", "s_resh", "s_vsync", "s_fpscap", "s_fov", "s_bright" },
|
||||
new[] { "s_quality", "s_rscale", "s_shadows", "s_msaa", "s_grass", "s_bloom" },
|
||||
new[] { "s_master", "s_music", "s_sfx", "s_voice", "s_phone", "s_bgsound" },
|
||||
|
||||
@ -126,14 +126,26 @@ namespace GrassCutter
|
||||
|
||||
const string Pref = "s_lang";
|
||||
|
||||
/// <summary>Saved choice, else Steam's language for this game, else the system's, else English.</summary>
|
||||
/// <summary>Steam's language when the choice was saved: a new one picked in the game's Steam properties wins over it.</summary>
|
||||
const string SteamPref = "s_lang_steam";
|
||||
|
||||
/// <summary>Saved choice, else Steam's language for this game, else the system's, else English. A language
|
||||
/// changed in Steam's properties since the choice was saved overrides the choice.</summary>
|
||||
public static void Init()
|
||||
{
|
||||
if (_ready) return;
|
||||
_ready = true;
|
||||
string code = CommandLine.Get("-demolang") ?? CommandLine.Get("-lang");
|
||||
string steam = FromSteam(), steamThen = PlayerPrefs.GetString(SteamPref, "");
|
||||
if (Find(code) == null && Find(steam) != null && steamThen.Length > 0 && steamThen != steam)
|
||||
{
|
||||
code = steam;
|
||||
PlayerPrefs.SetString(Pref, Find(steam).code);
|
||||
PlayerPrefs.SetString(SteamPref, steam);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
if (Find(code) == null) code = PlayerPrefs.GetString(Pref, "");
|
||||
if (Find(code) == null) code = FromSteam();
|
||||
if (Find(code) == null) code = steam;
|
||||
if (Find(code) == null) code = FromSystem();
|
||||
Load(Find(code) ?? All[0]);
|
||||
}
|
||||
@ -152,6 +164,7 @@ namespace GrassCutter
|
||||
if (remember)
|
||||
{
|
||||
PlayerPrefs.SetString(Pref, l.code);
|
||||
PlayerPrefs.SetString(SteamPref, FromSteam() ?? "");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
_ready = true;
|
||||
|
||||
Reference in New Issue
Block a user