tModLoader

tModLoader

评价数不足
HolidayLib
   
奖励
收藏
已收藏
取消收藏
模组功能: 模组类库
模组端: 不同步
tModLoader版本: 1.4.4
文件大小
发表于
更新日期
40.579 KB
2023 年 7 月 17 日 上午 5:15
2023 年 11 月 5 日 下午 5:32
3 项改动说明 ( 查看 )

订阅以下载
HolidayLib

描述
HolidayLib exists to let mods forcibly activate holiday events that the vanilla game does not feature, regardless of which mod adds them, this potential existed for April Fools' Day in 1.4.3 through detouring AprilFools.CheckAprilFools but since that's been removed I made this mod so all the holidays can be manipulated (provided the mods that use them use this mod)

all calls and names/aliases are case-insensitive and ignore spaces and underscores
Call documentation:
ADDHOLIDAY: adds a holiday or merges range/conditions into existing holiday, returns a reference to the added holiday, or an ArgumentException if the arguments are formatted incorrectly
ADDHOLIDAY <name: string> <day: DateTime (ignores year and time)>
ADDHOLIDAY <name: string> <start: DateTime (ignores year and time)> <end: DateTime (ignores year and time)>
ADDHOLIDAY <name: string> <start: DateTime (ignores year and time)> <duration: int (duration in days)>
ADDHOLIDAY <name: string> <dateRanges: params HolidayLib.DateRange[]>
ADDHOLIDAY <name: string> <conditions: params Func<int>[] (if the sum of the return value of all conditions is > 0 holiday is active regardless of date, if < 0 holiday is inactive regardless of date)>

ADDALIAS: adds one or more aliases to a holiday, returns null
ADDALIAS <name: string> <aliases: params string[]>
ADDALIASES <name: string> <aliases: params string[]>

ISACTIVE: returns whether or not a holiday is currently active
ISACTIVE <name: string>

GETACTIVELOOKUP: returns a function that returns whether or not a holiday is currently active
GETACTIVELOOKUP <name: string>

HOLIDAYFORCECHANGED: increments a counter to allow mods to check if the holiday has been changed, returns the new value, should be called whenever a holiday is forced to start or end, or when the state of a holiday which does not begin or end at the beginning of a new day changes
HOLIDAYFORCECHANGED <no arguments>

FORCEDHOLIDAYVERSION: returns the current value of the counter incremented by HOLIDAYFORCECHANGED
FORCEDHOLIDAYVERSION <no arguments>

GETFUNC: returns a Func<object[], object> to call the specified call directly
GETFUNC <callName: string>

HELP: returns the string "See description for documentation"
HELP <no arguments>
引用自 tModLoader
Developed By Tyfyter
3 条留言
Moonlight Glint  [作者] 2 月 14 日 下午 5:19 
Any mod can add holidays, but the ones that are registered by default can be found here: https://github.com/Tyfyter/HolidayLib/blob/master/HolidayLib.cs#L32-L48
lutravurr 2 月 14 日 下午 4:54 
what are the names for the holidays tho?
Animarchy 2024 年 10 月 10 日 上午 4:04 
cool mod vary us:steamhappy:efull