一段古董代码留念

if SelectState == "_SCENE" then
(
    if SaveImgPath != undefined then
    (
        if checkTxt() then --三方路径已经正确
        (
            ini = (coolFolder + (txtName.text) +".txt")
            hasIni = doesFileExist ini --如果有类别的大INI
            if turing.isTrueNmae (txtName.text) then --保存名字非法字符检测
            (
                if not hasIni then 
                (
                    anyCoolReadyAddLib (jpgPath.text) (txtName.text) ("新建的模板名字为 :")	"Firest"
                )
                else
                (
                    oldPath = getinisetting ini "Tip" "MaxPath"
                    if oldPath == maxPath.text then
                    (
                        anyCoolReadyAddLib (jpgPath.text) (txtName.text) ("修改的模板名字为 :")	"Last"
                    ) else turing.mbox "检测到已存在的文件名,

但配置与当前Max文件路径不符,

请重新更改一个模板名字。"	
                )	
            )else turing.mbox "文件名存在非法字符,请重新输入。"	
        )else turing.mbox "路径检测未通过。"
    )else turing.mbox "请拖入预览图片。"	
)else turing.mbox "请将标签切换至[场景]"	

顺手改了下

if SaveImgPath != undefined do return (turing.mbox "请拖入预览图片。")
if checkTxt() == false do return (turing.mbox "路径检测未通过。")
if turing.isTrueNmae (txtName.text) == false do return (turing.mbox "文件名存在非法字符,请重新输入。")

local ini = coolFolder + txtName.text + ".txt"
local hasIni = doesFileExist ini --如果有类别的大INI
if not hasIni then 
(
    anyCoolReadyAddLib (jpgPath.text) (txtName.text) ("新建的模板名字为 :") "Firest"
)
else
(
    oldPath = getinisetting ini "Tip" "MaxPath"
    if oldPath != maxPath.text do return (turing.mbox "检测到已存在的文件名,

但配置与当前Max文件路径不符,

请重新更改一个模板名字。")
    anyCoolReadyAddLib (jpgPath.text) (txtName.text) ("修改的模板名字为 :") "Last"
)
原文地址:https://www.cnblogs.com/trykle/p/13705353.html