- Fix
ScreenAdjust
for radar
InterfaceController
starts and controls a number of replacement UIs.
An IComp
(avoiding MS stuff) is a building blocks for HUDs. All have:
_id
automatically generated using a static field- Styling options handled internally
Check
which renders the component and returns true if it was interacted withDrawBody
, called inside ofCheck
which draws elements specific to the componentChanged
is set to false at the start and set to true on interaction
- Different data needs handled by the state of the subclass, used when they've been interacted with in a style similar to ImGui
Init
/Dispose
A IPicker<T>
draws the elements needed to select something, such as value(s) from an Enum
- Has a
T Selection
for the last element interacted with ICollectionPicker<T>
addsT[] Choices
and loops through them inDrawBody
DrawItem(T item, int index)
renders each item
IPagedPicker<T>
addsDrawPageControls
to the start ofDrawBody
- Number of items
PerPage
and theCurrentPage
are used to display only part of the choices
TexturedPicker
A IFilter<T>
draws some filtering criteria
- It has a predicate for
T
used forIEnumerable<T> GetFiltered(IEnumerable<T> input)
bool IsFiltered(T item)
An IOptionalFilter<T>
- Adds in a
DrawToggle
which controls theActive
state of the filter - That may be used to skip rendering the rest of the filter
Types of filters:
RegexFilter
filters based on text for a provided object and aFunc<T, string>
method- Todo?
ValueComparisonFilter
has aCompareType
combo and adouble
input that is compares to aFunc<T, double?>
methodBoolFilter
for a list of boolean values
A Modal
is a centered popup for complex inputs
- Keeps track of whether it is
_open
or the negation of that,Finished
- Not drawn if the modal is closed
- Returns true when the modal is closed
Changed
indicates whether the component was interacted with
- Name kept unique using
_id
MinSize/MaxSize
used to set constraintsOpen
/Close
for related behavior- Optionally renders as a popup with
IsPopup
PickerModal<T>
displays a Picker and closes if an item is selected.- May use a manager/static default version for modals that will only exist one place at a time so a local copy isn't needed
Map (Prop, value) to Enum type
PropId.TryGetEnum(PropType value)
maps values of a property to their enum, if there is one- Used to find names / valid values
A ComputedProperty
is a desired property that doesn't directly exist
- Min damage from variance
- Calculated resistance of armor
- etc.
-
wo.Describe
returns a description of a given WorldObject by routing it to the relevant collections of descriptionswo.TryDescribe
fails if the property was missing- List of PropType - key?
- Ignored if empty string / null
-
wo.Describe(PropId key, bool formatted)
exist for each type of property you may want to know about -
CompoundProperty
is used to handle descriptions that involve more than one property- All types of resistance
-
Dictionaries of format strings exist for each type of property, and if
format=true
that value will be returned instead- Possibly make use of
params
for props with more than one input
- Possibly make use of
-
Prop.Friendly(value)
will return a friendly name for a property value- Based on ACE's
GetValueEnumName
inProperty<Type>Extensions
- Enum values->names
- Percent conversions like on attack skill
- etc.
- Based on ACE's
-
Prop.Label()
returns a label for a property-
Returns a descriptive label for the property like "Ammunition" for
IntId.AmmoType
-
Defaults to the name of the property (or number, if not defined in the enum)
-
-
wo.Describe(game.World.Selected)
-
wo.Describe(IntId.AmmoType)
- Starts by finding the value:
wo.TryGet(IntId.AmmoType)
- Returns
null
if missing
- Returns
- Then finds the friendly name:
wo.Friendly(IntId.AmmoType, value)
- Finds the value on the WorldObject and returns "" if missing
- If available it calls
Friendly
on the prop with the found value:IntId.AmmoType.Friendly(4)
->"Dart"- If missing returns
null
?
- Format is found
- "Uses {0}s as ammunition." ->
- "Uses Darts as ammunition"
- Format not found
- "Darts"
- Starts by finding the value:
The SetDragDropPayload
function allows you to attach data to the drag and drop operation, and it requires specifying the payload type, data pointer, and data size.
Operations on pointers are:
- Unary
&
(address-of) operator: to get the address of a variable - Unary
*
(pointer indirection) operator: to obtain the variable pointed by a pointer - The
->
(member access) and[\]
(element access) operators - Arithmetic operators
+
,-
,++
, and--
- Comparison operators
==
,!=
,<
,>
,<=
, and>=
Pointer declarations look like:
type* identifier;
void* identifier; //allowed but not recommended
Reference: