Go で書き直した Ikemen
リビジョン | 5c0ce139d24db9f45ec1d059aca416b7337174cb (tree) |
---|---|
日時 | 2019-09-23 18:21:57 |
作者 | neatunsou <sisiy4excite@gmai...> |
コミッター | neatunsou |
Windblade氏の更新に対応
@@ -626,24 +626,32 @@ function select.f_resetGrid() | ||
626 | 626 | select.t_drawFace = {} |
627 | 627 | for row = 1, motif.select_info.rows do |
628 | 628 | for col = 1, motif.select_info.columns do |
629 | + -- Note to anyone editing this function: | |
630 | + -- The "elseif" chain is important if a "end" is added in the middle it could break the character icon display. | |
631 | + | |
629 | 632 | --1Pのランダムセル表示位置 / 1P random cell display position |
630 | 633 | if t_grid[row + p1RowOffset][col].char == 'randomselect' or t_grid[row + p1RowOffset][col].hidden == 3 then |
631 | 634 | select.t_drawFace[#select.t_drawFace + 1] = {d = 1, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} |
632 | 635 | --1Pのキャラ表示位置 / 1P character display position |
633 | 636 | elseif t_grid[row + p1RowOffset][col].char ~= nil and t_grid[row + p1RowOffset][col].hidden == 0 then |
634 | 637 | select.t_drawFace[#select.t_drawFace + 1] = {d = 2, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} |
638 | + elseif motif.select_info.showemptyboxes == 1 then | |
639 | + select.t_drawFace[#select.t_drawFace + 1] = {d = 0, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} | |
635 | 640 | end |
641 | + | |
636 | 642 | --2Pのランダムセル表示位置 / 2P random cell display position |
637 | 643 | if t_grid[row + p2RowOffset][col].char == 'randomselect' or t_grid[row + p2RowOffset][col].hidden == 3 then |
638 | 644 | select.t_drawFace[#select.t_drawFace + 1] = {d = 11, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} |
639 | 645 | --2Pのキャラ表示位置 / 2P character display position |
640 | 646 | elseif t_grid[row + p2RowOffset][col].char ~= nil and t_grid[row + p2RowOffset][col].hidden == 0 then |
641 | 647 | select.t_drawFace[#select.t_drawFace + 1] = {d = 12, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} |
648 | + -- Empty boxes display position | |
642 | 649 | elseif motif.select_info.showemptyboxes == 1 then |
643 | - select.t_drawFace[#select.t_drawFace + 1] = {d = 0, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} | |
650 | + select.t_drawFace[#select.t_drawFace + 1] = {d = 10, p1 = t_grid[row + p1RowOffset][col].num, p2 = t_grid[row + p2RowOffset][col].num, x1 = p1FaceX + t_grid[row][col].x, x2 = p2FaceX + t_grid[row][col].x, y1 = p1FaceY + t_grid[row][col].y, y2 = p2FaceY + t_grid[row][col].y} | |
644 | 651 | end |
645 | 652 | end |
646 | 653 | end |
654 | + main.f_printTable(select.t_drawFace, "debug/t_drawFace.txt") | |
647 | 655 | end |
648 | 656 | |
649 | 657 | function select.f_selectReset() |
@@ -1161,14 +1169,23 @@ function select.f_selectScreen() | ||
1161 | 1169 | end |
1162 | 1170 | --draw cell art (slow for large rosters, this will be likely moved to 'drawFace' function in future) |
1163 | 1171 | for i = 1, #select.t_drawFace do |
1164 | - main.f_animPosDraw(motif.select_info.cell_bg_data, select.t_drawFace[i].x1, select.t_drawFace[i].y1) --draw cell background | |
1172 | + -- Let's check if is on the P1 side before drawing the background. | |
1173 | + if select.t_drawFace[i].d == 1 or select.t_drawFace[i].d == 2 or select.t_drawFace[i].d == 0 then | |
1174 | + main.f_animPosDraw(motif.select_info.cell_bg_data, select.t_drawFace[i].x1, select.t_drawFace[i].y1) --draw cell background | |
1175 | + end | |
1176 | + | |
1165 | 1177 | if select.t_drawFace[i].d == 1 then --draw random cell |
1166 | 1178 | main.f_animPosDraw(motif.select_info.cell_random_data, select.t_drawFace[i].x1, select.t_drawFace[i].y1) |
1167 | 1179 | elseif select.t_drawFace[i].d == 2 then --draw face cell |
1168 | 1180 | drawSmallPortrait(select.t_drawFace[i].p1, select.t_drawFace[i].x1, select.t_drawFace[i].y1, motif.select_info.portrait_scale[1], motif.select_info.portrait_scale[2]) |
1169 | 1181 | end |
1170 | - if main.p2Faces and motif.select_info.double_select == 1 then --P2 side grid enabled | |
1171 | - main.f_animPosDraw(motif.select_info.cell_bg_data, select.t_drawFace[i].x2, select.t_drawFace[i].y2) --draw cell background | |
1182 | + --P2 side grid enabled | |
1183 | + if main.p2Faces and motif.select_info.double_select == 1 then | |
1184 | + -- Let's check if is on the P2 side before drawing the background. | |
1185 | + if select.t_drawFace[i].d == 11 or select.t_drawFace[i].d == 12 or select.t_drawFace[i].d == 10 then | |
1186 | + main.f_animPosDraw(motif.select_info.cell_bg_data, select.t_drawFace[i].x2, select.t_drawFace[i].y2) --draw cell background | |
1187 | + end | |
1188 | + | |
1172 | 1189 | if select.t_drawFace[i].d == 11 then --draw random cell |
1173 | 1190 | main.f_animPosDraw(motif.select_info.cell_random_data, select.t_drawFace[i].x2, select.t_drawFace[i].y2) |
1174 | 1191 | elseif select.t_drawFace[i].d == 12 then --draw face cell |
@@ -2511,12 +2528,9 @@ local txt_credits = main.f_createTextImg( | ||
2511 | 2528 | ) |
2512 | 2529 | |
2513 | 2530 | function select.f_continue() |
2514 | - main.f_resetBG(motif.continue_screen, motif.continuebgdef, motif.music.continue_bgm, motif.music.continue_bgm_loop, motif.music.continue_bgm_volume, motif.music.continue_bgm_loopstart, motif.music.continue_bgm_loopend) | |
2515 | - animReset(motif.continue_screen.continue_anim_data) | |
2516 | - animUpdate(motif.continue_screen.continue_anim_data) | |
2517 | 2531 | continue = false |
2518 | - local text = main.f_extractText(motif.continue_screen.credits_text, main.credits) | |
2519 | - textImgSetText(txt_credits, text[1]) | |
2532 | + playBGM(motif.music.continue_bgm, true, motif.music.continue_bgm_loop, motif.music.continue_bgm_volume, motif.music.continue_bgm_loopstart or "0", motif.music.continue_bgm_loopend or "0") | |
2533 | + --textImgSetText(txt_credits, text[1]) | |
2520 | 2534 | main.f_cmdInput() |
2521 | 2535 | while true do |
2522 | 2536 | --draw clearcolor (disabled to not cover area) |