Ported action button system from Paradise/tg

This commit is contained in:
Zuhayr
2015-05-31 19:03:28 +09:30
parent d4327658ab
commit dadc434f4e
24 changed files with 416 additions and 106 deletions
+4 -5
View File
@@ -21,8 +21,9 @@
var/max_heat_protection_temperature //Set this variable to determine up to which temperature (IN KELVIN) the item protects against heat damage. Keep at null to disable protection. Only protects areas set by heat_protection flags
var/min_cold_protection_temperature //Set this variable to determine down to which temperature (IN KELVIN) the item protects against cold damage. 0 is NOT an acceptable number due to if(varname) tests!! Keep at null to disable protection. Only protects areas set by cold_protection flags
var/icon_action_button //If this is set, The item will make an action button on the player's HUD when picked up. The button will have the icon_action_button sprite from the screen1_action.dmi file.
var/action_button_name //This is the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. Note that icon_action_button needs to be set in order for the action button to appear.
var/datum/action/item_action/action = null
var/action_button_name //It is also the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. If it's not set, there'll be no button.
var/action_button_is_hands_free = 0 //If 1, bypass the restrained, lying, and stunned checks action buttons normally test for
//Since any item can now be a piece of clothing, this has to be put here so all items share it.
var/flags_inv //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
@@ -398,9 +399,7 @@ var/list/global/slot_flags_enumeration = list(
//The default action is attack_self().
//Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob.
/obj/item/proc/ui_action_click()
if( src in usr )
attack_self(usr)
attack_self(usr)
/obj/item/proc/IsShield()
return 0
@@ -10,7 +10,7 @@
matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
icon_action_button = "action_flashlight"
action_button_name = "Toggle Flashlight"
var/on = 0
var/brightness_on = 4 //luminosity when on
@@ -141,7 +141,7 @@
light_color = "#e58775"
icon_state = "flare"
item_state = "flare"
icon_action_button = null //just pull it manually, neckbeard.
action_button_name = null //just pull it manually, neckbeard.
var/fuel = 0
var/on_damage = 7
var/produce_heat = 1500
@@ -11,7 +11,7 @@
var/on = 0.0
var/stabilization_on = 0
var/volume_rate = 500 //Needed for borg jetpack transfer
icon_action_button = "action_jetpack"
action_button_name = "Toggle Jetpack"
/obj/item/weapon/tank/jetpack/New()
..()