예제 #1
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);
                 }
             }
         }
     }
 }
예제 #2
0
 // Token: 0x060035F3 RID: 13811 RVA: 0x0016BE61 File Offset: 0x0016A261
 private static void onClickedDefaultButton(SleekButton button)
 {
     ControlsSettings.restoreDefaults();
     MenuConfigurationControlsUI.updateAll();
 }