MrBounty / PZ-UI_API

UI API for the game project zomboid
17 stars 4 forks source link

UI:setKey(key) returns error #7

Open toomanynights opened 7 months ago

toomanynights commented 7 months ago

Hello,

First of all, a big THANK YOU for this library. It took me out of a state of existential helplessness as I attempted to grasp how to build a UI in Zomboid. With your mod, it literally came down to a few lines of code.

I've noticed a small error in this doc: it mentions UI:setKey(key) method which, when used, returns:

[26-02-24 16:41:56.395] LOG : General , 1708958516395> Object tried to call nil in createToDoInterface. [26-02-24 16:41:56.395] ERROR: General , 1708958516395> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in createToDoInterface at KahluaUtil.fail line:82.. [26-02-24 16:41:56.396] ERROR: General , 1708958516396> DebugLogStream.printException> Stack trace:.

I believe that UI:setKeyMN() should be used instead. At least it gave no error when I tried it.

Thanks again.