Skip to content

Commit 3ef6d79

Browse files
authored
Merge pull request #10 from ZtModArchive/v2-animallistservice
V2 animallistservice
2 parents 71b585a + 45d23f4 commit 3ef6d79

12 files changed

Lines changed: 964 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# exclude file types
2+
*.zip
3+
*.z2f

Arluq-github-social-preview.png

-24.7 KB
Binary file not shown.

Arluq-logo.png

-28 KB
Binary file not shown.

castor.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"ArchiveName": "ArluqTools",
3+
"Z2f": true,
4+
"IncludeFolders": [
5+
"scripts"
6+
],
7+
"ExcludeFolders": []
8+
}
File renamed without changes.

scripts/ArluqTools2/services/AnimalService.lua renamed to scripts/modules/ArluqTools/ArluqTools1/services/AnimalService.lua

File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Include Zoo Tycoon 2 libraries
2+
include "scenario/scripts/entity.lua"
3+
include "scenario/scripts/misc.lua"
4+
include "scenario/scripts/token.lua"
5+
include "scenario/scripts/ui.lua"
6+
7+
--- Service for Radical Remake.
8+
RRService = {}
9+
10+
RRService.AnimalGetAge() {
11+
12+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- Function for try-catching
2+
--- @param func function
3+
function try(func)
4+
-- Try
5+
local status, exception = pcall(func)
6+
-- Catch
7+
if not status then
8+
-- Show exception in the message panel in-game
9+
local increment = 50
10+
for i = 0, string.len(exception), increment
11+
do
12+
displayZooMessageTextWithZoom(string.sub(exception, i, i+increment-1), 1, 30)
13+
end
14+
end
15+
end
16+
17+
--- Function for try-catching with a custom callback
18+
--- @param func function
19+
--- @param callback function
20+
function tryCatch(func, callback)
21+
-- Try
22+
local status, exception = pcall(func)
23+
-- Catch
24+
if not status then
25+
-- Call callback function
26+
callback(exception)
27+
end
28+
end

0 commit comments

Comments
 (0)