pub struct SavedTrigger {Show 26 fields
pub portrait: SavedPortrait,
pub trap_detectable: bool,
pub trap_disarmable: bool,
pub trap_one_shot: bool,
pub trap_type: u8,
pub common: GitTriggerCommon,
pub tag: String,
pub geometry: Vec<UttGeometryPoint>,
pub auto_remove_key: bool,
pub commandable: bool,
pub creator_id: u32,
pub cursor: u8,
pub faction: u32,
pub highlight_height: f32,
pub key_name: String,
pub load_screen_id: u16,
pub localized_name: GffLocalizedString,
pub on_click: ResRef,
pub on_disarm: ResRef,
pub on_trap_triggered: ResRef,
pub script_heartbeat: ResRef,
pub script_on_enter: ResRef,
pub script_on_exit: ResRef,
pub script_user_define: ResRef,
pub set_by_player_party: bool,
pub trigger_type: i32,
}Expand description
A trigger as stored inside a save game’s module GIT.
Fields§
§portrait: SavedPortraitPortrait, as whichever of the two labels the trigger carries.
Declared per owner: the audit parts both labels from the door’s and the placeable’s on the absent axis.
trap_detectable: boolWhether the trap can be spotted (TrapDetectable).
trap_disarmable: boolWhether the trap can be disarmed (TrapDisarmable).
trap_one_shot: boolWhether the trap fires once and clears (TrapOneShot).
trap_type: u8Trap row in traps.2da (TrapType).
common: GitTriggerCommonThe block both forms carry, which the list declares as its element.
No #[gff]: the arm contributes its parts to the split, and the
element is this block, so declaring it here too would make one label
two declarations. The arm’s own codec reads and writes it.
tag: StringObject tag (Tag).
geometry: Vec<UttGeometryPoint>Polygon defining the trigger area (Geometry).
auto_remove_key: boolConsume the key on use (AutoRemoveKey).
commandable: boolAccepts scripted commands (Commandable).
creator_id: u32Object that created this trigger at runtime (CreatorId).
cursor: u8Cursor shown over the trigger (Cursor).
faction: u32Faction id (Faction).
highlight_height: f32Highlight rendering height (HighlightHeight).
key_name: StringKey tag that disarms this trigger (KeyName).
load_screen_id: u16Load screen shown across the transition (LoadScreenID).
localized_name: GffLocalizedStringDisplayed name (LocalizedName).
on_click: ResRefOnClick.
on_disarm: ResRefOnDisarm.
on_trap_triggered: ResRefOnTrapTriggered.
script_heartbeat: ResRefScriptHeartbeat.
script_on_enter: ResRefScriptOnEnter.
script_on_exit: ResRefScriptOnExit.
script_user_define: ResRefScriptUserDefine.
set_by_player_party: boolPlaced by the player party at runtime (SetByPlayerParty).
trigger_type: i32Trigger kind (Type): generic, area transition, or trap.
Implementations§
Source§impl SavedTrigger
impl SavedTrigger
Sourcepub const PARTS: &'static [&'static [Field]]
pub const PARTS: &'static [&'static [Field]]
This type’s schema in parts, which is what a container holding it references.
Own fields first, then one part per flattened child in the order they are declared.
Sourcepub fn read_declared(root: &GffStruct) -> Self
pub fn read_declared(root: &GffStruct) -> Self
Reads every declared field off root.
Absent fields take the entry’s own answer, so a fallback is derived from the declaration rather than restated beside it.
A field declaring a hand-written read is left at that answer for the view to overwrite.
Sourcepub fn write_declared(&self, root: &mut GffStruct)
pub fn write_declared(&self, root: &mut GffStruct)
Writes every declared field onto root, leaving out the ones
their entry says the engine’s own writer leaves out.
A field declaring a hand-written write is not touched here.
Source§impl SavedTrigger
impl SavedTrigger
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element, resolving the portrait’s two labels into one value.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element, emitting whichever portrait label the value uses.
Trait Implementations§
Source§impl Clone for SavedTrigger
impl Clone for SavedTrigger
Source§fn clone(&self) -> SavedTrigger
fn clone(&self) -> SavedTrigger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SavedTrigger
impl Debug for SavedTrigger
Source§impl Default for SavedTrigger
impl Default for SavedTrigger
Source§impl GitElement for SavedTrigger
impl GitElement for SavedTrigger
Source§impl HasSchema for SavedTrigger
impl HasSchema for SavedTrigger
Source§impl PartialEq for SavedTrigger
impl PartialEq for SavedTrigger
Source§fn eq(&self, other: &SavedTrigger) -> bool
fn eq(&self, other: &SavedTrigger) -> bool
self and other values to be equal, and is used by ==.