mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
Fix launcher script not having proper working directory set on unix.
This commit is contained in:
parent
647189616b
commit
61af80b487
@ -39,12 +39,6 @@ namespace ClassicalSharp {
|
||||
brush.SetStyle( Paint.Style.FillAndStroke );
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public override void DrawRoundedRect( FastColour colour, float radius, float x, float y, float width, float height ) {
|
||||
RectF rec = new RectF( x, y, x + width, y + height );
|
||||
c.DrawRoundRect( rec, radius, radius, GetOrCreateBrush( colour ) );
|
||||
}
|
||||
|
||||
public override void Clear( FastColour colour ) {
|
||||
c.DrawColor( colour );
|
||||
}
|
||||
|
@ -38,27 +38,6 @@ namespace ClassicalSharp {
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete("Method is not guaranteed to work on all platforms.")]
|
||||
public override void DrawRoundedRect( FastColour colour, float radius, float x, float y, float width, float height ) {
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
float x1 = x, y1 = y, x2 = x + width, y2 = y + height;
|
||||
|
||||
float r = radius, dia = radius * 2;
|
||||
path.AddArc( x1, y1, dia, dia, 180, 90 );
|
||||
path.AddLine( x1 + r, y1, x2 - r, y1 );
|
||||
path.AddArc( x2 - dia, y1, dia, dia, 270, 90 );
|
||||
path.AddLine( x2, y1 + r, x2, y2 - r );
|
||||
path.AddArc( x2 - dia, y2 - dia, dia, dia, 0, 90 );
|
||||
path.AddLine( x1 + r, y2, x2 - r, y2 );
|
||||
path.AddArc( x1, y2 - dia, dia, dia, 90, 90 );
|
||||
path.AddLine( x1, y1 + r, x1, y2 - r );
|
||||
path.CloseAllFigures();
|
||||
|
||||
using( Brush brush = new SolidBrush( colour ) )
|
||||
g.FillPath( brush, path );
|
||||
path.Dispose();
|
||||
}
|
||||
|
||||
public override void Clear( FastColour colour ) {
|
||||
g.Clear( colour );
|
||||
}
|
||||
|
@ -32,11 +32,6 @@ namespace ClassicalSharp {
|
||||
/// at the specified coordinates in the currently bound bitmap. </summary>
|
||||
public abstract void DrawRectBounds( FastColour colour, float lineWidth, int x, int y, int width, int height );
|
||||
|
||||
/// <summary> Draws a 2D rectangle with rounded borders of the specified dimensions
|
||||
/// at the specified coordinates in the currently bound bitmap. </summary>
|
||||
[Obsolete("Method is not guaranteed to work on all platforms.")]
|
||||
public abstract void DrawRoundedRect( FastColour colour, float radius, float x, float y, float width, float height );
|
||||
|
||||
/// <summary> Clears the entire bound bitmap to the specified colour. </summary>
|
||||
public abstract void Clear( FastColour colour );
|
||||
|
||||
|
@ -177,8 +177,10 @@ namespace Launcher {
|
||||
LauncherSkin.SaveToOptions();
|
||||
Options.Save();
|
||||
}
|
||||
|
||||
if( ShouldUpdate )
|
||||
Updater.Patcher.LaunchUpdateScript();
|
||||
if( Window.Exists )
|
||||
Window.Close();
|
||||
}
|
||||
|
||||
|
@ -34,10 +34,16 @@ namespace Launcher.Updater {
|
||||
int code = chmod( path, (flags << 6) | (flags << 3) | 4 );
|
||||
if( code != 0 )
|
||||
throw new InvalidOperationException( "chmod returned : " + code );
|
||||
|
||||
//if( OpenTK.Configuration.RunningOnMacOS )
|
||||
// info = new ProcessStartInfo( "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal",
|
||||
// '"' + path + '"');
|
||||
//else
|
||||
info = new ProcessStartInfo( "xterm", '"' + path + '"');
|
||||
}
|
||||
info.CreateNoWindow = false;
|
||||
info.UseShellExecute = false;
|
||||
info.WorkingDirectory = Program.AppDirectory;
|
||||
Process.Start( info );
|
||||
}
|
||||
|
||||
@ -47,7 +53,8 @@ namespace Launcher.Updater {
|
||||
static void MakeUpdatesFolder( byte[] zipData ) {
|
||||
using( MemoryStream stream = new MemoryStream( zipData ) ) {
|
||||
ZipReader reader = new ZipReader();
|
||||
Directory.CreateDirectory( "CS_Update" );
|
||||
string path = Path.Combine( Program.AppDirectory, "CS_Update" );
|
||||
Directory.CreateDirectory( path );
|
||||
|
||||
reader.ShouldProcessZipEntry = (f) => true;
|
||||
reader.ProcessZipEntry = ProcessZipEntry;
|
||||
|
Loading…
x
Reference in New Issue
Block a user