program
Vars | |
alert_able | Whether this program can send alerts while minimized or closed. Used to show a mute button per program in the file manager |
---|---|
alert_pending | Whether to highlight our program in the main screen. Intended for alerts, but loosely available for any need to notify of changed conditions. Think Windows task bar highlighting. Available even if alerts are muted. |
alert_silenced | Whether the user has muted this program's ability to send alerts. |
can_run_on_flags | Program-specific bitflags that tell the app what it runs on. (PROGRAM_ALL | PROGRAM_CONSOLE | PROGRAM_LAPTOP | PROGRAM_PDA) |
circuit_comp_type | Unremovable circuit componentn added to the physical computer while the program is installed |
detomatix_resistance | How well this program will help combat detomatix viruses. |
download_access | List of required access to download or file host the program. Any match will do. |
downloader_category | What category this program can be found in within NTNetDownloader. This is required if PROGRAM_ON_NTNET_STORE or PROGRAM_ON_SYNDINET_STORE is on. |
extended_desc | Short description of this program's function. |
filedesc | User-friendly name of this program. |
filename | File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET! |
ntnet_status | NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc. |
power_cell_use | How much power running this program costs. |
program_flags | Program-specific bitflags that tells the ModPC what the app is able to do special. (PROGRAM_REQUIRES_NTNET|PROGRAM_ON_NTNET_STORE|PROGRAM_ON_SYNDINET_STORE|PROGRAM_UNIQUE_COPY|PROGRAM_HEADER|PROGRAM_RUNS_WITHOUT_POWER) |
program_icon | Font Awesome icon to use as this program's icon in the modular computer main menu. Defaults to a basic program maximize window icon if not overridden. |
program_open_overlay | The overlay to add ontop of the ModPC running the app while it's open. This is taken from the same file as the ModPC, so you can use can_run_on_flags to prevent the program from being used on devices that don't have sprites for it. |
run_access | List of required accesses to run the program. Any match will do. This also acts as download_access if that is not set, making this more draconic and restrictive. |
tgui_id | Name of the tgui interface. If this is not defined, this will not be available in NTNet. |
ui_header | Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images must also be inserted into /datum/asset/simple/headers. |
Procs | |
Destroy | Here we deal with killing the associated components instead. |
background_program | Sends the running program to the background/idle threads. Header programs can't be minimized and will kill instead. |
can_run | Checks if the user can run program. Only humans and silicons can operate computer. Automatically called in on_start() ID must be inserted into a card slot to be read. If the program is not currently installed (as is the case when NT Software Hub is checking available software), a list can be given to be used instead. Args: user is a ref of the mob using the device. loud is a bool deciding if this proc should use to_chats access_to_check is an access level that will be checked against the ID downloading: Boolean on whether it's downloading the app or not. If it is, it will check download_access instead of run_access. access can contain a list of access numbers to check against. If access is not empty, it will be used istead of checking any inserted ID. |
event_networkfailure | Called when a computer program is crashing due to any required connection being shut off. Arguments: |
event_powerfailure | Called when a computer program is shut down from the tablet's charge dying Arguments: |
generate_network_log | Attempts to generate an Ntnet log, returns the log on success, FALSE otherwise. |
is_supported_by_hardware | Makes sure a program can run on this hardware (for apps limited to tablets/computers/laptops) |
kill_program | Kills the running program |
on_install | Here we deal with peculiarity of adding unremovable components to the computer shell. It probably doesn't look badass, but it's a decent way of doing it without taining the component with oddities like this. |
on_start | Called on program startup. |
tap | Runs when the device is used to attack an atom in non-combat mode using right click (secondary). |
ui_interact | WARNING: this proc does not work the same as normal ui_interact , as the
computer takes care of opening the UI. The datum/tgui/ui parameter will always exist.
This proc only serves as a callback. |
Var Details
alert_able
Whether this program can send alerts while minimized or closed. Used to show a mute button per program in the file manager
alert_pending
Whether to highlight our program in the main screen. Intended for alerts, but loosely available for any need to notify of changed conditions. Think Windows task bar highlighting. Available even if alerts are muted.
alert_silenced
Whether the user has muted this program's ability to send alerts.
can_run_on_flags
Program-specific bitflags that tell the app what it runs on. (PROGRAM_ALL | PROGRAM_CONSOLE | PROGRAM_LAPTOP | PROGRAM_PDA)
circuit_comp_type
Unremovable circuit componentn added to the physical computer while the program is installed
detomatix_resistance
How well this program will help combat detomatix viruses.
download_access
List of required access to download or file host the program. Any match will do.
downloader_category
What category this program can be found in within NTNetDownloader. This is required if PROGRAM_ON_NTNET_STORE or PROGRAM_ON_SYNDINET_STORE is on.
extended_desc
Short description of this program's function.
filedesc
User-friendly name of this program.
filename
File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET!
ntnet_status
NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc.
power_cell_use
How much power running this program costs.
program_flags
Program-specific bitflags that tells the ModPC what the app is able to do special. (PROGRAM_REQUIRES_NTNET|PROGRAM_ON_NTNET_STORE|PROGRAM_ON_SYNDINET_STORE|PROGRAM_UNIQUE_COPY|PROGRAM_HEADER|PROGRAM_RUNS_WITHOUT_POWER)
program_icon
Font Awesome icon to use as this program's icon in the modular computer main menu. Defaults to a basic program maximize window icon if not overridden.
program_open_overlay
The overlay to add ontop of the ModPC running the app while it's open. This is taken from the same file as the ModPC, so you can use can_run_on_flags to prevent the program from being used on devices that don't have sprites for it.
run_access
List of required accesses to run the program. Any match will do. This also acts as download_access if that is not set, making this more draconic and restrictive.
tgui_id
Name of the tgui interface. If this is not defined, this will not be available in NTNet.
ui_header
Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images must also be inserted into /datum/asset/simple/headers.
Proc Details
Destroy
Here we deal with killing the associated components instead.
background_program
Sends the running program to the background/idle threads. Header programs can't be minimized and will kill instead.
can_run
Checks if the user can run program. Only humans and silicons can operate computer. Automatically called in on_start() ID must be inserted into a card slot to be read. If the program is not currently installed (as is the case when NT Software Hub is checking available software), a list can be given to be used instead. Args: user is a ref of the mob using the device. loud is a bool deciding if this proc should use to_chats access_to_check is an access level that will be checked against the ID downloading: Boolean on whether it's downloading the app or not. If it is, it will check download_access instead of run_access. access can contain a list of access numbers to check against. If access is not empty, it will be used istead of checking any inserted ID.
event_networkfailure
Called when a computer program is crashing due to any required connection being shut off. Arguments:
- background - Whether the app is running in the background.
event_powerfailure
Called when a computer program is shut down from the tablet's charge dying Arguments:
- background - Whether the app is running in the background.
generate_network_log
Attempts to generate an Ntnet log, returns the log on success, FALSE otherwise.
is_supported_by_hardware
Makes sure a program can run on this hardware (for apps limited to tablets/computers/laptops)
kill_program
Kills the running program
Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client. Args:
- user - If there's a user, this is the person killing the program.
on_install
Here we deal with peculiarity of adding unremovable components to the computer shell. It probably doesn't look badass, but it's a decent way of doing it without taining the component with oddities like this.
on_start
Called on program startup.
May be overridden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure. When implementing new program based device, use this to run the program. Arguments:
- user - The mob that started the program
tap
Runs when the device is used to attack an atom in non-combat mode using right click (secondary).
Simulates using the device to read or scan something. Tap is called by the computer during pre_attack and sends us all of the related info. If we return TRUE, the computer will stop the attack process there. What we do with the info is up to us, but we should only return TRUE if we actually perform an action of some sort. Arguments: A is the atom being tapped user is the person making the attack action params is anything the pre_attack() proc had in the same-named variable.
ui_interact
WARNING: this proc does not work the same as normal ui_interact
, as the
computer takes care of opening the UI. The datum/tgui/ui
parameter will always exist.
This proc only serves as a callback.