mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 20:15:35 -04:00
Add a untested hacky workaround, to force OSX to use 32 bit architecture with mono >= 5.2
This commit is contained in:
parent
e342b402ec
commit
f48532207e
@ -30,7 +30,6 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
static string chatInInputBuffer = null;
|
||||
|
||||
public override void Init() {
|
||||
float textScale = game.Drawer2D.UseBitmappedChat ? 1.25f : 1;
|
||||
int fontSize = (int)(8 * game.GuiChatScale);
|
||||
Utils.Clamp(ref fontSize, 8, 60);
|
||||
chatFont = new Font(game.FontName, fontSize);
|
||||
|
@ -29,7 +29,6 @@ namespace ClassicalSharp.Gui.Screens {
|
||||
|
||||
protected override void ContextRecreated() {
|
||||
ClickHandler onClick = OnWidgetClick;
|
||||
bool classic = game.UseClassicOptions;
|
||||
widgets = new Widget[] {
|
||||
MakeOpt(-1, -150, "Classic hand model", onClick, GetHand, SetHand),
|
||||
MakeOpt(-1, -100, "Classic walk anim", onClick, GetAnim, SetAnim),
|
||||
|
@ -200,7 +200,6 @@ namespace ClassicalSharp.Gui.Widgets {
|
||||
|
||||
protected char GetLastColour(int indexX, int indexY) {
|
||||
int x = indexX;
|
||||
IDrawer2D drawer = game.Drawer2D;
|
||||
for (int y = indexY; y >= 0; y--) {
|
||||
string part = lines[y];
|
||||
char code = IDrawer2D.LastCol(part, x);
|
||||
|
@ -71,10 +71,6 @@ namespace ClassicalSharp {
|
||||
string url = identifier.Substring(3);
|
||||
|
||||
float contentLengthMB = (contentLength / 1024f / 1024f);
|
||||
string address = url;
|
||||
if (url.StartsWith("https://")) address = url.Substring(8);
|
||||
if (url.StartsWith("http://")) address = url.Substring(7);
|
||||
|
||||
warning.lines[3] = "Download size: " + contentLengthMB.ToString("F3") + " MB";
|
||||
warning.RedrawText();
|
||||
}
|
||||
|
@ -201,7 +201,6 @@ namespace ClassicalSharp.Network.Protocols {
|
||||
byte blockId = reader.ReadUInt8();
|
||||
bool canPlace = reader.ReadUInt8() != 0;
|
||||
bool canDelete = reader.ReadUInt8() != 0;
|
||||
Inventory inv = game.Inventory;
|
||||
|
||||
if (blockId == 0) {
|
||||
int count = game.UseCPEBlocks ? Block.CpeCount : Block.OriginalCount;
|
||||
|
@ -38,8 +38,7 @@ namespace ClassicalSharp.Renderers {
|
||||
index = 0;
|
||||
Vector3 camPos = game.CurrentCameraPos;
|
||||
float dist = (camPos - selected.Min).LengthSquared;
|
||||
IGraphicsApi gfx = game.Graphics;
|
||||
|
||||
|
||||
float offset = 0.01f;
|
||||
if (dist < 4 * 4) offset = 0.00625f;
|
||||
if (dist < 2 * 2) offset = 0.00500f;
|
||||
|
@ -61,7 +61,7 @@ namespace Launcher.Gui.Widgets {
|
||||
x += DrawColumn(drawer, "Name", 0, x, filterName) + 5;
|
||||
x += DrawColumn(drawer, "Players", 1, x, filterPlayers) + 5;
|
||||
x += DrawColumn(drawer, "Uptime", 2, x, filterUptime) + 5;
|
||||
x += DrawColumn(drawer, "Software", 3, x, FilterSoftware) + 5;
|
||||
x += DrawColumn(drawer, "Software", 3, x, filterSoftware) + 5;
|
||||
DrawScrollbar(drawer);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,6 @@ namespace Launcher.Gui.Views {
|
||||
|
||||
protected override void MakeWidgets() {
|
||||
widgetIndex = 0;
|
||||
int middle = game.Width / 2;
|
||||
|
||||
updatesIndex = widgetIndex;
|
||||
Makers.Button(this, "Updates", 110, 35, titleFont)
|
||||
|
@ -3,6 +3,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using ClassicalSharp;
|
||||
using OpenTK;
|
||||
|
||||
@ -56,14 +57,38 @@ namespace Launcher {
|
||||
throw; // File not found HRESULT, HRESULT thrown when running on wine
|
||||
Process.Start(path, args);
|
||||
}
|
||||
} else if (Configuration.RunningOnMacOS && NeedOSXHack()) {
|
||||
Process.Start("mono", "--arch=32 \"" + path + "\" " + args);
|
||||
} else {
|
||||
Process.Start("mono", "\"" + path + "\" " + args);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Process.Start(path, args);
|
||||
}
|
||||
}
|
||||
|
||||
static bool NeedOSXHack() {
|
||||
Type type = Type.GetType("Mono.Runtime");
|
||||
if (type == null) return false;
|
||||
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if (displayName == null) return false;
|
||||
|
||||
object versionRaw = displayName.Invoke(null, null);
|
||||
if (versionRaw == null) return false;
|
||||
|
||||
string versionStr = versionRaw.ToString();
|
||||
if (versionStr.IndexOf(' ') >= 0) {
|
||||
versionStr = versionStr.Substring(0, versionStr.IndexOf(' '));
|
||||
}
|
||||
|
||||
try {
|
||||
Version version = new Version(versionStr);
|
||||
return version.Major >= 5 && version.Minor >= 2;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void CheckSettings(ClientStartData data, bool ccSkins, out bool shouldExit) {
|
||||
shouldExit = false;
|
||||
// Make sure if the client has changed some settings in the meantime, we keep the changes
|
||||
@ -76,11 +101,11 @@ namespace Launcher {
|
||||
Options.Set("launcher-ip", data.Ip);
|
||||
Options.Set("launcher-port", data.Port);
|
||||
Options.Set("launcher-mppass", Secure.Encode(data.Mppass, data.Username));
|
||||
Options.Set("launcher-ccskins", ccSkins);
|
||||
Options.Set("launcher-ccskins", ccSkins);
|
||||
Options.Save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ClientStartData {
|
||||
public string Username, Mppass, Ip, Port;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user