public void Update() { if (UGuiManager.Instance.HasFocusedInput() || Blocked) { return; } foreach (var bind in Binds) { var keyDown = bind.JustDown(); var keyUp = bind.JustUp(); bind.IsPressed = keyDown && !keyUp; if (bind.Type == BindType.Hold) { if (bind.IsPressed) { DevConsole.ExecuteLine(bind.Command); } else if (keyUp) { DevConsole.ExecuteLine(bind.ReleaseCommand); } } else if (keyDown) { DevConsole.ExecuteLine(bind.Command); } } }
protected override void _Start() { if (LaunchParams.Contains("connect")) { DevConsole.ExecuteLine($"net.connect {LaunchParams.CommandLine.Arguments["connect"][0]}"); } }
private void ExecuteUserSettings() { foreach (var s in _config["UserSettings"]) { var line = $"{s.Name} {s.StringValue}"; DevConsole.ExecuteLine(line); } }
public override void Update() { if (_refresh) { DevConsole.ExecuteLine("plugins.reload"); _refresh = false; } }
private void SaveChanges() { foreach (var kvp in _pendingChanges) { DevConsole.ExecuteLine(kvp.Value.Data.Command); } ClearChanges(); }
protected override void _Start() { _canSetResolution = true; foreach (var userSetting in DevConsole.GetVariablesWithFlags(ConVarFlags.UserSetting)) { DevConsole.ExecuteLine(userSetting + " \"" + DevConsole.GetVariableAsString(userSetting) + "\""); } }
private void OnInputSubmit(string contents) { if (!string.IsNullOrWhiteSpace(contents)) { DevConsole.ExecuteLine(contents); InputHistory.PushFront(contents); } _inputField.text = string.Empty; _inputField.ActivateInputField(); }
private void SetPotatoMode(string[] args) { QualitySettings.vSyncCount = 0; QualitySettings.maxQueuedFrames = 2; QualitySettings.maximumLODLevel = 0; QualitySettings.skinWeights = SkinWeights.OneBone; SetFancy(false); DevConsole.ExecuteLine("graphics.postprocessing false"); DevConsole.ExecuteLine("graphics.antialiasing 1"); DevConsole.ExecuteLine("graphics.shadows false"); }
protected override void OnPlayerPacketReceived(IPlayer player, IBasePacket packet) { if (Game.IsHost || FSGameLoop.GetGameInstance(true) != null || !(packet is CustomPacket cp && cp.Label == "Replicate")) { return; } var replStr = cp.GetString(0); var cmds = replStr.Split('&'); if (cmds != null && cmds.Length > 0) { foreach (var cmd in cmds) { DevConsole.ExecuteLine(cmd); } } }
public async Task <GameLoadResult> CreateServerAsync(string mapName, string gamemode, string name = null, string pass = null) { if (GameServer.Instance != null) { GameServer.Instance.Destroy(); await Task.Delay(100); } Loading = true; LoadingHint = "Creating server"; var obj = new GameObject("[Server]"); var server = obj.AddComponent <GameServer>(); server.IsLocalServer = true; if (!string.IsNullOrEmpty(name)) { DevConsole.ExecuteLine("server.name \"" + name + "\""); } if (!string.IsNullOrEmpty(pass)) { DevConsole.ExecuteLine("server.password \"" + pass + "\""); } var result = await server.GameLoader.CreateGameAsync(mapName, gamemode); if (result != GameLoadResult.Success) { Debug.LogError("F****d: " + result); server.Destroy(); if (!Game.IsHost) { SceneManager.LoadScene(GameData.Instance.MainMenu.ScenePath); UGuiManager.Instance.Popup("Couldn't load that map, something went wrong."); } Loading = false; } return(result); }
public void ExecutePostLoad() { foreach (var cfg in _configs.Keys) { foreach (var section in cfg) { if (section.Name != "PostLoad") { continue; } foreach (Setting setting in section) { if (setting.IsArray) { continue; } var lineToExecute = setting.Name + " " + setting.RawValue; DevConsole.ExecuteLine(lineToExecute); } } } }
private Configuration Read(string path, string primaryName) { try { var config = Configuration.LoadFromFile(path); if (config == null) { DevConsole.WriteLine("Invalid config path:" + path); return(null); } foreach (Section section in config) { if (section.Name == "PostLoad" || section.Name == "Binds") { continue; } foreach (Setting setting in section) { if (setting.IsArray) { continue; } var lineToExecute = setting.Name + " " + setting.RawValue; DevConsole.ExecuteLine(lineToExecute); } } return(config); } catch (System.Exception e) { DevConsole.WriteLine(e.ToString()); } return(null); }
private void ProcessInput(string message) { DevConsole.ExecuteLine(message); }
void OnInputText(string obj) { DevConsole.ExecuteLine(obj); }