Commit c3f578aced5db3eff9dc41c30405b76ac5370f81
1 parent
f22a33af
gm增加跳过引导的命令 guide skip
Showing
1 changed file
with
27 additions
and
12 deletions
Show diff stats
src/actions/GmAction.lua
| ... | ... | @@ -446,18 +446,33 @@ function _M.email(role, pms) |
| 446 | 446 | return "成功" |
| 447 | 447 | end |
| 448 | 448 | |
| 449 | -table.insert(helpDes, {"清除引导", "cguide", "0全/1强/2弱"}) | |
| 450 | -function _M.cguide(role, pms) | |
| 451 | - local id = tonum(pms.pm1, 0) | |
| 452 | - if id == 0 then | |
| 453 | - role:updateProperties({ | |
| 454 | - newerGuide = "1=1", | |
| 455 | - funcGuide = "", | |
| 456 | - }, notNotify) | |
| 457 | - elseif id == 1 then | |
| 458 | - role:updateProperty({field = "newerGuide", value = "1=1"}) | |
| 459 | - elseif id == 2 then | |
| 460 | - role:updateProperty({field = "funcGuide", value = ""}) | |
| 449 | +table.insert(helpDes, {"引导", "guide", "skip/reset"}) | |
| 450 | +function _M.guide(role, pms) | |
| 451 | + local cmd = pms.pm1 or "un" | |
| 452 | + if cmd == "SKIP" then | |
| 453 | + role:updateProperty({field = "newerGuide", value = "9999=1"}) | |
| 454 | + local str = "" | |
| 455 | + for _, set in pairs(csvdb["guide_mainCsv"]) do | |
| 456 | + str = str:setv(set[1].major * 1000,1) | |
| 457 | + for _,data in ipairs(set) do | |
| 458 | + if data["break"] ~= 0 then | |
| 459 | + str = str:setv(data.major * 1000 + data.minor,1) | |
| 460 | + end | |
| 461 | + end | |
| 462 | + end | |
| 463 | + role:updateProperty({field = "funcGuide", value = str}) | |
| 464 | + elseif cmd == "RESET" then | |
| 465 | + local id = tonum(pms.pm2, 0) | |
| 466 | + if id == 0 then | |
| 467 | + role:updateProperties({ | |
| 468 | + newerGuide = "1=1", | |
| 469 | + funcGuide = "", | |
| 470 | + }, notNotify) | |
| 471 | + elseif id == 1 then | |
| 472 | + role:updateProperty({field = "newerGuide", value = "1=1"}) | |
| 473 | + elseif id == 2 then | |
| 474 | + role:updateProperty({field = "funcGuide", value = ""}) | |
| 475 | + end | |
| 461 | 476 | end |
| 462 | 477 | |
| 463 | 478 | return "成功" | ... | ... |