-
-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathmenu_macos_init.gml
More file actions
221 lines (219 loc) · 17.3 KB
/
menu_macos_init.gml
File metadata and controls
221 lines (219 loc) · 17.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
function menu_macos_init(){
var str, a, b, c;
if (os_type = os_macosx) {
macos_menu_clear()
var current_song = songs[song]
if (language != 1) {
macos_create_menu_ext("Help", "help", icon_menubar(icons.HELP) + "Tutorial videos|\\|Part 1: Composing note block music|Part 2: Opening MIDI files|Part 3: Importing songs into Minecraft|Part 4: Editing songs made in Minecraft |-|F1$View all|/|-|" + icon_menubar(icons.INTERNET) + "Website...|GitHub...|Discord server...|Report a bug...|Donate...|-|Changelist...|About...")
str = ""
customstr = ""
insmenu = 1
for (a = 0; a < ds_list_size(current_song.instrument_list); a++) {
var ins = current_song.instrument_list[| a];
if (ins.user)
customstr += check(current_song.instrument = ins) + clean(ins.name) + "|"
else{
if(a < 9){
str += check(current_song.instrument = ins) + get_hotkey_menubar("ins_ctrl") + string((a + 1) % 10) + "$" + clean(ins.name) + "|"
}else if (a < 19){
str += check(current_song.instrument = ins) + get_hotkey_menubar("ins_ctrl_shift") + string((a + 2) % 10) + "$" + clean(ins.name) + "|"
} else {
str += check(current_song.instrument = ins) + clean(ins.name) + "|"
}
}
if (a % 25 == 0 && a > 1 && a < ds_list_size(current_song.instrument_list) - 1) {
customstr += "-|More...|\\|"
insmenu++
}
}
if (!isplayer) macos_create_menu_ext("Settings", "settings", "Instrument|\\|" + str + condstr(customstr != "", "-|") + customstr + string_repeat("/|", insmenu) +
icon_menubar(icons.INSTRUMENTS)+"Instrument settings...|Import sounds from Minecraft...|/|-|" + icon_menubar(icons.INFORMATION) + "Song info...|" + icon_menubar(icons.PROPERTIES) + "Song properties...|Song stats...|-|" + icon_menubar(icons.MIDI_INPUT) + "MIDI device manager")
else macos_create_menu_ext("Settings", "settingsp", icon_menubar(icons.INFORMATION) + "Song info...|" + "Song stats...")
if (!isplayer) {
str = ""
customstr = ""
insmenu = 1
for (a = 0; a < ds_list_size(current_song.instrument_list); a += 1) {
var ins = current_song.instrument_list[| a];
if (ins.user)
customstr += "...to " + clean(ins.name) + "|"
else
str += "...to " + clean(ins.name) + "|"
if (a % 25 == 0 && a > 1 && a < ds_list_size(current_song.instrument_list) - 1) {
customstr += "-|More...|\\|"
insmenu++
}
}
// title is "Edit" + no_wide_space, otherwise fails
macos_create_menu_ext("Edit", "edit", inactive(current_song.historypos = current_song.historylen) + icon_menubar(icons.UNDO - (current_song.historypos = current_song.historylen)) + get_hotkey_menubar("undo") + "$Undo|"+
inactive(current_song.historypos = 0) + icon_menubar(icons.REDO - (current_song.historypos = 0)) + get_hotkey_menubar("redo") + "$Redo|-|"+
inactive(current_song.selected = 0) + icon_menubar(icons.COPY - (current_song.selected = 0)) + get_hotkey_menubar("copy") + "$Copy|"+
inactive(current_song.selected = 0) + icon_menubar(icons.CUT - (current_song.selected = 0)) + get_hotkey_menubar("cut") + "$Cut|"+
inactive(selection_copied = "") + icon_menubar(icons.PASTE - (selection_copied = "")) + get_hotkey_menubar("paste") + "$Paste|"+
inactive(current_song.selected = 0) + icon_menubar(icons.DELETE - (current_song.selected = 0)) + get_hotkey_menubar("delete") + "$Delete|-|"+
inactive(current_song.totalblocks = 0) + get_hotkey_menubar("select_all") + "$Select all|"+
inactive(current_song.selected = 0) + "Deselect all|"+
inactive(current_song.selected = 0 && current_song.totalblocks = 0) + get_hotkey_menubar("invert_selection") + "$Invert selection|-|"+
inactive(current_song.selection_l < 2) + "Flip selection horizontally|"+
inactive(current_song.selection_h < 2) + "Flip selection vertically|-|"+
inactive(current_song.instrument.num_blocks = 0) + "Select all " + clean(current_song.instrument.name) + "|"+
inactive(current_song.instrument.num_blocks = current_song.totalblocks) + "Select all but " + clean(current_song.instrument.name) + "|-|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_1") + "$" + get_mode_actions(1) + "|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_2") + "$" + get_mode_actions(2) + "|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_3") + "$" + get_mode_actions(3) + "|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_4") + "$" + get_mode_actions(4) + "|"+
condstr((editmode != m_key), inactive(current_song.selected = 0) + get_hotkey_menubar("action_5") + "$" + get_mode_actions(5) + "|") +
condstr((editmode != m_key), inactive(current_song.selected = 0) + get_hotkey_menubar("action_6") + "$" + get_mode_actions(6) + "|") +
inactive(current_song.selected = 0) + "Change instrument...|\\|" + str + condstr(customstr != "", "-|") + customstr + string_repeat("/|", insmenu) + "-|" +
inactive(current_song.selected = 0 || current_song.selection_l = 0) + "Expand selection|"+
inactive(current_song.selected = 0 || current_song.selection_l = 0) + "Compress selection|"+
inactive(current_song.selected = 0 || current_song.selection_l = 0) + "Macros...|\\||"+
get_hotkey_menubar("tremolo") + "$Tremolo...|"+
get_hotkey_menubar("stereo") + "$Stereo...|"+
get_hotkey_menubar("arpeggio") + "$Arpeggio...|"+
get_hotkey_menubar("portamento") + "$Portamento...|"+
get_hotkey_menubar("vibrato") + "$Vibrato|"+
get_hotkey_menubar("stagger") + "$Stagger...|"+
get_hotkey_menubar("chorus") + "$Chorus|"+
get_hotkey_menubar("volume_lfo") + "$Volume LFO|"+
get_hotkey_menubar("fade_in") + "$Fade in|"+
get_hotkey_menubar("fade_out") + "$Fade out|"+
get_hotkey_menubar("replace_key") + "$Replace key|"+
get_hotkey_menubar("set_velocity") + "$Set velocity...|"+
get_hotkey_menubar("set_panning") + "$Set panning...|"+
get_hotkey_menubar("set_pitch") + "$Set pitch...|"+
get_hotkey_menubar("reset_properties") + "$Reset all properties|"+
"/|-|"+
inactive(current_song.selected = 0) + "Transpose notes outside octave range")
}
str = ""
for (b = 0; b < 11; b += 1) {
if (recent_song[b] = "") break
c = floor(date_second_span(recent_song_time[b], date_current_datetime()))
str += string_truncate(clean(filename_name(recent_song[b])), 310) + "|"
}
if (!isplayer) macos_create_menu_ext("File", "file", icon_menubar(icons.NEW)+get_hotkey_menubar("new_song") + "$New song|"+
icon_menubar(icons.OPEN)+get_hotkey_menubar("open_song") + "$Open song...|Recent songs...|\\|" + str + condstr(recent_song[0] != "", "-|Clear recent songs") + condstr(recent_song[0] = "", "^!No recent songs") + "|/|-|"+
icon_menubar(icons.SAVE)+get_hotkey_menubar("save_song") + "$Save song|"+
icon_menubar(icons.SAVE_AS)+"Save song as a new file...|"+
"Save options...|Restore unsaved files...|-|"+
"Import...|\\|" +
inactive(current_song.selected != 0)+"Pattern...|"+
"MIDI...|"+
"Reference audio...|Background image...|/|"+
"Export...|\\|" +
inactive(current_song.totalblocks = 0 || ds_list_size(current_song.instrument_list) <= first_custom_index) + icon_menubar(icons.INSTRUMENTS) + "Song with custom sounds...|" +
inactive(current_song.selected = 0)+"Pattern...|" +
inactive(current_song.totalblocks = 0) + "Audio track...|"+
inactive(current_song.totalblocks = 0) + "Schematic...|"+
inactive(current_song.totalblocks = 0) + "Track schematic...|"+
inactive(current_song.totalblocks = 0) + "Data pack...")
else macos_create_menu_ext("File", "filep", icon_menubar(icons.OPEN)+get_hotkey_menubar("open_song") + "$Open song...|Recent songs...|\\|" + str + condstr(recent_song[0] != "", "-|Clear recent songs") + condstr(recent_song[0] = "", "^!No recent songs") + "|/|-|"+"Import from MIDI...|Import from schematic...|Import background image...|-|" + get_hotkey_menubar("exit") + "$Exit")
} else {
macos_create_menu_ext("帮助", "help", icon_menubar(icons.HELP) + "教程视频|\\|第 1 集:编写音符盒乐曲|第 2 集:打开 MIDI 文件|第 3 集:将乐曲导入进 Minecraft|第 4 集:编辑在 Minecraft 中创作的乐曲 |-|F1$观看所有|/|-|" + icon_menubar(icons.INTERNET) + "官方网站......|GitHub......|Discord 服务器......|反馈 bug......|QQ 群......|捐赠......|-|更新历史......|关于......")
str = ""
customstr = ""
insmenu = 1
for (a = 0; a < ds_list_size(current_song.instrument_list); a++) {
var ins = current_song.instrument_list[| a];
if (ins.user)
customstr += check(current_song.instrument = ins) + clean(ins.name) + "|"
else{
if(a < 9){
str += check(current_song.instrument = ins) + get_hotkey_menubar("ins_ctrl") + string((a + 1) % 10) + "$" + clean(ins.name) + "|"
}else if (a < 19){
str += check(current_song.instrument = ins) + get_hotkey_menubar("ins_ctrl_shift") + string((a + 1) % 10) + "$" + clean(ins.name) + "|"
} else {
str += check(current_song.instrument = ins) + clean(ins.name) + "|"
}
}
if (a % 25 == 0 && a > 1 && a < ds_list_size(current_song.instrument_list) - 1) {
customstr += "-|更多......|\\|"
insmenu++
}
}
if (!isplayer) macos_create_menu_ext("设置", "settings", "音色|\\|" + str + condstr(customstr != "", "-|") + customstr + string_repeat("/|", insmenu) +
icon_menubar(icons.INSTRUMENTS)+"音色设置......|从 Minecraft 游戏文件中获取音效......|/|-|" + icon_menubar(icons.INFORMATION) + "歌曲信息......|" + icon_menubar(icons.PROPERTIES) + "歌曲属性......|歌曲数据......|-|" + icon_menubar(icons.MIDI_INPUT) + "MIDI 设备管理器")
else macos_create_menu_ext("设置", "settingsp", icon_menubar(icons.INFORMATION) + "歌曲信息......|" + "歌曲数据......")
if (!isplayer) {
str = ""
customstr = ""
insmenu = 1
for (a = 0; a < ds_list_size(current_song.instrument_list); a += 1) {
var ins = current_song.instrument_list[| a];
if (ins.user)
customstr += "...为 " + clean(ins.name) + "|"
else
str += "...为 " + clean(ins.name) + "|"
if (a % 25 == 0 && a > 1 && a < ds_list_size(current_song.instrument_list) - 1) {
customstr += "-|更多......|\\|"
insmenu++
}
}
macos_create_menu_ext("编辑", "edit", inactive(current_song.historypos = current_song.historylen) + icon_menubar(icons.UNDO - (current_song.historypos = current_song.historylen)) + get_hotkey_menubar("undo") + "$撤销|"+
inactive(current_song.historypos = 0) + icon_menubar(icons.REDO - (current_song.historypos = 0)) + get_hotkey_menubar("redo") + "$重做|-|"+
inactive(current_song.selected = 0) + icon_menubar(icons.COPY - (current_song.selected = 0)) + get_hotkey_menubar("copy") + "$复制|"+
inactive(current_song.selected = 0) + icon_menubar(icons.CUT - (current_song.selected = 0)) + get_hotkey_menubar("cut") + "$剪切|"+
inactive(selection_copied = "") + icon_menubar(icons.PASTE - (selection_copied = "")) + get_hotkey_menubar("paste") + "$粘贴|"+
inactive(current_song.selected = 0) + icon_menubar(icons.DELETE - (current_song.selected = 0)) + get_hotkey_menubar("delete") + "$删除|-|"+
inactive(current_song.totalblocks = 0) + get_hotkey_menubar("select_all") + "$全选|"+
inactive(current_song.selected = 0) + "全不选|"+
inactive(current_song.selected = 0 && current_song.totalblocks = 0) + get_hotkey_menubar("invert_selection") + "$选择反转|-|"+
inactive(current_song.selection_l < 2) + "Flip selection horizontally (TRANSLATION_NEEDED)|"+
inactive(current_song.selection_h < 2) + "Flip selection vertically (TRANSLATION_NEEDED)|-|"+
inactive(current_song.instrument.num_blocks = 0) + "选择所有 " + clean(current_song.instrument.name) + "|"+
inactive(current_song.instrument.num_blocks = current_song.totalblocks) + "选择所有除了 " + clean(current_song.instrument.name) + "|-|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_1") + "$" + get_mode_actions(1) + "|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_2") + "$" + get_mode_actions(2) + "|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_3") + "$" + get_mode_actions(3) + "|"+
inactive(current_song.selected = 0) + get_hotkey_menubar("action_4") + "$" + get_mode_actions(4) + "|"+
condstr((editmode != m_key), inactive(current_song.selected = 0) + get_hotkey_menubar("action_5") + "$" + get_mode_actions(5) + "|") +
condstr((editmode != m_key), inactive(current_song.selected = 0) + get_hotkey_menubar("action_6") + "$" + get_mode_actions(6) + "|") +
inactive(current_song.selected = 0) + "更改音色......|\\|" + str + condstr(customstr != "", "-|") + customstr + string_repeat("/|", insmenu) + "-|" +
inactive(current_song.selected = 0 || current_song.selection_l = 0) + "扩展选区|"+
inactive(current_song.selected = 0 || current_song.selection_l = 0) + "压缩选区|"+
inactive(current_song.selected = 0 || current_song.selection_l = 0) + "快捷键......|\\||"+
get_hotkey_menubar("tremolo") + "$Tremolo...|"+
get_hotkey_menubar("stereo") + "$Stereo...|"+
get_hotkey_menubar("arpeggio") + "$Arpeggio...|"+
get_hotkey_menubar("portamento") + "$Portamento...|"+
get_hotkey_menubar("vibrato") + "$Vibrato|"+
get_hotkey_menubar("stagger") + "$Stagger...|"+
get_hotkey_menubar("chorus") + "$Chorus|"+
get_hotkey_menubar("volume_lfo") + "$Volume LFO|"+
get_hotkey_menubar("fade_in") + "$淡入|"+
get_hotkey_menubar("fade_out") + "$淡出|"+
get_hotkey_menubar("replace_key") + "$替换音|"+
get_hotkey_menubar("set_velocity") + "$设定音量......|"+
get_hotkey_menubar("set_panning") + "$设定声道......|"+
get_hotkey_menubar("set_pitch") + "$设定音高......|"+
get_hotkey_menubar("reset_properties") + "$重置所有属性|"+
"/|-|"+
inactive(current_song.selected = 0) + "转换所有超出八度范围的音符")
}
str = ""
for (b = 0; b < 11; b += 1) {
if (recent_song[b] = "") break
c = floor(date_second_span(recent_song_time[b], date_current_datetime()))
str += string_truncate(clean(filename_name(recent_song[b])), 310) + "|"
}
if (!isplayer) macos_create_menu_ext("文件", "file", icon_menubar(icons.NEW)+get_hotkey_menubar("new_song") + "$新文件|"+
icon_menubar(icons.OPEN)+get_hotkey_menubar("open_song") + "$打开歌曲......|最近歌曲......|\\|" + str + condstr(recent_song[0] != "", "-|清除最近歌曲") + condstr(recent_song[0] = "", "^!无最近歌曲") + "|/|-|"+
icon_menubar(icons.SAVE)+get_hotkey_menubar("save_song") + "$保存歌曲|"+
icon_menubar(icons.SAVE_AS)+"另存为|"+
"保存选项......|恢复未保存的歌曲......|-|" +
"导入......|\\|"+
inactive(current_song.selected != 0)+"片段......|"+
"MIDI 文件......|"+
"参考音频......|背景图片......|/|"+
"导出......|\\|"+
inactive(current_song.totalblocks = 0 || ds_list_size(current_song.instrument_list) <= first_custom_index) + icon_menubar(icons.INSTRUMENTS) + "带自定义音色的歌曲......|"+
inactive(current_song.selected = 0)+"片段......|"+
inactive(current_song.totalblocks = 0) + "音频文件......|"+
inactive(current_song.totalblocks = 0) + "结构......|"+
inactive(current_song.totalblocks = 0) + "直轨结构......|"+
inactive(current_song.totalblocks = 0) + "数据包......")
else macos_create_menu_ext("文件", "filep", icon_menubar(icons.OPEN)+get_hotkey_menubar("open_song") + "$打开歌曲......|最近歌曲......|\\|" + str + condstr(recent_song[0] != "", "-|清除最近歌曲") + condstr(recent_song[0] = "", "^!无最近歌曲") + "|/|-|"+"从 MIDI 文件导入......|从 Schematic 文件导入......|导入背景图片......|-|" + get_hotkey_menubar("exit") + "$退出")
}
}
}