mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
Use defs to compile for macOS directories
This commit is contained in:
parent
deee285e71
commit
a2c399557e
3 changed files with 18 additions and 4 deletions
6
compile-macos.hxml
Normal file
6
compile-macos.hxml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
-cp src
|
||||||
|
-lib heaps
|
||||||
|
-lib hlsdl
|
||||||
|
-hl native/marblegame.c
|
||||||
|
-D MACOS_BUNDLE
|
||||||
|
--main Main
|
||||||
|
|
@ -22,7 +22,11 @@ import src.Settings;
|
||||||
|
|
||||||
class ResourceLoader {
|
class ResourceLoader {
|
||||||
#if (hl && !android)
|
#if (hl && !android)
|
||||||
|
#if MACOS_BUNDLE
|
||||||
public static var fileSystem:FileSystem = new TorqueFileSystem(Path.normalize(Path.join([Path.directory(Sys.programPath()), "..", "Resources"])), null);
|
public static var fileSystem:FileSystem = new TorqueFileSystem(Path.normalize(Path.join([Path.directory(Sys.programPath()), "..", "Resources"])), null);
|
||||||
|
#else
|
||||||
|
public static var fileSystem:FileSystem = new TorqueFileSystem(".", null);
|
||||||
|
#end
|
||||||
#end
|
#end
|
||||||
#if (js || android)
|
#if (js || android)
|
||||||
public static var fileSystem:FileSystem = null;
|
public static var fileSystem:FileSystem = null;
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,13 @@ class Settings {
|
||||||
|
|
||||||
public static var isTouch:Option<Bool> = Option.None;
|
public static var isTouch:Option<Bool> = Option.None;
|
||||||
|
|
||||||
public static var settingsDir = Path.join([Sys.getEnv("HOME"),
|
#if hl
|
||||||
"Library", "Application Support", "MBHaxe-MBP"]);
|
#if MACOS_BUNDLE
|
||||||
|
public static var settingsDir = Path.join([Sys.getEnv("HOME"), "Library", "Application Support", "MBHaxe-MBP"]);
|
||||||
|
#else
|
||||||
|
public static var settingsDir = ".";
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
|
||||||
public static function applySettings() {
|
public static function applySettings() {
|
||||||
#if hl
|
#if hl
|
||||||
|
|
@ -277,8 +282,7 @@ class Settings {
|
||||||
|
|
||||||
if (settingsExists) {
|
if (settingsExists) {
|
||||||
#if hl
|
#if hl
|
||||||
var json =
|
var json = Json.parse(File.getContent(Path.join([settingsDir, "settings.json"])));
|
||||||
Json.parse(File.getContent(Path.join([settingsDir, "settings.json"])));
|
|
||||||
#end
|
#end
|
||||||
#if js
|
#if js
|
||||||
var json = Json.parse(localStorage.getItem("MBHaxeSettings"));
|
var json = Json.parse(localStorage.getItem("MBHaxeSettings"));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue