void OnConsoleCommand_setcfgvar(NotificationCenter.Notification n) { if (n.getArgCount() == 2) { $"setcfgvar: '{n.getArg(0)}' '{n.getArg(1)}'".logDbg(); setFieldValue(n.getArg(0), n.getArg(1)); } }
void OnConsoleCommand_dumpresource(NotificationCenter.Notification n) { if (n.getArgCount() == 0) { return; } Resources.Load <GameObject>(n.getArg(0))?.dump(); }
void OnConsoleCommand_pinpatches(NotificationCenter.Notification n) { const float refreshSecs = 0.5f; StopAllCoroutines(); GameUtils.clearScreenMessages(); if (n.getArgCount() > 0) { StartCoroutine(_printPatches(n.getArg(0), n.getArg <bool>(1))); }
void OnConsoleCommand_findtech(NotificationCenter.Notification n) { if (n.getArgCount() == 0) { return; } var matched = techtypeCache.find(n.getArg(0)); L10n.str("ids_findEntries").format(matched.Count).onScreen(); showMessages(matched, L10n.str("ids_techType")); }
void OnConsoleCommand_getcfgvar(NotificationCenter.Notification n) { $"getcfgvar: '{n.getArg(0)}'".logDbg(); if (n.getArgCount() != 1) { return; } string fieldName = n.getArg(0); object value = getFieldValue(fieldName); if (value != null) { $"{fieldName} = {value}".onScreen(); } }
void OnConsoleCommand_dumpprefab(NotificationCenter.Notification n) { if (n.getArgCount() == 0) { return; } if (n.getArg(0) == "all") { StartCoroutine(_dumpAllPrefabs()); } else { if (UWE.Utils.TryParseEnum(n.getArg(0), out TechType techType)) { CraftData.GetPrefabForTechType(techType)?.dump(techType.AsString()); } }