tModLoader

tModLoader

Not enough ratings
Inline Wiki Lib
   
Award
Favorite
Favorited
Unfavorite
Mod Features: Library
Mod Side: Both
tModLoader Version: 1.4.3, 1.4.4
Language: English
File Size
Posted
Updated
52.177 KB
26 Oct, 2022 @ 5:47am
1 Aug, 2023 @ 11:21am
4 Change Notes ( view )

Subscribe to download
Inline Wiki Lib

Description
Inline Wiki Lib handles GUI for Inline Wiki Entries

The easiest way to add support for your Mod is to add a field called 'InlineWikiLibValue' to your ModItem

The field must be public and static for this to work:

//Example from Combinations Mod public static string InlineWikiLibValue = @" ## Aglet Of The Wind ![Combinations/Items/AgletOfTheWind/AgletOfTheWind]t4 The Aglet Of The Wind grants 12 % increased movement speed. The Aglet Of The Wind can be further upgraded into the Lightning Boots, like its parts. ... ";

If you need Localisation support you can do the following:

public static readonly string InlineWikiLibValue; public override void SetStaticDefaults() { InlineWikiLibValue = Language.GetTextValue("Mods.YourMod.YourItem.InlineWiki"); }

You can also add a entry with the Mod Call API:

Mod inlineWiki = ModLoader.GetMod("InlineWikiLib"); //Wood is Terraria Wood Item inlineWiki?.Call("AddWikiEntry", "Wood", @"## Wood ![Terraria/Images/Item_9] Wood is a type of block that is generally obtained by cutting down trees using an axe or a chainsaw.");

This is usefull if you want to add wiki entries for vanilla or other mods.


The content of the wiki string is parsed similar to Markdown.
The following syntax is understood:

\n is interpreted as line break

# at start of line for large font size
## at start of line for medium-large font size
### at start of line for medium font size
### at start of line for small font size

example:
## Aglet Of The Wind

~0 for color red
~1 for color green
~2 for color blue
~3 for color black
~4 for color yellow
~5 for color violet
~6 for color orange
~7 for color cyan
~8 for color brown
~9 for color pink

example:
~1Green

or

##~1Big Green

![PATH/TO/TEXTURE] to display a texture
![PATH/TO/TEXTURE]t-x to display a texture with x pixel top offset

example:
![Combinations/Items/AgletOfTheWind/AgletOfTheWind]t4

loads the texture with 4 pixel offset from the top (can also be t-4)


Future Plans / Roadmap:
- Add syntax to add Slot-Item GUI to cross-reference other items correctly
- Add support for entities and blocks that drop items
- Add syntax and GUI for recipes
- Create a better priority system for overriding entries
- Improve GUI Scaling


This Mod is Open Source and licensed under the MIT-License
see https://github.com/Kabaril/InlineWikiLib
3 Comments
Keiler  [author] 18 Nov, 2022 @ 5:09am 
You can also look at the source code here: Github InlineWikiLib [github.com] if that helps.
Keiler  [author] 18 Nov, 2022 @ 5:07am 
If the Mod adds a entry for itself, it is prioritised (except if a mod explicitly sets override flag).
Otherwise the load order of mods decides (last one overwrites previous entries).
BasicallyIAmFox 17 Nov, 2022 @ 9:59pm 
What will happen if two different mods add entries for same item?