镜像:LingYi-Liang/PhantomGladiator(2026-11-30,快照)

This commit is contained in:
gitea committed 2026-11-30 00:23:51 +08:00
commit bc907eca24
511 files changed
+147109

No files matched your search

@@ -0,0 +1,30 @@
-- Opt-in legacy visual behavior for the NPC execution pose driver.
local Files=require('companion_profile')
local Appearance={}
local HEADER='ExecutionAppearanceV1\t'
function Appearance.new(options)
local path=options.path..'/execution-appearance.tsv'
local read,write=options.read or Files.read,options.write or Files.write
local function saved(file)
local raw=read(file,40)
if raw==HEADER..'1\n' then return true end
if raw==HEADER..'0\n' then return false end
end
local on=saved(path)
if on==nil then on=saved(path..'.bak') end
local self={on=on==true}
function self:set(value)
if value~='ON' and value~='OFF' then return {ok=false,message='处决外观选项无效'} end
local wanted=value=='ON'
if self.on~=wanted and not write(path,HEADER..(wanted and '1' or '0')..'\n') then
return {ok=false,message='处决外观设置未保存'}
end
self.on=wanted
return {ok=true,message=wanted and '已开启旧版处决外观' or '已恢复默认处决外观'}
end
return self
end
return Appearance