DI-Guy Lua AI SDK
 All Classes Files Functions Variables Groups Pages
luaUIStateMachine Class Reference

A class for building interactive UI tools. More...

Inheritance diagram for luaUIStateMachine:
luaLifeFormServer luaMiddleEastUI

Public Member Functions

Standard Infrastructure
 init_package ()
 this function is called at time 0 More...
 
 reset_package ()
 this function is called at reset More...
 
 update_package ()
 
 draw_package ()
 an active draw function, set self.draw_ui to start seeing something More...
 
State Management
 begin_state (_name)
 Convenience function for storing the current state in the object. More...
 
 state_manager (sender, message_type, message, params)
 This is the main entry point from C++ into the lua framework. More...
 
Message Handling
 sleep (duration)
 This is a simple sleep function. More...
 
 wait_for_multichoice (...)
 This is a wait function that will wait indefinately and only wake up when one of a few specific messages are recieved. More...
 
 wait_for_message (message_to_wait_for)
 a function that waits for an explicit message More...
 
UI Functions
 show_ui_message (message)
 Puts a message up on screen with a label. More...
 
 hide_ui_message ()
 
 get_user_selected_point (_options)
 sets up the ui for point selection More...
 
 get_user_selected_character (_options)
 sets up the ui for point selection More...
 

Detailed Description

A class for building interactive UI tools.

TODO: add character selection

Member Function Documentation

luaUIStateMachine::begin_state ( _name  )

Convenience function for storing the current state in the object.

Example:

local state = self:begin_state("character_selection_state");
Parameters
_namename of current state
Returns
The string representation of the just started state. Cache locally to help see when a state began in the locals browser
luaUIStateMachine::draw_package ( )

an active draw function, set self.draw_ui to start seeing something

luaUIStateMachine::get_user_selected_character ( _options  )

sets up the ui for point selection

Takes an options table. Optional parameters are:

Parameters
options["message"]what to place in text label; defaults to "Select character with mouse"
options["pause_scenario"]whether the scenario should be paused during click retrieval; set to true or 1
Returns
character - the character, if any
luaUIStateMachine::get_user_selected_point ( _options  )

sets up the ui for point selection

Returns
x,y,z - the values of the picked point
luaUIStateMachine::hide_ui_message ( )
luaUIStateMachine::init_package ( )

this function is called at time 0

luaUIStateMachine::reset_package ( )

this function is called at reset

luaUIStateMachine::show_ui_message ( message  )

Puts a message up on screen with a label.

luaUIStateMachine::sleep ( duration  )

This is a simple sleep function.

It will put the object to sleep until a message is received or for duration seconds. Frequently messages are mouse events see get_user_selected_point() for how to make a state machine use the user interface.

Parameters
durationif nil object will sleep infinately long, otherwise will automatically wake up, note update_package() is responsible for waking the object
luaUIStateMachine::state_manager ( sender  ,
message_type  ,
message  ,
params   
)

This is the main entry point from C++ into the lua framework.

Whenever the state machine receives a message, this function is called to resume the underlying coroutine microthread.

This function should not be overloaded.

luaUIStateMachine::update_package ( )
luaUIStateMachine::wait_for_message ( message_to_wait_for  )

a function that waits for an explicit message

luaUIStateMachine::wait_for_multichoice (   ...)

This is a wait function that will wait indefinately and only wake up when one of a few specific messages are recieved.


The documentation for this class was generated from the following file: