← README
This page helps mod authors integrate with Lookup Anything. See the main README for other info.
When players look up content in-game (like an item or NPC), the added by mod field shows which mod added it if possible.
For this to work, you must apply the standard unique string ID format (including the mod ID prefix).
Lookup Anything scans the world to detect items for the 'number owned' and gift taste fields. It
scans inside standard items recursively; for example, if you have an Object with the heldObject
field set to a chest, Lookup Anything will look inside the chest too.
If you have a custom non-Object item (e.g. a tool) which contains items, you can add a custom
heldObject field or property with any Item type. For example:
// store one item
public Object heldObject;
// store many items
public Chest heldObject = new Chest();Lookup Anything will detect the field and search inside it too.
Lookup Anything detects when the cursor is over an item or NPC in standard menus.
In your custom menus, you can tell Lookup Anything about the hovered content by adding a field or property with a specific name:
| name | type |
|---|---|
HoveredItem orhoveredItem |
Item (or subtype like Object) |
HoveredNpc orhoveredNpc |
NPC (or subtype like Horse) |
For example:
public Item HoveredItem { get; }When the player presses F1 on your menu, they'll see the matching content automatically. If you
have multiple fields/properties, Lookup Anything will choose one non-null value to show.
Lookup Anything uses visual themes to change its menu appearance.
You can add UI themes by editing the Mods/Pathoschild.LookupAnything/Themes asset. Any theme in
that asset will appear in the config UI for Lookup Anything.
The asset consists of a string → model lookup, where...
- The key is a unique ID for the theme.
- The value is a model with the fields listed below.
| field | effect |
|---|---|
DisplayName |
A translated display name shown in UIs. |
BackgroundType |
How the menu background should be drawn. Default The possible values are:
|
BackgroundTexture |
The background texture to draw, if applicable based on the BackgroundType. |
BackgroundSourceRect |
The pixel area within the BackgroundTexture to draw. |
BackgroundColor |
The color code for the background (default
The effect depends on the
|
BackgroundPadding |
The pixel spacing between the edge of the BackgroundTexture and the inner content. Default 0. |
BorderColor |
The color code for the border drawn around the background
(default |
For example, using Content Patcher:
{
"Action": "EditData",
"Target": "Mods/Pathoschild.LookupAnything/Themes",
"Entries": {
"{{ModId}}_MenuBox_Purple": {
"DisplayName": "Menu box (purple)",
"BackgroundCategory": "MenuBox",
"BackgroundTexture": "Maps/MenuTilesUncolored",
"BackgroundSourceRect": { "X": 0, "Y": 256, "Width": 60, "Height": 60 },
"BackgroundColor": "Purple",
"BackgroundPadding": 4
}
}
}