[][src]Struct sulis_state::script::script_callback::CallbackData

pub struct CallbackData { /* fields omitted */ }

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.


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>

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]

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 

impl<T> From<T> for T[src]

impl<'lua, T> FromLua<'lua> for T where
    T: 'static + UserData + Clone

impl<'lua, T> FromLuaMulti<'lua> for T where
    T: FromLua<'lua>, 

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<'lua, T> ToLua<'lua> for T where
    T: 'static + UserData + Send

impl<'lua, T> ToLuaMulti<'lua> for T where
    T: ToLua<'lua>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,