pAI Software
Datum module for pAI software
Very similar to the PDA app datum, this determines what UI sub-template to use, as well as the RAM cost, and if it is toggle software (not a UI app)
Vars | |
default | Do we have this software installed by default |
---|---|
id | ID for the software. This must be unique |
name | Name for the software. This is used as the button text when buying or opening/toggling the software |
pai_holder | pAI which holds this software |
ram_cost | RAM cost; pAIs start with 100 RAM, spending it on programs |
template_file | Template for the TGUI file |
toggle_software | Whether this software is a toggle or not |
ui_icon | Icon for inside the UI |
Procs | |
New | New handler |
get_app_data | Handler for the app's UI data |
get_holding_mob | Helper proc so that pAIs can get the mob holding them |
is_active | Helper for checking if a toggle is enabled or not |
toggle | Handler for toggling toggle apps on and off |
ui_act | ui_act sanity check helper |
Var Details
default
Do we have this software installed by default
id
ID for the software. This must be unique
name
Name for the software. This is used as the button text when buying or opening/toggling the software
pai_holder
pAI which holds this software
ram_cost
RAM cost; pAIs start with 100 RAM, spending it on programs
template_file
Template for the TGUI file
toggle_software
Whether this software is a toggle or not
ui_icon
Icon for inside the UI
Proc Details
New
New handler
Ensures that the pai_holder var is set to the pAI itself Arguments:
- user - The pAI that this softawre is held by
get_app_data
Handler for the app's UI data
This returns the list of the current app's data for the UI This will then be injected as a variable on the TGUI data called "app_data"
Arguments:
- user - The pAI that is using this app
get_holding_mob
Helper proc so that pAIs can get the mob holding them
This needs to exist because pAIs have many different locs (Held card, mob itself, in pocket, etc)
Arguments:
- inform - Boolean, should we inform the pAI if they fail to find a carrier
is_active
Helper for checking if a toggle is enabled or not
Returns TRUE if the toggle software is active, FALSE if not
Its like this instead of a simple is_toggled
var because some toggles override eachother and this is easier
Arguments:
- user - The pAI that is using this app
toggle
Handler for toggling toggle apps on and off
This is invoked whenever you toggle a toggleable function Put your toggleable work in here
Arguments:
- user - The pAI that is using this toggle
ui_act
ui_act sanity check helper
Basically checks the existing href exploit stuff, as well as making sure the user using the UI is the pAI itself