Common Features of NML
For BasicMod
Log
BasicMod
provides three static methods to print log with mod name as prefix: LogInfo
, LogWarning
, LogError
.
Mod Instance
BasicMod
provides static property to visit your mod instance directly: Instance
.
Mod Info
You can get your mod declaration through BasicMod:GetDeclaration
. Definition of mod declaration is below:
Mod Configuration Window
BasicMod
is a mod providing configuring. You can get instance of ModConfig
with GetConfig
, Detailed see Mod Configuration
Multiligual
Create a folder named Locales
, and refers to ModExample. Only json and csv files are supported.
Others Common Features
Log
NeoModLoader.services.LogService
provides
Normal:
LogInfo
,LogWarning
,LogError
,Print stack trace:
LogStackTraceAsInfo
,LogStackTraceAsWarning
,LogStackTraceAsError
Used in multiple threads:
LogInfoConcurrent
,LogWarningConcurrent
,LogErrorConcurrent
.
Sprite
Create a folder named GameResources
under your mod folder. .png
, .jpg
, .jpeg
files will be explained by sprites.json
or corresponding .meta
files and loaded into game.
Then you can get them through Resources.Load
, SpriteTextureLoader.getSprite
or other related functions.
Detailed see Resources Overview
NeoModLoader.utils.SpriteLoadUtils
provides
LoadSingleSprite(string)
to load a single picture file as a SpriteLoadSprites(string)
search related.meta
file(parsed into aTextureImporter
, and provides aSpriteSheet
) orsprites.json
to load picture(s) at/under a path.
Last updated