2 using System.Collections.Generic;
16 [
Serialize(
"",
IsPropertySaveable.Yes, description:
"If specified, only items that have been given this tag using TagAction are considered valid.")]
19 [
Serialize(
SelectedItemType.Any,
IsPropertySaveable.Yes, description:
"How does the item need to be selected? Primary item (i.e. any device you're interacting with), secondary item (such as ladders or chairs which allow interacting with a primary item at the same time), or either?")]
38 if (character ==
null)
40 Error($
"{nameof(CheckSelectedAction)} error: {GetEventName()} uses a {nameof(CheckSelectedAction)} but no valid character was found for tag \"{CharacterTag}\"! This will cause the check to automatically fail.");
48 Error($
"{nameof(CheckSelectedAction)} error: {GetEventName()} uses a {nameof(CheckSelectedAction)} but no valid targets were found for tag \"{TargetTag}\"! This will cause the check to automatically fail.");
51 foreach (var target
in targets)
58 if (target is not
Item targetItem)
62 if (IsSelected(targetItem))
69 bool IsSelected(
Item item)
91 void Error(
string errorMsg)
97 void Error(
string errorMsg)
104 private string GetEventName()
bool HasSelectedAnyItem
Has the characters selected a primary or a secondary item?
Item????????? SelectedItem
The primary selected item. It can be any device that character interacts with. This excludes items li...
Character SelectedCharacter
Item SelectedSecondaryItem
The secondary selected item. It's an item other than a device (see SelectedItem), e....
bool IsAnySelectedItem(Item item)
Is the item either the primary or the secondary selected item?
Check whether a specific character has selected a specific kind of item.
SelectedItemType ItemType
override? bool DetermineSuccess()
CheckSelectedAction(ScriptedEvent parentEvent, ContentXElement element)
readonly ScriptedEvent ParentEvent
ContentPackage? ContentPackage
readonly Identifier Identifier
IEnumerable< Entity > GetTargets(Identifier tag)