![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <WidgetStateBitfield.h>
Expensive to create wrapper for binary and enumerated widget states that supports FName-based interaction and dynamic states populated in an IWidgetStateNameMapper May be used to represent either a target widget state combination, or an actual widgets state
All this does is cache the integer results of dynamic FName state lookup from an IWidgetStateNameMapper So it's prefertable to create these once and reuse. In particular, if broadcasting current state determine the correct bitfield to modify the existing state ahead of time. Save that bitfield and use it when performing state-modifications. Likewise when performing state tests, try to construct the relevant bitfield ahead of time & store that to later be compared against
| FWidgetStateBitfield::FWidgetStateBitfield | ( | ) |
Default, will convert to false as a bool
| FWidgetStateBitfield::FWidgetStateBitfield | ( | const FName | InStateName | ) |
Interprets name as binary state on
Interprets name value pair as enum state
| void FWidgetStateBitfield::ClearEnumState | ( | const FWidgetStateBitfield & | EnumStateBitfield | ) |
Clear all existing values for given states & mark the states unused
| EnumStateBitfield | state bitfield, all used states will be cleared |
Clear all existing values for given state & mark the state unused, slow version w/ map lookup
Clear all existing values for given state & mark the state unused
| EnumStateIndex | Index for enum state to mark as unused |
| bool FWidgetStateBitfield::HasAllBinaryFlags | ( | const FWidgetStateBitfield & | InBitfield | ) | const |
True if all binary state flags are met
| bool FWidgetStateBitfield::HasAllEnumFlags | ( | const FWidgetStateBitfield & | InBitfield | ) | const |
True if all enum state flags are met
| bool FWidgetStateBitfield::HasAllFlags | ( | const FWidgetStateBitfield & | InBitfield | ) | const |
True if all state flags are met
| bool FWidgetStateBitfield::HasAnyBinaryFlags | ( | const FWidgetStateBitfield & | InBitfield | ) | const |
True if any binary state flag is met
| bool FWidgetStateBitfield::HasAnyEnumFlags | ( | const FWidgetStateBitfield & | InBitfield | ) | const |
True if any enum state flag is met
| bool FWidgetStateBitfield::HasAnyFlags | ( | const FWidgetStateBitfield & | InBitfield | ) | const |
Note: No need for HasNoFlags. Simply call !HasAnyFlags. True if any state flag is met
| bool FWidgetStateBitfield::HasBinaryStates | ( | ) | const |
True if any binary state is set
| bool FWidgetStateBitfield::HasEmptyUsedEnumStates | ( | ) | const |
True if any enum used enum states are empty, usually indicating a failed '&' test
| bool FWidgetStateBitfield::HasEnumStates | ( | ) | const |
True if any enum state is used, does not indicate if state is actually set. Use 'HasEmptyUsedEnumStates' for that.
| FWidgetStateBitfield FWidgetStateBitfield::Intersect | ( | const FWidgetStateBitfield & | Rhs | ) | const |
Intersection of binary and enum states, with union on enum state usage so enum state mismatches can fail Intersections will remove not allowed enum states, allowing for failure on bool conversion due to empty used states. Approximation of bitwise '&'. Non-commutative, will use LHS enum state set if RHS does not use enum. Additionally, if the RHS has binary states & the LHS does not meet those, all enum states will be marked unused to ensure failure
| void FWidgetStateBitfield::NegateBinaryStates | ( | ) |
Negate only binary states
| void FWidgetStateBitfield::NegateEnumStates | ( | ) |
Negate only enum states, does not change usage, but marks existing values as not allowed
| void FWidgetStateBitfield::NegateStates | ( | ) |
Negate both binary and enum states
| FWidgetStateBitfield::operator bool | ( | ) | const |
True if any binary or enum state is set, and no empty used enum states exist
| FWidgetStateBitfield FWidgetStateBitfield::operator~ | ( | ) | const |
Negation of binary and enum states, maintains enum state usage, but marks states as not allowed.
| void FWidgetStateBitfield::SetBinaryState | ( | const FWidgetStateBitfield & | BinaryStateBitfield, |
| bool | BinaryStateValue | ||
| ) |
Set Binary state to given value, using a bitfield to indicate states that should be changed
| BinaryStateBitfield | state bitfield, all marked states will be set with given value |
| BinaryStateValue | Value to assign for given Binary state |
Set binary state to given value
| BinaryStateIndex | Index for Binary state to assign value to |
| BinaryStateValue | Value to assign for given Binary state |
Set Binary state to given value, slow version w/ FName map lookup
| void FWidgetStateBitfield::SetEnumState | ( | const FWidgetStateBitfield & | EnumStateBitfield | ) |
Set enum state to given value, clearing all existing values for states in use
| EnumStateBitfield | state bitfield, all used states will copy-overwrite current enum state |
Set enum state to given value, clearing all existing values for that state
| EnumStateIndex | Index for enum state to assign value to |
| EnumStateValue | Value to assign for given enum state |
Set enum state to given value, clearing all existing values for that state, slow version w/ FName map lookup
| void FWidgetStateBitfield::SetState | ( | const FWidgetStateBitfield & | InBitfield | ) |
Set state to given value, just calls assignment operator for you
| FWidgetStateBitfield FWidgetStateBitfield::Union | ( | const FWidgetStateBitfield & | Rhs | ) | const |
Union of binary and enum states, allows for a single enum state to have multiple values in a bitfield. Unions will grow enum state set if allowance is same, otherwise the allowed set is maintained. Approximation of bitwise '|'. Commutative.