[−][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][+]
impl Debug for CallbackData
[src][+]
impl<'de> Deserialize<'de> for CallbackData
[src][+]
impl ScriptCallback for CallbackData
[src][+]
impl Serialize for CallbackData
[src][+]
impl UserData for CallbackData
[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,
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>,
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>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,