|
1 | 1 | function draw_window_properties() { |
2 | 2 | // draw_window_properties() |
| 3 | + |
| 4 | + if (window != prevwindow) { |
| 5 | + // Initialize loop end to current last tick of the song |
| 6 | + loopend = enda + 1 |
| 7 | + } |
| 8 | + |
3 | 9 | var x1, y1, a; |
4 | 10 | windowanim = 1 |
5 | 11 | if (theme = 3) draw_set_alpha(windowalpha) |
@@ -82,31 +88,53 @@ function draw_window_properties() { |
82 | 88 | draw_text_dynamic(x1 + 340, y1 + 305, loopstart) |
83 | 89 | } |
84 | 90 | if (a != loopstart) changed = 1 |
| 91 | + |
| 92 | + // Loop end tick |
| 93 | + if (!loop) draw_set_color(c_gray) |
| 94 | + if (language != 1) draw_text_dynamic(x1 + 252, y1 + 325, "Loop end tick:") |
| 95 | + else draw_text_dynamic(x1 + 252, y1 + 325, "Loop end tick:") |
| 96 | + a = loopend |
| 97 | + if (loop) { |
| 98 | + loopend = median(enda + 1, draw_dragvalue(20, x1 + 340, y1 + 325, loopend, 0.5), obj_controller.enda + 16 + 1) |
| 99 | + } else { |
| 100 | + draw_text_dynamic(x1 + 340, y1 + 325, loopend) |
| 101 | + } |
| 102 | + if (loopend != enda + 1) { |
| 103 | + draw_set_color(c_orange) |
| 104 | + draw_theme_font(font_small_bold) |
| 105 | + draw_text_dynamic(x1 + 25, y1 + 390, "[!]") |
| 106 | + draw_theme_font(font_small) |
| 107 | + draw_text_dynamic(x1 + 40 + (theme != 3) * 2, y1 + 390 + (theme == 3), "A silent note will be added to extend the length of the song.") |
| 108 | + draw_theme_font(font_main) |
| 109 | + draw_theme_color() |
| 110 | + } |
| 111 | + if (a != loopend) changed = 1 |
85 | 112 |
|
86 | | - if (language != 1) draw_text_dynamic(x1 + 252, y1 + 325, "Times to loop:") |
87 | | - else draw_text_dynamic(x1 + 252, y1 + 325, "循环次数:") |
| 113 | + if (language != 1) draw_text_dynamic(x1 + 252, y1 + 345, "Times to loop:") |
| 114 | + else draw_text_dynamic(x1 + 252, y1 + 345, "循环次数:") |
88 | 115 | a = loopmax |
89 | 116 | if (loop) { |
90 | | - loopmax = median(0, draw_dragvalue(13, x1 + 340, y1 + 325, loopmax, 0.5), 10) |
| 117 | + loopmax = median(0, draw_dragvalue(13, x1 + 340, y1 + 345, loopmax, 0.5), 10) |
91 | 118 | } else { |
92 | | - draw_text_dynamic(x1 + 340, y1 + 325, loopmax) |
| 119 | + draw_text_dynamic(x1 + 340, y1 + 345, loopmax) |
93 | 120 | } |
94 | | - if (language != 1) {if (loopmax = 0) draw_text_dynamic(x1 + 360, y1 + 325, "(infinite)")} |
95 | | - else {if (loopmax = 0) draw_text_dynamic(x1 + 360, y1 + 325, "(无限)")} |
| 121 | + if (language != 1) {if (loopmax = 0) draw_text_dynamic(x1 + 360, y1 + 345, "(infinite)")} |
| 122 | + else {if (loopmax = 0) draw_text_dynamic(x1 + 360, y1 + 345, "(无限)")} |
96 | 123 | if (a != loopmax) changed = 1 |
97 | 124 | timestoloop = loopmax |
98 | | - |
99 | | - if (loop) { |
100 | | - draw_set_color(c_orange) |
101 | | - draw_theme_font(font_small) |
102 | | - draw_text_dynamic(x1 + 37, y1 + 315, "Warning: the 'Loop to bar end' setting was\nremoved to make playback consistent!\nTo make sure your song loops at the right\npoint, add a silent note at the end.") |
103 | | - } |
104 | | - |
105 | | - draw_theme_font(font_main) |
| 125 | + |
106 | 126 | draw_theme_color() |
107 | 127 |
|
108 | | - if (draw_button2(x1 + 430 - 72, y1 + 386, 72, condstr(language != 1, "OK", "确定")) && (windowopen = 1 || theme != 3)) {windowclose = 1} |
109 | | - if (display_mouse_get_x() - window_get_x() >= 0 && display_mouse_get_y() - window_get_y() >= 0 && display_mouse_get_x() - window_get_x() < 0 + window_width && display_mouse_get_y() - window_get_y() < 0 + window_height) { |
| 128 | + if (draw_button2(x1 + 430 - 72, y1 + 386, 72, condstr(language != 1, "OK", "确定")) && (windowopen = 1 || theme != 3)) { |
| 129 | + |
| 130 | + if (loopend != enda + 1) { |
| 131 | + show_debug_message("Loop end changed; adding extra note"); |
| 132 | + add_block(loopend - 1, 0, instrument_list[| 0], 45, 0, 100, 0) |
| 133 | + } |
| 134 | + |
| 135 | + windowclose = 1 |
| 136 | + } |
| 137 | + if (display_mouse_get_x() - window_get_x() >= 0 && display_mouse_get_y() - window_get_y() >= 0 && display_mouse_get_x() - window_get_x() < 0 + window_width && display_mouse_get_y() - window_get_y() < 0 + window_height) { |
110 | 138 | window_set_cursor(curs) |
111 | 139 | if (array_length(text_mouseover) = 0) window_set_cursor(cr_default) |
112 | 140 | } |
|
0 commit comments