From f1f791efea165e6419a275690612951075110ef8 Mon Sep 17 00:00:00 2001 From: Apodemus Erectus Date: Fri, 8 Oct 2021 09:24:33 +0200 Subject: [PATCH 1/2] flush io buffer --- scripts/arluq.lua | 2 ++ scripts/lua/logging.lua | 4 ++++ scripts/lua/try.lua | 4 +++- scripts/services/StaffService.lua | 9 +++++++++ scripts/services/ZooService.lua | 2 +- 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 scripts/services/StaffService.lua diff --git a/scripts/arluq.lua b/scripts/arluq.lua index 5f6a61d..1805476 100644 --- a/scripts/arluq.lua +++ b/scripts/arluq.lua @@ -5,6 +5,7 @@ include "modules/ZtModArchive/ArluqTools/scripts/services/AnimalService.lua" include "modules/ZtModArchive/ArluqTools/scripts/services/CollectionService.lua" include "modules/ZtModArchive/ArluqTools/scripts/services/FenceService.lua" include "modules/ZtModArchive/ArluqTools/scripts/services/GuestService.lua" +include "modules/ZtModArchive/ArluqTools/scripts/services/StaffService.lua" include "modules/ZtModArchive/ArluqTools/scripts/services/TimeService.lua" include "modules/ZtModArchive/ArluqTools/scripts/services/ZooService.lua" @@ -19,5 +20,6 @@ aq.collection = CollectionService aq.animal = AnimalService aq.fence = FenceService aq.guest = GuestService +aq.staff = StaffService aq.time = TimeService aq.zoo = ZooService \ No newline at end of file diff --git a/scripts/lua/logging.lua b/scripts/lua/logging.lua index 60ab24d..eb7c3ea 100644 --- a/scripts/lua/logging.lua +++ b/scripts/lua/logging.lua @@ -5,22 +5,26 @@ log = {} --- @param message string function log.debug (message) print(os.date("[%Y-%m-%d %H:%M:%S] ") .. "[DEBUG] " .. message) + io.flush() end --- Log error to output --- @param message string function log.error (message) print(os.date("[%Y-%m-%d %H:%M:%S] ") .. "[ERROR] " .. message) + io.flush() end --- Log info to output --- @param message string function log.info (message) print(os.date("[%Y-%m-%d %H:%M:%S] ") .. "[INFO] " .. message) + io.flush() end --- Log warning to output --- @param message string function log.warn (message) print(os.date("[%Y-%m-%d %H:%M:%S] ") .. "[WARN] " .. message) + io.flush() end \ No newline at end of file diff --git a/scripts/lua/try.lua b/scripts/lua/try.lua index 5e7c50e..9719d76 100644 --- a/scripts/lua/try.lua +++ b/scripts/lua/try.lua @@ -1,4 +1,4 @@ -include "scripts/lua/logging.lua" +include "modules/ZtModArchive/ArluqTools/scripts/lua/logging.lua" --- Function for try-catching --- @param func function @@ -15,6 +15,8 @@ function try(func) end -- Show exception in log output log.error(exception) + else + log.info(status) end end diff --git a/scripts/services/StaffService.lua b/scripts/services/StaffService.lua new file mode 100644 index 0000000..c1d4338 --- /dev/null +++ b/scripts/services/StaffService.lua @@ -0,0 +1,9 @@ +-- Include Zoo Tycoon 2 libraries +include "scenario/scripts/entity.lua" +include "scenario/scripts/misc.lua" +include "scenario/scripts/token.lua" +include "scenario/scripts/ui.lua" +include "scripts/canreproduce.lua" + +--- Service for modifiying animals +StaffService = {} \ No newline at end of file diff --git a/scripts/services/ZooService.lua b/scripts/services/ZooService.lua index 2b35bb2..153e7e5 100644 --- a/scripts/services/ZooService.lua +++ b/scripts/services/ZooService.lua @@ -60,6 +60,6 @@ end --- Get zoo name --- @return string -function ZooService.getZooName () +function ZooService.getZooName () return getZooName () end \ No newline at end of file From 16f1660dece062f7e6f139bac4301c8f5e19a39f Mon Sep 17 00:00:00 2001 From: Apodemus Erectus Date: Fri, 8 Oct 2021 09:25:44 +0200 Subject: [PATCH 2/2] bump version --- castor.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/castor.json b/castor.json index e0ba38a..1abd043 100644 --- a/castor.json +++ b/castor.json @@ -2,7 +2,7 @@ "ArchiveName": "zzz-ArluqTools", "RepoName": "ZtModArchive/ArluqTools", "Author": "Apodemus", - "Version": "v2.5", + "Version": "v2.6", "Type": "package", "License": "MIT License", "Description": "This is a lua library that is an abstraction layer around ZT2's libraries.",