Skip to content

Commit f4c82d0

Browse files
Move config to separate script
1 parent 9e79b62 commit f4c82d0

5 files changed

Lines changed: 18 additions & 26 deletions

File tree

newmodels_red/DOCUMENTATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ e.g. `models/ped/7/Mafioso 1/-2.dff`
6767

6868
#### NandoCrypt Support (Optional)
6969

70-
You may use [NandoCrypt](https://github.com/Fernando-A-Rocha/mta-nandocrypt) to encrypt your mod files. Place them with file extension `.nandocrypt` so they are automatically recognised. You may customize the file extension in [`shared_local.lua`](/newmodels_red/scripts/core/shared_local.lua).
70+
You may use [NandoCrypt](https://github.com/Fernando-A-Rocha/mta-nandocrypt) to encrypt your mod files. Place them with file extension `.nandocrypt` so they are automatically recognised. You may customize the file extension in [`shared_config.lua`](/newmodels_red/scripts/core/shared_config.lua).
7171

7272
A test `nando_decrypter` script is included with the resource, as well as a mod consisting of 2 encrypted files (`-5.dff.nandocrypt` and `-5.txd.nandocrypt`). To use your own mods, you will have to replace `nando_decrypter` with your own decrypter script generated by the NandoCrypt tool.
7373

newmodels_red/meta.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
<!-- Main Scripts -->
4747
<script src="scripts/core/lib/server_async.lua" type="server"/>
48+
<script src="scripts/core/shared_config.lua" type="shared"/>
4849
<script src="scripts/core/shared_local.lua" type="shared"/>
4950
<script src="scripts/core/shared_exported.lua" type="shared"/>
5051
<script src="scripts/core/shared_importfunc.lua" type="shared"/>

newmodels_red/scripts/core/server_logic.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ local function parseModListEntry(modelType, modInfo)
397397
settings["downloadFilesOnDemand"] = true
398398
end
399399

400-
local ncExt = getNandoCryptExtension()
400+
local ncExt = NANDOCRYPT_EXT
401401

402402
-- DFF check
403403
if dff_path then
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- ....... CONFIGURATION ............................................
2+
3+
-- These default values can be overridden per model.
4+
DEFAULT_AUTO_MODEL_SETTINGS = {
5+
["disableAutoFree"] = false,
6+
["disableTXDTextureFiltering"] = false,
7+
["enableDFFAlphaTransparency"] = false,
8+
}
9+
10+
-- For downloadFile behavior
11+
DOWNLOAD_FILE_MAX_RETRIES = 3
12+
DOWNLOAD_RETRY_WAIT_DELAY_MS = 1000
13+
14+
-- NandoCrypt file extension
15+
NANDOCRYPT_EXT = ".nandocrypt"

newmodels_red/scripts/core/shared_local.lua

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
-- ....... CONFIGURATION ............................................
2-
3-
-- These default values can be overridden per model.
4-
DEFAULT_AUTO_MODEL_SETTINGS = {
5-
["disableAutoFree"] = false,
6-
["disableTXDTextureFiltering"] = false,
7-
["enableDFFAlphaTransparency"] = false,
8-
}
9-
10-
-- For downloadFile behavior
11-
DOWNLOAD_FILE_MAX_RETRIES = 3
12-
DOWNLOAD_RETRY_WAIT_DELAY_MS = 1000
13-
14-
-- NandoCrypt file extension
15-
local NANDOCRYPT_EXT = ".nandocrypt"
16-
17-
-- ..................................................................
18-
19-
-- ....... USEFUL FUNCTIONS .........................................
20-
211
local isClientsideScript = localPlayer ~= nil
222

233
function isNandoCryptFileName(fn)
@@ -31,10 +11,6 @@ function isNandoCryptFileName(fn)
3111
return false
3212
end
3313

34-
function getNandoCryptExtension()
35-
return NANDOCRYPT_EXT
36-
end
37-
3814
if isClientsideScript then
3915
function getNandoDecrypterFunction()
4016
if type(ncDecrypt) == "function" then

0 commit comments

Comments
 (0)