ModuleInput::ModuleInput() : ModuleBase("Input") { VarInputRawInput = AddVariableInt("RawInput", "rawinput", "Enables raw mouse input with no acceleration applied", eCommandFlagsArchived, 1, VariableInputRawInputUpdate); VarInputRawInput->ValueIntMin = 0; VarInputRawInput->ValueIntMax = 1; AddCommand("Bind", "bind", "Binds a command to a key", eCommandFlagsNone, CommandBind, { "key", "[+]command", "arguments" }); Patches::Input::RegisterDefaultInputHandler(KeyboardUpdated); AddCommand("UIButtonPress", "ui_btn_press", "Emulates a gamepad button press on UI menus", eCommandFlagsNone, CommandUIButtonPress, { "btnCode The code of the button to press" }); CommandBindControllerAction = AddCommand("ControllerAction", "controller", "Binds an in-game action to a controller button", eCommandFlagsNone, ::CommandBindControllerAction, { "action The name of the action to bind", "button The button name" }); CommandBindKeyboardAction = AddCommand("KeyboardAction", "keyboard", "Binds an in-game action to keyboard keys or mouse buttons", eCommandFlagsNone, ::CommandBindKeyboardAction, { "action The name of the action to bind", "[primary] The primary key name", "[secondary] The secondary key name" }); #ifdef _DEBUG AddCommand("DebugBindings", "debugbindings", "Dumps the input bindings table", eCommandFlagsNone, CommandDumpBindings); #endif VarControllerSensitivityX = AddVariableFloat("ControllerSensitivityX", "xsens", "Horizontal controller look sensitivity", eCommandFlagsArchived, 120, VariableControllerSensitivityXUpdated); VarControllerSensitivityY = AddVariableFloat("ControllerSensitivityY", "ysens", "Vertical controller look sensitivity", eCommandFlagsArchived, 60, VariableControllerSensitivityYUpdated); LoadDefaultBindings(); BuildSettingsMenu(); // Default command bindings (TODO: port bind saving code from recode) commandBindings[eKeyCodeA].command = { "ui_btn_press", "0" }; // A commandBindings[eKeyCodeB].command = { "ui_btn_press", "1" }; // B commandBindings[eKeyCodeEnd].command = { "ui_btn_press", "1" }; // B commandBindings[eKeyCodeHome].command = { "ui_btn_press", "2" }; // X }
ModuleTime::ModuleTime() : ModuleBase("Time") { VarSpeed = AddVariableFloat("GameSpeed", "game_speed", "The game's speed", eCommandFlagsCheat, 1.0f); VarSpeed->ValueFloatMin = 0.0f; VarSpeed->ValueFloatMax = 10.0f; VarSpeedClient = AddVariableFloat("GameSpeedClient", "game_speed_client", "The game's speed", eCommandFlagsInternal, 1.0f, VariableGameSpeedUpdate); Server::VariableSynchronization::Synchronize(VarSpeed, VarSpeedClient); }
ModuleVoIP::ModuleVoIP() : ModuleBase("VoIP") { //Push To Talk VarVoIPPushToTalk = AddVariableInt("PushToTalk", "voip_ptt", "If push to talk is enabled.", eCommandFlagsArchived, 1, VariablePushToTalkUpdate); VarVoIPPushToTalk->ValueIntMin = 0; VarVoIPPushToTalk->ValueIntMax = 1; //Volume Modifier VarVoIPVolumeModifier = AddVariableInt("VolumeModifier", "voip_vm", "Modify the volume of other speakers (db)." "0 = no modification, negative values make the signal quieter," "greater than zero boost the signal louder. High positive values = really bad audio quality." , eCommandFlagsArchived, 6, VariableVolumeModifierUpdate); VarVoIPVolumeModifier->ValueInt64Min = -15; VarVoIPVolumeModifier->ValueInt64Max = 30; //Automatic Gain Control VarVoIPAGC = AddVariableInt("AGC", "voip_agc", "Automatic Gain Control keeps volumes level with each other. Less really soft, and less really loud.", eCommandFlagsArchived, 1, VariableAGCUpdate); VarVoIPAGC->ValueIntMin = 0; VarVoIPAGC->ValueIntMax = 1; //Echo Cancellation VarVoIPEchoCancellation = AddVariableInt("EchoCancellation", "voip_ec", "Reduces echo over voice chat", eCommandFlagsArchived, 1, VariableEchoCancellationUpdate); VarVoIPEchoCancellation->ValueIntMin = 0; VarVoIPEchoCancellation->ValueIntMax = 1; //Voice Activation Detection Level VarVoIPVADLevel = AddVariableFloat("VoiceActivationLevel", "voip_vadlevel", "A high voice activation level means you have to speak louder into the microphone" "in order to start transmitting. Reasonable values range from -50 to 50. Default is -45." , eCommandFlagsArchived, -45.0f, VariableVADLevelUpdate); VarVoIPVADLevel->ValueFloatMin = -50.0f; VarVoIPVADLevel->ValueFloatMax = 50.0f; //Should we start a VoIP Server? VarVoIPServerEnabled = AddVariableInt("ServerEnabled", "voip_server", "Enabled or disable the VoIP Server.", eCommandFlagsArchived, 1, VariableServerEnabledUpdate); VarVoIPServerEnabled->ValueIntMin = 0; VarVoIPServerEnabled->ValueIntMax = 1; //Are we talking right now? VarVoIPTalk = AddVariableInt("Talk", "voip_Talk", "Enables or disables talking (for push to talk)", eCommandFlagsNone, 0); VarVoIPTalk->ValueIntMin = 0; VarVoIPTalk->ValueIntMax = 1; //Should we start a VoIP client? VarVoIPEnabled = AddVariableInt("Enabled", "voip_enabled", "Enabled or disable the VoIP Client.", eCommandFlagsArchived, 1, VariableEnabledUpdate); VarVoIPEnabled->ValueIntMin = 0; VarVoIPEnabled->ValueIntMax = 1; AddCommand("MutePlayer", "mute", "Toggles mute on a player in VoIP", eCommandFlagsNone, CommandVoIPMutePlayer, { "playername/UID The name or UID of the player to mute or unmute" }); }
ModuleForge::ModuleForge() : ModuleBase("Forge") { VarCloneDepth = AddVariableFloat("CloneDepth", "forge_clone_depth", "Depth at which the object will be cloned", eCommandFlagsNone, 1.0f); VarCloneMultiplier = AddVariableInt("CloneMultiplier", "forge_clone_multiplier", "Number of consecutive times the object will be cloned", eCommandFlagsNone, 1); VarRotationSnap = AddVariableFloat("RotationSnap", "forge_rotation_snap", "Angle in degrees at which object rotation will be snapped", eCommandFlagsNone, 0); VarRotationSensitivity = AddVariableFloat("RotationSensitivity", "forge_rotation_sensitivity", "Controls the sensitivity of object rotation", eCommandFlagsArchived, 1.0f); VarMonitorSpeed = AddVariableFloat("MonitorSpeed", "forge_monitor_speed", "Controls the movement speed of the monitor", eCommandFlagsArchived, 1.0f); VarSelectionRenderer = AddVariableInt("SelectionRenderer", "forge_selection_renderer", "Set the selection renderer to use", eCommandFlagsArchived, 0); VarSelectionRenderer->ValueIntMin = 0; VarSelectionRenderer->ValueIntMax = 1; VarMagnetsEnabled = AddVariableInt("Magnets", "forge_magnets", "Controls whether magnets are enabled (1) or disabled (0)", eCommandFlagsArchived, 0); VarMagnetsEnabled->ValueIntMin = 0; VarMagnetsEnabled->ValueIntMax = 1; VarMagnetsVisible = AddVariableInt("MagnetsVisible", "forge_magnets_visible", "Controls whether magnets are shown (1) or hidden (0)", eCommandFlagsArchived, 1); VarMagnetsVisible->ValueIntMin = 0; VarMagnetsVisible->ValueIntMax = 1; VarMaxGrabDistance = AddVariableFloat("GrabDistance", "forge_grab_distance", "Controls the maximum distance from which objects can be grabbed", eCommandFlagsArchived, 5.0f); VarMagnetsStrength = AddVariableFloat("MagnetsStrength", "forge_magnets_strength", "Controls the minimum distance at which magnets snap", eCommandFlagsArchived, 0.3f); VarShowInvisibles = AddVariableInt("ShowInvisibles", "forge_show_invisibles", "When enabled forces invisible materials to be visible", eCommandFlagsNone, 0.0f); VarShowInvisibles->ValueIntMin = 0; VarShowInvisibles->ValueIntMax = 1; AddCommand("DeleteAll", "forge_delete_all", "Delete all objects that are the same as the object under the crosshair", eCommandFlagsHostOnly, CommandDeleteAll); AddCommand("Canvas", "forge_canvas", "Delete all objects on the map", eCommandFlagsHostOnly, CommandCanvas); AddCommand("SelectAll", "forge_select_all", "Select all objects that are the same as the object under the crosshair", eCommandFlagsNone, CommandSelectAll); AddCommand("DeselectAll", "forge_deselect_all", "Deselect all selected objects", eCommandFlagsNone, CommandDeselectAll); AddCommand("DeselectAllOf", "forge_deselect_all_of", "Deselect all selected objects that are the same as the object under the crosshair", eCommandFlagsNone, CommandDeselectAllOf); AddCommand("SavePrefab", "forge_prefab_save", "Save prefab to a file", eCommandFlagsNone, CommandSavePrefab); AddCommand("LoadPrefab", "forge_prefab_load", "Load prefab from a file", eCommandFlagsNone, CommandLoadPrefab); AddCommand("DumpPrefabs", "forge_prefab_dump", "Dump a list of saved prefabs in json", eCommandFlagsNone, CommandDumpPrefabs); AddCommand("DumpPalette", "forge_dump_palette", "Dumps the forge palette in json", eCommandFlagsNone, CommandDumpPalette); AddCommand("SpawnItem", "forge_spawn", "Spawn an item from the forge palette", eCommandFlagsNone, CommandSpawnItem); AddCommand("SetPrematchCamera", "forge_set_prematch_camera", "Set the position/orientation of the prematch camera", eCommandFlagsHostOnly, CommandPrematchCamera); }
ModuleTime::ModuleTime() : ModuleBase("Time") { VarSpeed = AddVariableFloat("GameSpeed", "game_speed", "The game's speed", eCommandFlagsCheat, 1.0f, VariableGameSpeedUpdate); VarSpeed->ValueFloatMin = 0.0f; VarSpeed->ValueFloatMax = 10.0f; }