public void initDefaultBind() { coActionMap moveMap = "moveMap"; if (moveMap.isObject()) { moveMap.delete(); } new Torque_Class_Helper("ActionMap", "moveMap").Create(); if (console.GetVarString("$Player::CurrentFOV") == "") { console.SetVar("$Player::CurrentFOV", console.GetVarFloat("$pref::Player::DefaultFOV") / (float)2.0); } console.SetVar("$MFDebugRenderMode", 0); coActionMap vehicleMap = "vehicleMap"; if (vehicleMap.isObject()) { vehicleMap.delete(); } new Torque_Class_Helper("ActionMap", "vehicleMap").Create(); }
public void ActionMapblockBind(coActionMap thisobj, coActionMap othermap, string command) { if (othermap.isObject()) { Util._error("ActionMap::blockBind - \"" + othermap + "\" is not an object!"); return; } string bind = othermap.getBinding(command); if (bind != "") { thisobj.bind(Util.getField(bind, 0), Util.getField(bind, 1), ""); } }
public void dumpKeybindings() { for (int i = 0; i < console.GetVarInt("$keybindCount"); i++) { coActionMap bindobj = console.GetVarString("$keybindMap[%i]"); if (!bindobj.isObject()) { continue; } string prefspath = console.Call("getPrefsPath", new[] { "bind.cs" }); bindobj.save(prefspath, i != 0); bindobj.delete(); } }
public void ActionMapcopyBind(coActionMap thisobj, coActionMap otherMap, string command) { if (otherMap.isObject()) { Util._error("ActionMap::copyBind - \"" + otherMap + "\" is not an object!"); return; } string bind = otherMap.getBinding(command); if (bind == "") { return; } string device = Util.getField(bind, 0); string action = Util.getField(bind, 1); string flags = otherMap.isInverted(device, action) ? "SDI" : "SD"; string deadzone = otherMap.getDeadZone(device, action); float scale = otherMap.getScale(device, action); thisobj.bind(device, action, flags, deadzone, scale.AsString(), command); }