Ejemplo n.º 1
0
 // Token: 0x0600310E RID: 12558 RVA: 0x0013FFD4 File Offset: 0x0013E3D4
 public static void bind(byte index, KeyCode key)
 {
     if (index == ControlsSettings.HUD)
     {
         if (ControlsSettings.isTooImportantToMessUp(key))
         {
             key = KeyCode.Home;
         }
     }
     else if (index == ControlsSettings.OTHER)
     {
         if (ControlsSettings.isTooImportantToMessUp(key))
         {
             key = KeyCode.LeftControl;
         }
     }
     else if (index == ControlsSettings.TERMINAL)
     {
         if (ControlsSettings.isTooImportantToMessUp(key))
         {
             key = KeyCode.BackQuote;
         }
     }
     else if (index == ControlsSettings.REFRESH_ASSETS && ControlsSettings.isTooImportantToMessUp(key))
     {
         key = KeyCode.PageUp;
     }
     if (ControlsSettings.bindings[(int)index] == null)
     {
         ControlsSettings.bindings[(int)index] = new ControlBinding(key);
         return;
     }
     ControlsSettings.bindings[(int)index].key = key;
 }
Ejemplo n.º 2
0
 public static void bind(byte index, KeyCode key)
 {
     if (index == ControlsSettings.HUD)
     {
         if (ControlsSettings.isTooImportantToMessUp(key))
         {
             key = 278;
         }
     }
     else if (index == ControlsSettings.OTHER)
     {
         if (ControlsSettings.isTooImportantToMessUp(key))
         {
             key = 306;
         }
     }
     else if (index == ControlsSettings.TERMINAL)
     {
         if (ControlsSettings.isTooImportantToMessUp(key))
         {
             key = 96;
         }
     }
     else if (index == ControlsSettings.REFRESH_ASSETS && ControlsSettings.isTooImportantToMessUp(key))
     {
         key = 280;
     }
     if (ControlsSettings.bindings[(int)index] == null)
     {
         ControlsSettings.bindings[(int)index] = new ControlBinding(key);
         return;
     }
     ControlsSettings.bindings[(int)index].key = key;
 }
Ejemplo n.º 3
0
 public static void load()
 {
     FilterSettings.load();
     PlaySettings.load();
     GraphicsSettings.load();
     ControlsSettings.load();
     OptionsSettings.load();
     MenuSettings.hasLoaded = true;
 }
Ejemplo n.º 4
0
 public static void save()
 {
     if (!MenuSettings.hasLoaded)
     {
         return;
     }
     FilterSettings.save();
     PlaySettings.save();
     GraphicsSettings.save();
     ControlsSettings.save();
     OptionsSettings.save();
 }
Ejemplo n.º 5
0
 public static void load()
 {
     ControlsSettings.restoreDefaults();
     if (ReadWrite.fileExists("/Controls.dat", true))
     {
         Block block = ReadWrite.readBlock("/Controls.dat", true, 0);
         if (block != null)
         {
             byte b = block.readByte();
             if (b > 10)
             {
                 ControlsSettings.sensitivity = block.readSingle();
                 if (b < 16)
                 {
                     ControlsSettings.sensitivity = 1f;
                 }
                 ControlsSettings.invert = block.readBoolean();
                 if (b > 13)
                 {
                     ControlsSettings.invertFlight = block.readBoolean();
                 }
                 else
                 {
                     ControlsSettings.invertFlight = false;
                 }
                 if (b > 11)
                 {
                     ControlsSettings.aiming    = (EControlMode)block.readByte();
                     ControlsSettings.crouching = (EControlMode)block.readByte();
                     ControlsSettings.proning   = (EControlMode)block.readByte();
                 }
                 else
                 {
                     ControlsSettings.aiming    = EControlMode.HOLD;
                     ControlsSettings.crouching = EControlMode.TOGGLE;
                     ControlsSettings.proning   = EControlMode.TOGGLE;
                 }
                 if (b > 12)
                 {
                     ControlsSettings.sprinting = (EControlMode)block.readByte();
                 }
                 else
                 {
                     ControlsSettings.sprinting = EControlMode.HOLD;
                 }
                 if (b > 14)
                 {
                     ControlsSettings.leaning = (EControlMode)block.readByte();
                 }
                 else
                 {
                     ControlsSettings.leaning = EControlMode.HOLD;
                 }
                 byte b2 = block.readByte();
                 for (byte b3 = 0; b3 < b2; b3 += 1)
                 {
                     if ((int)b3 >= ControlsSettings.bindings.Length)
                     {
                         block.readByte();
                     }
                     else
                     {
                         ushort key = block.readUInt16();
                         ControlsSettings.bind(b3, key);
                     }
                 }
                 if (b < 17)
                 {
                     ControlsSettings.bind(ControlsSettings.DEQUIP, 301);
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
 public static void restoreDefaults()
 {
     ControlsSettings.bind(ControlsSettings.LEFT, 97);
     ControlsSettings.bind(ControlsSettings.RIGHT, 100);
     ControlsSettings.bind(ControlsSettings.UP, 119);
     ControlsSettings.bind(ControlsSettings.DOWN, 115);
     ControlsSettings.bind(ControlsSettings.JUMP, 32);
     ControlsSettings.bind(ControlsSettings.LEAN_LEFT, 113);
     ControlsSettings.bind(ControlsSettings.LEAN_RIGHT, 101);
     ControlsSettings.bind(ControlsSettings.PRIMARY, 323);
     ControlsSettings.bind(ControlsSettings.SECONDARY, 324);
     ControlsSettings.bind(ControlsSettings.INTERACT, 102);
     ControlsSettings.bind(ControlsSettings.CROUCH, 120);
     ControlsSettings.bind(ControlsSettings.PRONE, 122);
     ControlsSettings.bind(ControlsSettings.STANCE, 111);
     ControlsSettings.bind(ControlsSettings.SPRINT, 304);
     ControlsSettings.bind(ControlsSettings.RELOAD, 114);
     ControlsSettings.bind(ControlsSettings.ATTACH, 116);
     ControlsSettings.bind(ControlsSettings.FIREMODE, 118);
     ControlsSettings.bind(ControlsSettings.DASHBOARD, 9);
     ControlsSettings.bind(ControlsSettings.INVENTORY, 103);
     ControlsSettings.bind(ControlsSettings.CRAFTING, 121);
     ControlsSettings.bind(ControlsSettings.SKILLS, 117);
     ControlsSettings.bind(ControlsSettings.MAP, 109);
     ControlsSettings.bind(ControlsSettings.QUESTS, 105);
     ControlsSettings.bind(ControlsSettings.PLAYERS, 112);
     ControlsSettings.bind(ControlsSettings.VOICE, 308);
     ControlsSettings.bind(ControlsSettings.MODIFY, 304);
     ControlsSettings.bind(ControlsSettings.SNAP, 306);
     ControlsSettings.bind(ControlsSettings.FOCUS, 102);
     ControlsSettings.bind(ControlsSettings.ASCEND, 113);
     ControlsSettings.bind(ControlsSettings.DESCEND, 101);
     ControlsSettings.bind(ControlsSettings.TOOL_0, 113);
     ControlsSettings.bind(ControlsSettings.TOOL_1, 119);
     ControlsSettings.bind(ControlsSettings.TOOL_2, 101);
     ControlsSettings.bind(ControlsSettings.TOOL_3, 114);
     ControlsSettings.bind(ControlsSettings.TERMINAL, 96);
     ControlsSettings.bind(ControlsSettings.SCREENSHOT, 277);
     ControlsSettings.bind(ControlsSettings.REFRESH_ASSETS, 280);
     ControlsSettings.bind(ControlsSettings.CLIPBOARD_DEBUG, 281);
     ControlsSettings.bind(ControlsSettings.HUD, 278);
     ControlsSettings.bind(ControlsSettings.OTHER, 306);
     ControlsSettings.bind(ControlsSettings.GLOBAL, 106);
     ControlsSettings.bind(ControlsSettings.LOCAL, 107);
     ControlsSettings.bind(ControlsSettings.GROUP, 108);
     ControlsSettings.bind(ControlsSettings.GESTURE, 99);
     ControlsSettings.bind(ControlsSettings.VISION, 110);
     ControlsSettings.bind(ControlsSettings.TACTICAL, 98);
     ControlsSettings.bind(ControlsSettings.PERSPECTIVE, 104);
     ControlsSettings.bind(ControlsSettings.DEQUIP, 301);
     ControlsSettings.bind(ControlsSettings.ROLL_LEFT, 276);
     ControlsSettings.bind(ControlsSettings.ROLL_RIGHT, 275);
     ControlsSettings.bind(ControlsSettings.PITCH_UP, 273);
     ControlsSettings.bind(ControlsSettings.PITCH_DOWN, 274);
     ControlsSettings.bind(ControlsSettings.YAW_LEFT, 97);
     ControlsSettings.bind(ControlsSettings.YAW_RIGHT, 100);
     ControlsSettings.bind(ControlsSettings.THRUST_INCREASE, 119);
     ControlsSettings.bind(ControlsSettings.THRUST_DECREASE, 115);
     ControlsSettings.bind(ControlsSettings.LOCKER, 111);
     ControlsSettings.bind(ControlsSettings.INSPECT, 102);
     ControlsSettings.bind(ControlsSettings.ROTATE, 114);
     ControlsSettings.aiming       = EControlMode.HOLD;
     ControlsSettings.crouching    = EControlMode.TOGGLE;
     ControlsSettings.proning      = EControlMode.TOGGLE;
     ControlsSettings.sprinting    = EControlMode.HOLD;
     ControlsSettings.leaning      = EControlMode.HOLD;
     ControlsSettings.sensitivity  = 1f;
     ControlsSettings.invert       = false;
     ControlsSettings.invertFlight = false;
 }
Ejemplo n.º 7
0
 // Token: 0x0600310F RID: 12559 RVA: 0x00140088 File Offset: 0x0013E488
 public static void restoreDefaults()
 {
     ControlsSettings.bind(ControlsSettings.LEFT, KeyCode.A);
     ControlsSettings.bind(ControlsSettings.RIGHT, KeyCode.D);
     ControlsSettings.bind(ControlsSettings.UP, KeyCode.W);
     ControlsSettings.bind(ControlsSettings.DOWN, KeyCode.S);
     ControlsSettings.bind(ControlsSettings.JUMP, KeyCode.Space);
     ControlsSettings.bind(ControlsSettings.LEAN_LEFT, KeyCode.Q);
     ControlsSettings.bind(ControlsSettings.LEAN_RIGHT, KeyCode.E);
     ControlsSettings.bind(ControlsSettings.PRIMARY, KeyCode.Mouse0);
     ControlsSettings.bind(ControlsSettings.SECONDARY, KeyCode.Mouse1);
     ControlsSettings.bind(ControlsSettings.INTERACT, KeyCode.F);
     ControlsSettings.bind(ControlsSettings.CROUCH, KeyCode.X);
     ControlsSettings.bind(ControlsSettings.PRONE, KeyCode.Z);
     ControlsSettings.bind(ControlsSettings.STANCE, KeyCode.O);
     ControlsSettings.bind(ControlsSettings.SPRINT, KeyCode.LeftShift);
     ControlsSettings.bind(ControlsSettings.RELOAD, KeyCode.R);
     ControlsSettings.bind(ControlsSettings.ATTACH, KeyCode.T);
     ControlsSettings.bind(ControlsSettings.FIREMODE, KeyCode.V);
     ControlsSettings.bind(ControlsSettings.DASHBOARD, KeyCode.Tab);
     ControlsSettings.bind(ControlsSettings.INVENTORY, KeyCode.G);
     ControlsSettings.bind(ControlsSettings.CRAFTING, KeyCode.Y);
     ControlsSettings.bind(ControlsSettings.SKILLS, KeyCode.U);
     ControlsSettings.bind(ControlsSettings.MAP, KeyCode.M);
     ControlsSettings.bind(ControlsSettings.QUESTS, KeyCode.I);
     ControlsSettings.bind(ControlsSettings.PLAYERS, KeyCode.P);
     ControlsSettings.bind(ControlsSettings.VOICE, KeyCode.LeftAlt);
     ControlsSettings.bind(ControlsSettings.MODIFY, KeyCode.LeftShift);
     ControlsSettings.bind(ControlsSettings.SNAP, KeyCode.LeftControl);
     ControlsSettings.bind(ControlsSettings.FOCUS, KeyCode.F);
     ControlsSettings.bind(ControlsSettings.ASCEND, KeyCode.Q);
     ControlsSettings.bind(ControlsSettings.DESCEND, KeyCode.E);
     ControlsSettings.bind(ControlsSettings.TOOL_0, KeyCode.Q);
     ControlsSettings.bind(ControlsSettings.TOOL_1, KeyCode.W);
     ControlsSettings.bind(ControlsSettings.TOOL_2, KeyCode.E);
     ControlsSettings.bind(ControlsSettings.TOOL_3, KeyCode.R);
     ControlsSettings.bind(ControlsSettings.TERMINAL, KeyCode.BackQuote);
     ControlsSettings.bind(ControlsSettings.SCREENSHOT, KeyCode.Insert);
     ControlsSettings.bind(ControlsSettings.REFRESH_ASSETS, KeyCode.PageUp);
     ControlsSettings.bind(ControlsSettings.CLIPBOARD_DEBUG, KeyCode.PageDown);
     ControlsSettings.bind(ControlsSettings.HUD, KeyCode.Home);
     ControlsSettings.bind(ControlsSettings.OTHER, KeyCode.LeftControl);
     ControlsSettings.bind(ControlsSettings.GLOBAL, KeyCode.J);
     ControlsSettings.bind(ControlsSettings.LOCAL, KeyCode.K);
     ControlsSettings.bind(ControlsSettings.GROUP, KeyCode.L);
     ControlsSettings.bind(ControlsSettings.GESTURE, KeyCode.C);
     ControlsSettings.bind(ControlsSettings.VISION, KeyCode.N);
     ControlsSettings.bind(ControlsSettings.TACTICAL, KeyCode.B);
     ControlsSettings.bind(ControlsSettings.PERSPECTIVE, KeyCode.H);
     ControlsSettings.bind(ControlsSettings.DEQUIP, KeyCode.CapsLock);
     ControlsSettings.bind(ControlsSettings.ROLL_LEFT, KeyCode.LeftArrow);
     ControlsSettings.bind(ControlsSettings.ROLL_RIGHT, KeyCode.RightArrow);
     ControlsSettings.bind(ControlsSettings.PITCH_UP, KeyCode.UpArrow);
     ControlsSettings.bind(ControlsSettings.PITCH_DOWN, KeyCode.DownArrow);
     ControlsSettings.bind(ControlsSettings.YAW_LEFT, KeyCode.A);
     ControlsSettings.bind(ControlsSettings.YAW_RIGHT, KeyCode.D);
     ControlsSettings.bind(ControlsSettings.THRUST_INCREASE, KeyCode.W);
     ControlsSettings.bind(ControlsSettings.THRUST_DECREASE, KeyCode.S);
     ControlsSettings.bind(ControlsSettings.LOCKER, KeyCode.O);
     ControlsSettings.bind(ControlsSettings.INSPECT, KeyCode.F);
     ControlsSettings.bind(ControlsSettings.ROTATE, KeyCode.R);
     ControlsSettings.aiming       = EControlMode.HOLD;
     ControlsSettings.crouching    = EControlMode.TOGGLE;
     ControlsSettings.proning      = EControlMode.TOGGLE;
     ControlsSettings.sprinting    = EControlMode.HOLD;
     ControlsSettings.leaning      = EControlMode.HOLD;
     ControlsSettings.sensitivity  = 1f;
     ControlsSettings.invert       = false;
     ControlsSettings.invertFlight = false;
 }
Ejemplo n.º 8
0
 // Token: 0x060035F3 RID: 13811 RVA: 0x0016BE61 File Offset: 0x0016A261
 private static void onClickedDefaultButton(SleekButton button)
 {
     ControlsSettings.restoreDefaults();
     MenuConfigurationControlsUI.updateAll();
 }
Ejemplo n.º 9
0
 // Token: 0x060035E4 RID: 13796 RVA: 0x0016BA8C File Offset: 0x00169E8C
 public static void bind(KeyCode key)
 {
     ControlsSettings.bind(MenuConfigurationControlsUI.binding, key);
     MenuConfigurationControlsUI.updateButton(MenuConfigurationControlsUI.binding);
     MenuConfigurationControlsUI.cancel();
 }