[−][src]Struct sulis_state::script::script_callback::CallbackData
A callback that can be passed to various functions to be executed later. A single callback can hold multiple invocations by setting several different functions.
add_target(target: ScriptEntity)
Adds the specified target
to the list of targets this callback will provide to its
callee.
add_targets(targets: ScriptEntitySet)
Adds the specified targets
to the list of targets this callback will provide to its
callee
add_selected_point(point: Table)
Adds the specified point
to the list of points this callback will provide in its
targets. The point is a table of the form {x:x_coord, y: y_coord}
add_affected_points(points: Table)
Adds the list of affected points to the affected_points this callback will provide its
targets. The points is a list of tables of the form {x: x_coord, y: y_coord}
set_on_held_changed(func: String)
set_on_effect_applied_fn(func: String)
set_on_menu_select_fn(func: String)
set_on_removed_fn(func: String)
set_on_damaged_fn(func: String)
set_before_attack_fn(func: String)
set_after_attack_fn(func: String)
set_before_defense_fn(func: String)
set_after_defense_fn(func: String)
set_on_anim_update_fn(func: String)
set_on_anim_complete_fn(func: String)
set_on_round_elapsed_fn(func: String)
set_on_moved_fn(func: String)
set_on_surface_round_elapsed_fn(func: String)
set_on_moved_in_surface_fn(func: String)
set_on_entered_surface_fn(func: String)
set_on_exited_surface_fn(func: String)
Each of these methods causes a specified lua func
to be called when the condition is met,
as described in FuncKind
. Multiple of these methods may be added to one
Callback.
Implementations
impl CallbackData
[src]
pub fn clear_funcs_except(&mut self, keep: &[FuncKind])
[src]
pub fn kind(&self) -> Kind
[src]
pub fn parent(&self) -> usize
[src]
pub fn get_func(&self, func: FuncKind) -> Option<String>
[src]
pub fn update_entity_refs_on_load(
&mut self,
entities: &HashMap<usize, Rc<RefCell<EntityState>>>
) -> Result<(), Error>
[src]
&mut self,
entities: &HashMap<usize, Rc<RefCell<EntityState>>>
) -> Result<(), Error>
pub fn update_effect_index_on_load(&mut self, index: usize)
[src]
pub fn new_ability(parent: usize, ability_id: &str) -> CallbackData
[src]
pub fn new_item(parent: usize, item_id: String) -> CallbackData
[src]
pub fn new_entity(parent: usize) -> CallbackData
[src]
pub fn new_trigger(parent: usize, script: String) -> CallbackData
[src]
pub fn add_func(&mut self, kind: FuncKind, name: String)
[src]
Trait Implementations
impl Clone for CallbackData
[src]
fn clone(&self) -> CallbackData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CallbackData
[src]
impl<'de> Deserialize<'de> for CallbackData
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl ScriptCallback for CallbackData
[src]
fn on_held_changed(&self)
[src]
fn on_effect_applied(&self, effect: ScriptAppliedEffect)
[src]
fn on_menu_select(&self, value: ScriptMenuSelection)
[src]
fn on_removed(&self)
[src]
fn before_defense(&self, targets: &ScriptEntitySet)
[src]
fn before_attack(&self, targets: &ScriptEntitySet)
[src]
fn on_anim_complete(&self)
[src]
fn on_anim_update(&self)
[src]
fn on_round_elapsed(&self)
[src]
fn on_moved(&self)
[src]
fn on_surface_round_elapsed(&self)
[src]
when called, this computes the current target set and sends it to the lua function based on the surface state
fn on_moved_in_surface(&self, target: usize)
[src]
fn on_entered_surface(&self, target: usize)
[src]
fn on_exited_surface(&self, target: usize)
[src]
fn after_defense(
&self,
targets: &ScriptEntitySet,
hit_kind: HitKind,
damage: Vec<(DamageKind, u32)>
)
[src]
&self,
targets: &ScriptEntitySet,
hit_kind: HitKind,
damage: Vec<(DamageKind, u32)>
)
fn after_attack(
&self,
targets: &ScriptEntitySet,
hit_kind: HitKind,
damage: Vec<(DamageKind, u32)>
)
[src]
&self,
targets: &ScriptEntitySet,
hit_kind: HitKind,
damage: Vec<(DamageKind, u32)>
)
fn on_damaged(
&self,
targets: &ScriptEntitySet,
hit_kind: HitKind,
damage: Vec<(DamageKind, u32)>
)
[src]
&self,
targets: &ScriptEntitySet,
hit_kind: HitKind,
damage: Vec<(DamageKind, u32)>
)
impl Serialize for CallbackData
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl UserData for CallbackData
[src]
fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M)
[src]
Auto Trait Implementations
impl RefUnwindSafe for CallbackData
impl Send for CallbackData
impl Sync for CallbackData
impl Unpin for CallbackData
impl UnwindSafe for CallbackData
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<'lua, T> FromLua<'lua> for T where
T: 'static + UserData + Clone,
[src]
T: 'static + UserData + Clone,
impl<'lua, T> FromLuaMulti<'lua> for T where
T: FromLua<'lua>,
[src]
T: FromLua<'lua>,
pub fn from_lua_multi(
values: MultiValue<'lua>,
lua: Context<'lua>
) -> Result<T, Error>
[src]
values: MultiValue<'lua>,
lua: Context<'lua>
) -> Result<T, Error>
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'lua, T> ToLua<'lua> for T where
T: 'static + UserData + Send,
[src]
T: 'static + UserData + Send,
impl<'lua, T> ToLuaMulti<'lua> for T where
T: ToLua<'lua>,
[src]
T: ToLua<'lua>,
pub fn to_lua_multi(self, lua: Context<'lua>) -> Result<MultiValue<'lua>, Error>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,