|
TModLoader v1.4.4.9
TModLoader source code documentation
|
Namespaces | |
| namespace | UI |
Classes | |
| class | BackgroundColorAttribute |
| Specifies a background color to be used for the property, field, or class in the ModConfig UI. More... | |
| class | BuffDefinition |
| class | ColorHSLSliderAttribute |
| Add this attribute to a Color item and the UI will present a Hue, Saturation, and Lightness sliders rather than Red, Green, and Blue sliders. Pass in false to skip Saturation and Lightness. More... | |
| class | ColorNoAlphaAttribute |
| Add this attribute to a Color item and Alpha will not be presented in the UI and will remain as 255 unless manually edited. More... | |
| class | ConfigArgsAttribute |
| class | ConfigKeyAttribute |
| class | ConfigManager |
| class | CustomModConfigItemAttribute |
| Use this attribute to specify a custom UI element to be used for the annotated property, field, or class in the ModConfig UI. More... | |
| class | DefaultDictionaryKeyValueAttribute |
| Defines the default key value to be added when using the ModConfig UI to add elements to a Dictionary. Works the same as System.ComponentModel.DefaultValueAttribute, but can't inherit from it because it would break when deserializing any data structure annotated with it. This attribute compliments DefaultListValueAttribute when used annotating a Dictionary. More... | |
| class | DefaultListValueAttribute |
| Defines the default value to be added when using the ModConfig UI to add elements to a Collection (List, Set, or Dictionary value). Works the same as System.ComponentModel.DefaultValueAttribute, but can't inherit from it because it would break when deserializing any data structure annotated with it. More... | |
| class | DrawTicksAttribute |
| Add this attribute and the sliders will show white tick marks at each increment. More... | |
| class | EntityDefinition |
| Classes implementing EntityDefinition serve to function as a way to save and load the identities of various Terraria objects. Only the identity is preserved, no other data such as stack size, damage, etc. These classes are well suited for ModConfig, but can be saved and loaded in a TagCompound as well. More... | |
| class | ExpandAttribute |
| Affects whether this data will be expanded by default. The default value currently is true. Use the constructor with 2 parameters to control if list elements should be collapsed or expanded. More... | |
| class | HeaderAttribute |
| This attribute adds a label above this property or field in the ModConfig UI that acts as a header. Use this to delineate sections within your config. Note that fields will be in order, and properties will be in order, but fields and properties will not be interleaved together in the source code order. Header accept either a translation key or an identifier. To use a translation key, the value passed in must start with "$". A value passed in that does not start with "$" is interpreted as an identifier. The identifier is used to construct the localization key "Mods.{ModName}.Configs.{ConfigName}.Headers.{Identifier}" No spaces are allowed in translation keys, so avoid spaces Annotations on members of non-ModConfig classes need to supply a localization key using this attribute to be localized, no localization key can be correctly assumed using just an identifier. More... | |
| class | IncrementAttribute |
| Use this to set an increment for sliders. The slider will move by the amount assigned. Remember that this is just a UI suggestion and manual editing of config files can specify other values, so validate your values. Defaults are: float: 0.01f - byte/int/uint: 1. More... | |
| class | ItemDefinition |
| ItemDefinition represents an Item identity. A typical use for this class is usage in ModConfig, perhaps to facilitate an Item tweaking mod. More... | |
| class | JsonDefaultDictionaryKeyValueAttribute |
| Similar to JsonDefaultListValueAttribute, but for assigning to the Dictionary Key rather than the Value. More... | |
| class | JsonDefaultListValueAttribute |
| Similar to DefaultListValueAttribute but for reference types. It uses a json string that will be used populate new instances list elements. Defines the default value, expressed as json, to be added when using the ModConfig UI to add elements to a Collection (List, Set, or Dictionary value). More... | |
| class | JsonDefaultValueAttribute |
| Similar to DefaultValueAttribute but for reference types. It uses a json string that will be used populate this element when initialized. Defines the default value, expressed as json, to be used to populate an object with the NullAllowed attribute. Modders should only use this in conjunction with NullAllowed, as simply initializing the field with a default value is preferred. More... | |
| class | LabelArgsAttribute |
| Use to provide values to be interpolated into the label of the annotated property or field. string arguments starting with "$" are interpreted as localization keys. Interpolating values can be useful for reusing common labels to keep localization files clean and organized. For example, if a mod provides toggles for several features, a common label could be used for each with only the provided value being different. The string formatting section of the Localization wiki pageexplains this concept further. Scope simplificationcan be used to shorten localization keys passed in. More... | |
| class | LabelAttribute |
| class | LabelKeyAttribute |
| A label is the text shown to the user in the ModConfig UI. This attribute sets a custom localization key for the label of the annotated property, field, or class. The provided localization key must start with "$". Without this attribute, the localization key "Mods.{ModName}.Configs.{ConfigName}.{MemberName}.Label" will be assumed for members of ModConfig classes. Annotations on members of non-ModConfig classes need to supply a custom localization key using this attribute to be localized, otherwise they will appear as the member name directly. If the translation value of a property or field that is an object is an empty string, the label of the class will be used instead. Values can be interpolated into the resulting label text using T:Terraria.ModLoader.Config.LabelArgsAttribute. More... | |
| class | ModConfig |
| ModConfig provides a way for mods to be configurable. ModConfigs can either be Client specific or Server specific. When joining a MP server, Client configs are kept but Server configs are synced from the server. Using serialization attributes such as [DefaultValue(5)] or [JsonIgnore] are critical for proper usage of ModConfig. tModLoader also provides its own attributes such as ReloadRequiredAttribute and LabelAttribute. More... | |
| class | NPCDefinition |
| class | NullAllowedAttribute |
| This attribute means the annotated item can possibly be null. This will allow the UI to make the item null. It is up to the modder to make sure the item isn't null in the ModConfig constructor and nested classes. More... | |
| class | OptionStringsAttribute |
| By default, string fields will provide the user with a text input field. Use this attribute to restrict strings to a selection of options. More... | |
| class | PrefixDefinition |
| class | ProjectileDefinition |
| class | RangeAttribute |
| Specifies a range for primitive data values. Without this, default min and max are as follows: float: 0, 1 - int/uint: 0, 100 - byte: 0, 255. More... | |
| class | ReferenceDefaultsPreservingResolver |
| Custom ContractResolver for facilitating reference type defaults. The ShouldSerialize code enables unchanged-by-user reference type defaults to properly not serialize. The ValueProvider code helps during deserialization to not. More... | |
| class | ReloadRequiredAttribute |
| This attribute hints that changing the value of the annotated property or field will put the config in a state that requires a reload. An overridden ModConfig.NeedsReload can further validate if more complex logic is needed. More... | |
| class | SeparatePageAttribute |
| This specifies that the annotated item will appear as a button that leads to a separate page in the UI. Use this to organize hierarchies. More... | |
| class | ShowDespiteJsonIgnoreAttribute |
| This attribute indicates that the field or property should be shown in the ModConfig UI despite having a T:Newtonsoft.Json.JsonIgnoreAttribute annotation. More... | |
| class | SliderAttribute |
| Affects whether this data will be presented as a slider or an input field. Add this attribute to use a slider. Currently only affects data of type int. More... | |
| class | SliderColorAttribute |
| Specifies a slider color for ModConfig elements that use a slider. The default color is white. More... | |
| class | ToFromStringConverter |
| This TypeConverter facilitates converting to and from the string Type. This is necessary for Objects that are to be used as Dictionary keys, since the JSON for keys needs to be a string. Classes annotated with this TypeConverter need to implement a static FromString method that returns T. More... | |
| class | TooltipArgsAttribute |
| Use to provide values to be interpolated into the tooltip of the annotated property or field. string arguments starting with "$" are interpreted as localization keys. Interpolating values can be useful for reusing common tooltips to keep localization files clean and organized. For example, if a mod provides toggles for several features, a common tooltip could be used for each with only the provided value being different. The string formatting section of the Localization wiki pageexplains this concept further. Scope simplificationcan be used to shorten localization keys passed in. More... | |
| class | TooltipAttribute |
| class | TooltipKeyAttribute |
| A tooltip is the text shown to the user in the ModConfig UI next to the cursor when they hover over the annotated member (property, field, or class). This can be longer and more descriptive than the Label. This attribute sets a custom localization key for the tooltip of the annotated property, field, or class. The provided localization key must start with "$". Without this attribute, the localization key "Mods.{ModName}.Configs.{ConfigName}.{MemberName}.Tooltip" will be assumed for members of ModConfig classes. Annotations on members of non-ModConfig classes need to supply a custom localization key using this attribute to be localized, no localization key is assumed. If the translation value of a property or field that is an object is an empty string, the tooltip of the class will be used instead. Passing in just "$" will result in no tooltip entry being added to the localization files. Values can be interpolated into the resulting label text using T:Terraria.ModLoader.Config.TooltipArgsAttribute. More... | |
Enumerations | |
| enum | ConfigScope { ServerSide , ClientSide } |
| Each ModConfig class has a different scope. Failure to use the correct mode will lead to bugs. More... | |