Skip to content

Commit 3fcb0de

Browse files
authored
Merge pull request #438 from time-killer-games/feature/tabs-cross-platform
Linux is case-sensitive for filesystem paths.
2 parents f978f30 + a851a5c commit 3fcb0de

File tree

11 files changed

+38
-45
lines changed

11 files changed

+38
-45
lines changed
16.5 KB
Binary file not shown.
-81 KB
Binary file not shown.

extensions/libfiledialogs/libfiledialogs.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
EnvironmentSetVariable("IMGUI_FONT_PATH", working_directory + string_lower("Fonts"));
55
_IfdLoadFonts();
66
} else {
7+
EnvironmentSetVariable("IMGUI_FONT_PATH", program_directory + "assets/" + string_lower("Fonts"));
78
pid = ProcessExecute("uname -m");
89
res = ExecutedProcessReadFromStandardOutput(pid);
910
FreeExecutedProcessStandardOutput(pid);
-92 KB
Binary file not shown.
-30.6 MB
Binary file not shown.
0 Bytes
Binary file not shown.

extensions/libfiledialogs/libfiledialogs_arm64.so

100644100755
4 KB
Binary file not shown.

objects/obj_controller/Create_0.gml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ if (os_type != os_windows) {
1313
// Use light theme to match default UI theme of OpenNBS:
1414
EnvironmentSetVariable("IMGUI_DIALOG_THEME", string(1));
1515
EnvironmentSetVariable("IMGUI_DIALOG_NOBORDER", string(1));
16-
17-
function evaluate_command(prog, arg) {
18-
prog = string_replace_all(prog, @'\', @'\\');
19-
prog = string_replace_all(prog, @'"', @'\"');
20-
if (os_type == os_windows &&
21-
(string_lower(filename_name(prog)) == "cmd" ||
22-
string_lower(filename_name(prog)) == "cmd.exe"))
23-
{ prog = "cmd.exe"; arg = "/c " + arg; }
24-
prog = @'"' + prog + @'"'; var pre = "";
25-
if (os_type == os_windows) pre = "cmd /c";
26-
var pid = ProcessExecute(pre + " " + prog + " " + arg);
27-
var out = ExecutedProcessReadFromStandardOutput(pid);
28-
FreeExecutedProcessStandardInput(pid);
29-
FreeExecutedProcessStandardOutput(pid);
30-
return out;
16+
17+
function evaluate_command(prog, arg) {
18+
prog = string_replace_all(prog, @'\', @'\\');
19+
prog = string_replace_all(prog, @'"', @'\"');
20+
if (os_type == os_windows &&
21+
(string_lower(filename_name(prog)) == "cmd" ||
22+
string_lower(filename_name(prog)) == "cmd.exe"))
23+
{ prog = "cmd.exe"; arg = "/c " + arg; }
24+
prog = @'"' + prog + @'"'; var pre = "";
25+
if (os_type == os_windows) pre = "cmd /c";
26+
var pid = ProcessExecute(pre + " " + prog + " " + arg);
27+
var out = ExecutedProcessReadFromStandardOutput(pid);
28+
FreeExecutedProcessStandardInput(pid);
29+
FreeExecutedProcessStandardOutput(pid);
30+
return out;
3131
}
32-
32+
3333
// Start OpenNBS Maximized (macOS):
3434
if (os_type == os_macosx) {
3535
// Maxmize window on startup
@@ -41,16 +41,8 @@ if (os_type == os_linux) {
4141
var pid = 0;
4242
// Maxmize window on startup
4343
if (evaluate_command("uname", "-m") == "x86_64\n") external_call(external_define(current_directory + "libzoom.so", "window_zoom", dll_cdecl, ty_real, 1, ty_string), window_handle());
44-
else if (evaluate_command("uname", "-m") == "aarch64\n") external_call(external_define(current_directory + "libzoom_arm64.so", "window_zoom", dll_cdecl, ty_real, 1, ty_string), window_handle());
45-
else if (evaluate_command("uname", "-m") == "armv7l\n") external_call(external_define(current_directory + "libzoom_arm.so", "window_zoom", dll_cdecl, ty_real, 1, ty_string), window_handle());
46-
if (evaluate_command("uname", "-m") == "aarch64\n" || evaluate_command("uname", "-m") == "armv7l\n") {
47-
// The Raspberry Pi and similar ARM devices can't handle combining tons of font files like we're doing
48-
// on x86 platforms, use English-only; it's better than having no fonts displaying correctly at all...
49-
execute_program("cp", "-fR \"" + current_directory + "/fonts\" \"" + file_directory + "/\"", true);
50-
directory_create(file_directory + "/fonts/arm/");
51-
execute_program("mv", "-f \"" + file_directory + "/fonts/000-notosans-regular.ttf\" \"" + file_directory + "/fonts/arm/000-notosans-regular.ttf\"", true);
52-
EnvironmentSetVariable("IMGUI_FONT_PATH", file_directory + "/fonts/arm/");
53-
}
44+
else if (evaluate_command("uname", "-m") == "aarch64\n") external_call(external_define(current_directory + "libzoom_arm64.so", "window_zoom", dll_cdecl, ty_real, 1, ty_string), window_handle());
45+
else if (evaluate_command("uname", "-m") == "armv7l\n") external_call(external_define(current_directory + "libzoom_arm.so", "window_zoom", dll_cdecl, ty_real, 1, ty_string), window_handle());
5446
// Ignore this pls:
5547
_DialogInitialize();
5648
// Compensate for weird bug I don't know how to fix, with lowercase being forced calling file_copy(); it makes no sense:

scripts/control_create/control_create.gml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,31 +232,31 @@ function control_create() {
232232
str = ""
233233
soundinvoke = create(obj_instrument)
234234
soundinvoke.key = 45
235-
soundinvoke.filename = "UI/invoke.ogg"
235+
soundinvoke.filename = "ui/invoke.ogg"
236236
soundinvoke.user = 0
237237
soundshow = create(obj_instrument)
238238
soundshow.key = 45
239-
soundshow.filename = "UI/show.ogg"
239+
soundshow.filename = "ui/show.ogg"
240240
soundshow.user = 0
241241
soundhide = create(obj_instrument)
242242
soundhide.key = 45
243-
soundhide.filename = "UI/hide.ogg"
243+
soundhide.filename = "ui/hide.ogg"
244244
soundhide.user = 0
245245
soundgoback = create(obj_instrument)
246246
soundgoback.key = 45
247-
soundgoback.filename = "UI/goback.ogg"
247+
soundgoback.filename = "ui/goback.ogg"
248248
soundgoback.user = 0
249249
soundmetronome = create(obj_instrument)
250250
soundmetronome.key = 45
251-
soundmetronome.filename = "UI/metronome.ogg"
251+
soundmetronome.filename = "ui/metronome.ogg"
252252
soundmetronome.user = 0
253253
soundding = create(obj_instrument)
254254
soundding.key = 45
255-
soundding.filename = "UI/ding.ogg"
255+
soundding.filename = "ui/ding.ogg"
256256
soundding.user = 0
257257
soundmetronomeclick = create(obj_instrument)
258258
soundmetronomeclick.key = 45
259-
soundmetronomeclick.filename = "UI/metronome_click.ogg"
259+
soundmetronomeclick.filename = "ui/metronome_click.ogg"
260260
soundmetronomeclick.user = 0
261261

262262
first_custom_index = array_length(original_instruments)

scripts/instrument_load/instrument_load.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
function instrument_load() {
22
// instrument_load()
33

4-
var fn = sounds_directory + filename;
5-
if (os_type = os_windows) fn = string_replace_all(fn, "/", "\\");
4+
var fn = bundled_sounds_directory + filename;
5+
if (os_type = os_windows) fn = string_replace_all(fn, "/", "\\")
66

77
log("Load instrument", fn)
88

0 commit comments

Comments
 (0)