From 9f19a54a6f66fea829286d6725438e5c8bff1c55 Mon Sep 17 00:00:00 2001 From: ZSaberLv0 Date: Mon, 8 Jul 2024 23:01:25 +0800 Subject: [PATCH] update --- ZFLoader/zfres/zf.lua | 11 ----------- ZFLoader/zfsrc/main.cpp | 21 +++++++++++++++++++-- 2 files changed, 19 insertions(+), 13 deletions(-) delete mode 100644 ZFLoader/zfres/zf.lua diff --git a/ZFLoader/zfres/zf.lua b/ZFLoader/zfres/zf.lua deleted file mode 100644 index 07bb154..0000000 --- a/ZFLoader/zfres/zf.lua +++ /dev/null @@ -1,11 +0,0 @@ -local text = ZFUITextView() -ZFUIWindowShow(text, ZFUISizeParamWrapWrap()) -text:textSingleLine(zffalse) - -local hint = 'put a "zf.lua" to one of these paths and run again:\n' -local count = zfl_luaValue(ZFResExtPathList():count()) -for i=0,count-1 do - hint = hint .. '\n' .. ZFResExtPathList():get(i) -end -text:text(hint) - diff --git a/ZFLoader/zfsrc/main.cpp b/ZFLoader/zfsrc/main.cpp index e80aa4b..b5dc66e 100644 --- a/ZFLoader/zfsrc/main.cpp +++ b/ZFLoader/zfsrc/main.cpp @@ -13,8 +13,25 @@ ZFMAIN_ENTRY() { ZFResExtPathAdd(extResList[i]); } - ZFLuaExecute(ZFInputForRes("zf.lua")); - ZFLuaGC(); + ZFInput src = ZFInputForRes("zf.lua"); + if(src) { + zfLogTrim("redirect to %s", src.callbackId()); + ZFLuaExecute(src); + ZFLuaGC(); + return; + } + + zfobj w; + w->windowShow(); + zfobj text; + w->childAdd(text)->c_sizeWrap(); + text->textSingleLine(zffalse); + zfstring hint = "put a \"zf.lua\" to one of these paths and run again:\n"; + for(zfindex i = 0; i < ZFResExtPathList().count(); ++i) { + hint += "\n"; + ZFPathInfoToStringT(hint, ZFResExtPathList()[i]); + } + text->text(hint); } ZFMAIN_PARAM_DISPATCH(LuaRunner) {