Go で書き直した Ikemen
Revision | 0eedec896d7f2966b8f6c3b816f8144a4b3c645c (tree) |
---|---|
Time | 2019-09-26 23:21:46 |
Author | neatunsou <sisiy4excite@gmai...> |
Commiter | neatunsou |
Windblade氏の更新に対応
@@ -82,6 +82,12 @@ function main.f_animPosDraw(a, x, y) | ||
82 | 82 | animDraw(a) |
83 | 83 | end |
84 | 84 | |
85 | +-- Check if files exists. | |
86 | +function main.file_exists(name) | |
87 | + local f=io.open(name,"r") | |
88 | + if f~=nil then io.close(f) return true else return false end | |
89 | +end | |
90 | + | |
85 | 91 | --textImgDraw at specified coordinates |
86 | 92 | function main.f_textImgPosDraw(ti, x, y, align) |
87 | 93 | align = align or 0 |
@@ -1227,7 +1233,7 @@ main.t_randomChars = {} | ||
1227 | 1233 | for i = 1, #main.t_selChars do |
1228 | 1234 | if main.t_selChars[i].stage ~= nil then |
1229 | 1235 | for j = 1, #main.t_selChars[i].stage do |
1230 | - if main.t_stageDef[main.t_selChars[i].stage[j]] == nil then | |
1236 | + if main.t_stageDef[main.t_selChars[i].stage[j]] == nil and main.file_exists(main.t_selChars[i].stage[j]) then | |
1231 | 1237 | row = #main.t_selStages + 1 |
1232 | 1238 | addStage(main.t_selChars[i].stage[j]) |
1233 | 1239 | tmp = getStageName(row):match('^["%s]*(.-)["%s]*$') --needed for s-size ikemen |
@@ -1409,8 +1409,10 @@ for line in file:lines() do | ||
1409 | 1409 | if param ~= nil then |
1410 | 1410 | param = param:gsub('[%. ]', '_') --change param . and space to _ |
1411 | 1411 | param = param:lower() --lowercase param |
1412 | - if value == '' and (type(def_pos[param]) == 'number' or type(def_pos[param]) == 'table') then --text should remain empty | |
1413 | - value = '0' | |
1412 | + if value ~= nil and def_pos ~= nil then -- Let's chech if it's even a valid param | |
1413 | + if value == '' and (type(def_pos[param]) == 'number' or type(def_pos[param]) == 'table') then --text should remain empty | |
1414 | + value = '0' | |
1415 | + end | |
1414 | 1416 | end |
1415 | 1417 | end |
1416 | 1418 | if param ~= nil and value ~= nil then --param = value pattern matched |
@@ -2464,7 +2464,8 @@ function select.f_selectVictory() | ||
2464 | 2464 | winnerNum, |
2465 | 2465 | motif.victory_screen.p1_offset[1], |
2466 | 2466 | motif.victory_screen.p1_offset[2], |
2467 | - motif.victory_screen.p1_facing * motif.victory_screen.p1_scale[1], | |
2467 | + motif.victory_screen.p1_facing, | |
2468 | + motif.victory_screen.p1_scale[1], | |
2468 | 2469 | motif.victory_screen.p1_scale[2] |
2469 | 2470 | ) |
2470 | 2471 | else |
@@ -2472,14 +2473,16 @@ function select.f_selectVictory() | ||
2472 | 2473 | p1Num, |
2473 | 2474 | motif.victory_screen.p1_offset[1], |
2474 | 2475 | motif.victory_screen.p1_offset[2], |
2475 | - motif.victory_screen.p1_facing * motif.victory_screen.p1_scale[1], | |
2476 | + motif.victory_screen.p1_facing, | |
2477 | + motif.victory_screen.p1_scale[1], | |
2476 | 2478 | motif.victory_screen.p1_scale[2] |
2477 | 2479 | ) |
2478 | 2480 | drawVictoryPortrait( |
2479 | 2481 | p2Num, |
2480 | 2482 | motif.victory_screen.p2_offset[1], |
2481 | 2483 | motif.victory_screen.p2_offset[2], |
2482 | - motif.victory_screen.p2_facing * motif.victory_screen.p2_scale[1], | |
2484 | + motif.victory_screen.p2_facing, | |
2485 | + motif.victory_screen.p2_scale[1], | |
2483 | 2486 | motif.victory_screen.p2_scale[2] |
2484 | 2487 | ) |
2485 | 2488 | end |