Save pushback placing setting, fix launcher updater crashing for non-english languages.

This commit is contained in:
UnknownShadow200 2015-12-07 20:38:41 +11:00
parent bf5d9736af
commit ac42cf3bc8
6 changed files with 12 additions and 7 deletions

View File

@ -71,11 +71,13 @@ namespace ClassicalSharp {
(g, v) => Options.Set( OptionsKey.AutoCloseLauncher, v == "yes" ) ),
Make( 140, 0, "Pushback placing", Anchor.Centre, OnWidgetClick,
g => g.LocalPlayer.PushbackBlockPlacing
g => g.LocalPlayer.PushbackPlacing
&& g.LocalPlayer.CanPushbackBlocks ? "yes" : "no",
(g, v) => {
if( g.LocalPlayer.CanPushbackBlocks)
g.LocalPlayer.PushbackBlockPlacing = v == "yes";
if( g.LocalPlayer.CanPushbackBlocks) {
g.LocalPlayer.PushbackPlacing = v == "yes";
Options.Set( OptionsKey.PushbackPlacing, v == "yes" );
}
}),
Make( 140, 50, "Mouse sensitivity", Anchor.Centre, OnWidgetClick,

View File

@ -14,7 +14,7 @@ namespace ClassicalSharp {
public float SpeedMultiplier = 10;
public byte UserType;
public bool PushbackBlockPlacing;
public bool PushbackPlacing;
/// <summary> Whether the player is allowed to use the types of cameras that use third person. </summary>
public bool CanUseThirdPersonCamera = true;
@ -264,7 +264,7 @@ namespace ClassicalSharp {
if( !CanFly ) { flying = false; flyingDown = false; flyingUp = false; }
if( !CanNoclip ) noClip = false;
if( !CanSpeed) speeding = false;
if( !CanPushbackBlocks ) PushbackBlockPlacing = false;
if( !CanPushbackBlocks ) PushbackPlacing = false;
if( !CanUseThirdPersonCamera )
game.SetCamera( false );

View File

@ -127,6 +127,7 @@ namespace ClassicalSharp {
UseSound = Options.GetBool( OptionsKey.UseSound, false );
AudioPlayer.SetSound( UseSound );
LiquidsBreakable = Options.GetBool( OptionsKey.LiquidsBreakable, false );
LocalPlayer.PushbackPlacing = Options.GetBool( OptionsKey.PushbackPlacing, false );
LoadIcon();
string connectString = "Connecting to " + IPAddress + ":" + Port + "..";

View File

@ -124,7 +124,7 @@ namespace ClassicalSharp {
if( game.LocalPlayer.noClip || !localBB.Intersects( blockBB ) ) return true;
if( game.LocalPlayer.PushbackBlockPlacing ) {
if( game.LocalPlayer.PushbackPlacing ) {
return PushbackPlace( selected, blockBB );
} else {
localBB.Min.Y += 0.25f + Entity.Adjustment;

View File

@ -30,6 +30,7 @@ namespace ClassicalSharp {
public const string ViewBobbing = "viewbobbing";
public const string FieldOfView = "fov";
public const string LiquidsBreakable = "liquidsbreakable";
public const string PushbackPlacing = "pushbackplacing";
}
// TODO: implement this

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
using System.Threading;
using JsonObject = System.Collections.Generic.Dictionary<string, object>;
@ -60,7 +61,7 @@ namespace Launcher2 {
Build MakeBuild( JsonObject obj, bool release ) {
Build build = new Build();
string timeKey = release ? "release_ts" : "ts";
double rawTime = Double.Parse( (string)obj[timeKey] );
double rawTime = Double.Parse( (string)obj[timeKey], CultureInfo.InvariantCulture );
build.TimeBuilt = epoch.AddSeconds( rawTime ).ToLocalTime();
build.DirectXSize = Int32.Parse( (string)obj["dx_size"] );