Rebindable Hotkeys (#12138)
* demodularize interface * keybindings * binds * prefs * loose ends * globals * changes * s * datum ref lists * ok * fixes * fixes * fix * ok * sigh * sigh * indicators * let's play the move code around game * let's play the i didn't comma my lists game * let's play the indent game * let's play hte spelling bee * let's fail the spelling bee * LET'S PLAY THe HOW HARd IS IT TO SPELL A PROC GAME * let's play the bugfix game * bugfixes * improvements * Update bindings_client.dm * pixel shift * A * wups
This commit is contained in:
@@ -277,3 +277,65 @@
|
||||
qdel(slot)
|
||||
for(var/obj/item/I in held_items)
|
||||
qdel(I)
|
||||
|
||||
/mob/living/carbon/human/proc/smart_equipbag() // take most recent item out of bag or place held item in bag
|
||||
if(incapacitated())
|
||||
return
|
||||
var/obj/item/thing = get_active_held_item()
|
||||
var/obj/item/equipped_back = get_item_by_slot(SLOT_BACK)
|
||||
if(!equipped_back) // We also let you equip a backpack like this
|
||||
if(!thing)
|
||||
to_chat(src, "<span class='warning'>You have no backpack to take something out of!</span>")
|
||||
return
|
||||
if(equip_to_slot_if_possible(thing, ITEM_SLOT_BACK))
|
||||
update_inv_hands()
|
||||
return
|
||||
if(!SEND_SIGNAL(equipped_back, COMSIG_CONTAINS_STORAGE)) // not a storage item
|
||||
if(!thing)
|
||||
equipped_back.attack_hand(src)
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You can't fit anything in!</span>")
|
||||
return
|
||||
if(thing) // put thing in backpack
|
||||
if(!SEND_SIGNAL(equipped_back, COMSIG_TRY_STORAGE_INSERT, thing, src))
|
||||
to_chat(src, "<span class='warning'>You can't fit anything in!</span>")
|
||||
return
|
||||
if(!equipped_back.contents.len) // nothing to take out
|
||||
to_chat(src, "<span class='warning'>There's nothing in your backpack to take out!</span>")
|
||||
return
|
||||
var/obj/item/stored = equipped_back.contents[equipped_back.contents.len]
|
||||
if(!stored || stored.on_found(src))
|
||||
return
|
||||
stored.attack_hand(src) // take out thing from backpack
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/smart_equipbelt() // put held thing in belt or take most recent item out of belt
|
||||
if(incapacitated())
|
||||
return
|
||||
var/obj/item/thing = get_active_held_item()
|
||||
var/obj/item/equipped_belt = get_item_by_slot(SLOT_BELT)
|
||||
if(!equipped_belt) // We also let you equip a belt like this
|
||||
if(!thing)
|
||||
to_chat(src, "<span class='warning'>You have no belt to take something out of!</span>")
|
||||
return
|
||||
if(equip_to_slot_if_possible(thing, ITEM_SLOT_BELT))
|
||||
update_inv_hands()
|
||||
return
|
||||
if(!SEND_SIGNAL(equipped_belt, COMSIG_CONTAINS_STORAGE)) // not a storage item
|
||||
if(!thing)
|
||||
equipped_belt.attack_hand(src)
|
||||
else
|
||||
to_chat(src, "<span class='warning'>You can't fit anything in!</span>")
|
||||
return
|
||||
if(thing) // put thing in belt
|
||||
if(!SEND_SIGNAL(equipped_belt, COMSIG_TRY_STORAGE_INSERT, thing, src))
|
||||
to_chat(src, "<span class='warning'>You can't fit anything in!</span>")
|
||||
return
|
||||
if(!equipped_belt.contents.len) // nothing to take out
|
||||
to_chat(src, "<span class='warning'>There's nothing in your belt to take out!</span>")
|
||||
return
|
||||
var/obj/item/stored = equipped_belt.contents[equipped_belt.contents.len]
|
||||
if(!stored || stored.on_found(src))
|
||||
return
|
||||
stored.attack_hand(src) // take out thing from belt
|
||||
return
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
|
||||
vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace.
|
||||
|
||||
/// What receives our keyboard input. src by default.
|
||||
var/datum/focus
|
||||
|
||||
var/lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
|
||||
var/datum/mind/mind
|
||||
var/list/datum/action/actions = list()
|
||||
|
||||
@@ -57,6 +57,12 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/proc/whisper_keybind()
|
||||
var/message = input(src, "", "whisper") as text|null
|
||||
if(!length(message))
|
||||
return
|
||||
return whisper_verb(message)
|
||||
|
||||
/mob/verb/whisper_verb(message as text)
|
||||
set name = "Whisper"
|
||||
set category = "IC"
|
||||
|
||||
@@ -129,6 +129,12 @@ proc/get_top_level_mob(var/mob/S)
|
||||
user.visible_message(message=message,self_message=message,vision_distance=1, ignored_mobs = GLOB.dead_mob_list)
|
||||
|
||||
///////////////// VERB CODE
|
||||
/mob/living/proc/subtle_keybind()
|
||||
var/message = input(src, "", "subtle") as text|null
|
||||
if(!length(message))
|
||||
return
|
||||
return subtle(message)
|
||||
|
||||
/mob/living/verb/subtle()
|
||||
set name = "Subtle"
|
||||
set category = "IC"
|
||||
|
||||
Reference in New Issue
Block a user