|
1
|
global.savedata_async_id = -1;
|
|
2
|
global.savedata_async_load = false;
|
|
3
|
global.savedata_error = false;
|
|
4
|
global.savedata_debuginfo = "";
|
|
5
|
global.savedata_pause = false;
|
|
6
|
global.savedata_app_id = -1;
|
|
7
|
global.lang = "en";
|
|
8
|
_parent = -4;
|
|
9
|
old_savedata_check = false;
|
|
10
|
_load_state = UnknownEnum.Value_0;
|
|
11
|
_pending_title = "n/a";
|
|
12
|
_pending_titles = [];
|
|
13
|
_full_titles = scr_get_supported_full_titles();
|
|
14
|
_demo_titles = scr_get_supported_demo_titles();
|
|
15
|
|
|
16
|
init = function(arg0, arg1)
|
|
17
|
{
|
|
18
|
_parent = arg0;
|
|
19
|
scr_ossafe_initscr_ossafe_init
function scr_ossafe_init()
{
}
function scr_get_supported_demo_titles()
{
var titles = [];
if (scr_is_switch_os())
titles = [new scr_switch_title("n/a", new scr_save_data_file("DELTARUNESaveData", "deltarune_ch1.sav")), new scr_switch_title("n/a", new scr_save_data_file("DELTARUNESaveData", "deltarune_ch1.sav"))];
else if (os_type == os_ps4 || os_type == os_ps5)
titles = [new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNESaveData", "deltarune_ch1.sav")), new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNE", "deltarune_ch1.sav")), new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNESaveData", "deltarune_ch1.sav")), new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNE", "deltarune_ch1.sav")), new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNESaveData", "deltarune_ch1.sav")), new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNE", "deltarune_ch1.sav"))];
return titles;
}
function scr_get_supported_full_titles()
{
var titles = [];
if (os_get_config() == "SWITCH_OZ")
titles = [new scr_switch_title("n/a", new scr_save_data_file("DELTARUNE", "deltarune.sav"))];
else if (os_get_config() == "PS5" || os_get_config() == "PS5_TEST")
titles = [new scr_ps4_title("n/a", "n/a", new scr_save_data_file("DELTARUNE", "deltarune.sav"))];
return titles;
}
function scr_switch_title(arg0, arg1) constructor
{
app_id = arg0;
save_data_file = arg1;
}
function scr_ps4_title(arg0, arg1, arg2) constructor
{
title_id = arg0;
fingerprint = arg1;
save_data_file = arg2;
}
function scr_save_data_file(arg0, arg1) constructor
{
slottitle = arg0;
filename = arg1;
}
function scr_pending_save_data(arg0, arg1) constructor
{
title = arg0;
save_data = arg1;
}
function scr_is_demo_title(arg0)
{
if (scr_is_switch_os())
return arg0.app_id == "n/a" || arg0.app_id == "n/a";
else
return arg0.title_id == "n/a" || arg0.title_id == "n/a" || arg0.title_id == "n/a";
}
function scr_is_full_title(arg0)
{
if (scr_is_switch_os())
return arg0.app_id == "n/a";
else
return arg0.title_id == "n/a";
}
function scr_get_app_title(arg0)
{
var product_title = "N/A";
if (scr_is_demo_title(arg0))
{
if (scr_is_switch_os())
{
if (arg0.app_id == "n/a")
{
product_title = "DELTARUNE Chapter 1&2\n";
if (global.lang == "ja")
product_title = "『DELTARUNE Chapter 1&2』の\n";
}
else if (arg0.app_id == "n/a")
{
product_title = "DELTARUNE Chapter 1&2 Demo\n";
if (global.lang == "ja")
product_title = "『DELTARUNE Chapter 1&2 体験版』の\n";
}
}
else
{
product_title = "DELTARUNE Chapter 1&2 [Demo]\n";
if (global.lang == "ja")
product_title = "体験版『DELTARUNE Chapter 1&2』の\n";
}
}
else if (scr_is_full_title(arg0))
{
if (scr_is_switch_os())
{
product_title = "DELTARUNE [Nintendo Switch]\n";
if (global.lang == "ja")
product_title = "Nintendo Switch版『DELTARUNE』の\n";
}
else
... ();
|
|
20
|
application_surface_enable(true);
|
|
21
|
application_surface_draw_enable(false);
|
|
22
|
if (scr_is_switch_os() && !variable_global_exists("switchlogin"))
|
|
23
|
{
|
|
24
|
global.switchlogin = arg1.switch_id;
|
|
25
|
if (global.switchlogin >= 0)
|
|
26
|
{
|
|
27
|
switch_save_data_unmount();
|
|
28
|
switch_save_data_mount(global.switchlogin);
|
|
29
|
}
|
|
30
|
while (global.switchlogin < 0)
|
|
31
|
global.switchlogin = switch_accounts_select_account(true, false, false);
|
|
32
|
if (!switch_accounts_is_user_open(global.switchlogin))
|
|
33
|
switch_accounts_open_user(global.switchlogin);
|
|
34
|
}
|
|
35
|
if (scr_is_switch_os())
|
|
36
|
{
|
|
37
|
switch_controller_support_set_defaults();
|
|
38
|
switch_controller_support_set_singleplayer_only(true);
|
|
39
|
switch_controller_set_supported_styles(7);
|
|
40
|
global.savedata_app_id = "n/a";
|
|
41
|
switch_save_data_unmount();
|
|
42
|
switch_save_data_mount(global.switchlogin);
|
|
43
|
}
|
|
44
|
if (os_type == os_ps4)
|
|
45
|
{
|
|
46
|
ps4_touchpad_mouse_enable(false);
|
|
47
|
global.savedata_app_id = "n/a";
|
|
48
|
}
|
|
49
|
ossafe_savedata_load();
|
|
50
|
};
|
|
51
|
|
|
52
|
function load_default_settings()
|
|
53
|
{
|
|
54
|
var _locale = os_get_language();
|
|
55
|
var _lang;
|
|
56
|
if (scr_is_switch_os())
|
|
57
|
_lang = substr(switch_language_get_desired_language(), 1, 2);
|
|
58
|
else
|
|
59
|
_lang = (substr(_locale, 1, 2) != "ja") ? "en" : "ja";
|
|
60
|
global.lang = _lang;
|
|
61
|
if (!instance_exists(obj_input))
|
|
62
|
{
|
|
63
|
var _input = instance_create(0, 0, obj_input);
|
|
64
|
_input.init();
|
|
65
|
}
|
|
66
|
}
|
|
67
|
|
|
68
|
function create_new_save_file()
|
|
69
|
{
|
|
70
|
global.savedata = ds_map_create();
|
|
71
|
ossafe_ini_open("dr.ini");
|
|
72
|
ossafe_ini_close();
|
|
73
|
ossafe_ini_open("true_config.ini");
|
|
74
|
ini_write_string("__DT", "__DT", string(date_current_datetime()));
|
|
75
|
ossafe_ini_close();
|
|
76
|
ossafe_savedata_save();
|
|
77
|
}
|
|
78
|
|
|
79
|
function convert_loaded_file()
|
|
80
|
{
|
|
81
|
if (ossafe_file_exists("true_config.ini"))
|
|
82
|
{
|
|
83
|
ossafe_ini_open("true_config.ini");
|
|
84
|
global.lang = ini_read_string("LANG", "LANG", global.lang);
|
|
85
|
ossafe_ini_close();
|
|
86
|
}
|
|
87
|
if (!scr_has_ura_data())
|
|
88
|
{
|
|
89
|
for (var i = 0; i < UnknownEnum.Value_4; i++)
|
|
90
|
{
|
|
91
|
var chapter = i + 1;
|
|
92
|
scr_convert_ura_data(chapter);
|
|
93
|
}
|
|
94
|
}
|
|
95
|
ossafe_ini_open("true_config.ini");
|
|
96
|
ini_write_string("__DT", "__DT", string(date_current_datetime()));
|
|
97
|
ossafe_ini_close();
|
|
98
|
ossafe_savedata_save();
|
|
99
|
}
|
|
100
|
|
|
101
|
function dequeue_full_title()
|
|
102
|
{
|
|
103
|
var title = "n/a";
|
|
104
|
if (array_length(_full_titles) == 0)
|
|
105
|
return title;
|
|
106
|
title = _full_titles[0];
|
|
107
|
var adjusted_list = [];
|
|
108
|
for (var i = 0; i < array_length(_full_titles); i++)
|
|
109
|
{
|
|
110
|
if (_full_titles[i] == title)
|
|
111
|
continue;
|
|
112
|
adjusted_list[array_length(adjusted_list)] = _full_titles[i];
|
|
113
|
}
|
|
114
|
_full_titles = adjusted_list;
|
|
115
|
return title;
|
|
116
|
}
|
|
117
|
|
|
118
|
function dequeue_demo_title()
|
|
119
|
{
|
|
120
|
var title = "n/a";
|
|
121
|
if (array_length(_demo_titles) == 0)
|
|
122
|
return title;
|
|
123
|
title = _demo_titles[0];
|
|
124
|
var adjusted_list = [];
|
|
125
|
for (var i = 0; i < array_length(_demo_titles); i++)
|
|
126
|
{
|
|
127
|
if (_demo_titles[i] == title)
|
|
128
|
continue;
|
|
129
|
adjusted_list[array_length(adjusted_list)] = _demo_titles[i];
|
|
130
|
}
|
|
131
|
_demo_titles = adjusted_list;
|
|
132
|
return title;
|
|
133
|
}
|
|
134
|
|
|
135
|
enum UnknownEnum
|
|
136
|
{
|
|
137
|
Value_0,
|
|
138
|
Value_4 = 4
|
|
139
|
}
|