Right Slots (#11384)

This commit is contained in:
Geeves
2021-03-14 13:05:27 +01:00
committed by GitHub
parent d66b6a38b4
commit 5c0aacfbbd
12 changed files with 34 additions and 88 deletions
+2 -2
View File
@@ -204,9 +204,9 @@
equip_item(H, suit_store, slot_s_store)
if(l_hand)
H.put_in_l_hand(new l_hand(H))
equip_item(H, l_hand, slot_l_hand)
if(r_hand)
H.put_in_r_hand(new r_hand(H))
equip_item(H, r_hand, slot_r_hand)
if(allow_pda_choice)
switch(H.pda_choice)
@@ -48,10 +48,10 @@
switch(over_object.name)
if("right hand")
user.u_equip(master_item)
user.put_in_r_hand(master_item)
user.equip_to_slot_if_possible(master_item, slot_r_hand)
if("left hand")
user.u_equip(master_item)
user.put_in_l_hand(master_item)
user.equip_to_slot_if_possible(master_item, slot_l_hand)
master_item.add_fingerprint(user)
return 0
return 0
@@ -86,10 +86,10 @@
switch(over_object.name)
if("right hand")
usr.u_equip(src)
usr.put_in_r_hand(src,FALSE)
usr.equip_to_slot_if_possible(src, slot_r_hand)
if("left hand")
usr.u_equip(src)
usr.put_in_l_hand(src,FALSE)
usr.equip_to_slot_if_possible(src, slot_l_hand)
src.add_fingerprint(usr)
/obj/item/storage/proc/return_inv()
@@ -66,11 +66,11 @@
if("right hand")
if(istype(src, /obj/item/clothing/ears))
C = check_two_ears(usr)
usr.put_in_r_hand(C)
usr.equip_to_slot_if_possible(C, slot_r_hand)
if("left hand")
if(istype(src, /obj/item/clothing/ears))
C = check_two_ears(usr)
usr.put_in_l_hand(C)
usr.equip_to_slot_if_possible(C, slot_l_hand)
src.add_fingerprint(usr)
/obj/item/clothing/proc/check_two_ears(var/mob/user)
-12
View File
@@ -146,18 +146,6 @@ var/list/slot_equipment_priority = list( \
return l_hand
return
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(var/obj/item/W)
if(lying || !istype(W))
return 0
return 1
//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_r_hand(var/obj/item/W)
if(lying || !istype(W))
return 0
return 1
//Puts the item into our active hand if possible. returns 1 on success.
/mob/proc/put_in_active_hand(var/obj/item/W)
return 0 // Moved to human procs because only they need to use hands.
@@ -224,10 +224,12 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_l_hand)
src.l_hand = W
W.equipped(src, slot)
W.screen_loc = ui_lhand
update_inv_l_hand(redraw_mob)
if(slot_r_hand)
src.r_hand = W
W.equipped(src, slot)
W.screen_loc = ui_rhand
update_inv_r_hand(redraw_mob)
if(slot_belt)
src.belt = W
@@ -326,6 +328,11 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_r_hand()
W.layer = SCREEN_LAYER+0.01
for(var/s in species.hud.gear)
var/list/gear = species.hud.gear[s]
if(gear["slot"] == slot)
W.screen_loc = gear["loc"]
break
if(W.action_button_name)
update_action_buttons()
@@ -410,46 +417,22 @@ This saves us from having to call add_fingerprint() any time something is put in
//Puts the item into our active hand if possible. returns 1 on success.
/mob/living/carbon/human/put_in_active_hand(var/obj/item/W)
return (hand ? put_in_l_hand(W) : put_in_r_hand(W))
return (hand ? equip_to_slot_if_possible(W, slot_l_hand) : equip_to_slot_if_possible(W, slot_r_hand))
//Puts the item into our inactive hand if possible. returns 1 on success.
/mob/living/carbon/human/put_in_inactive_hand(var/obj/item/W)
return (hand ? put_in_r_hand(W) : put_in_l_hand(W))
return (hand ? equip_to_slot_if_possible(W, slot_r_hand) : equip_to_slot_if_possible(W, slot_l_hand))
/mob/living/carbon/human/put_in_hands(var/obj/item/W)
if(!W)
return 0
return FALSE
if(put_in_active_hand(W))
update_inv_l_hand()
update_inv_r_hand()
return 1
return TRUE
else if(put_in_inactive_hand(W))
update_inv_l_hand()
update_inv_r_hand()
return 1
return TRUE
else
return ..()
/mob/living/carbon/human/put_in_l_hand(var/obj/item/W)
if(!..() || l_hand)
return 0
W.forceMove(src)
l_hand = W
W.equipped(src,slot_l_hand)
W.add_fingerprint(src)
update_inv_l_hand()
return 1
/mob/living/carbon/human/put_in_r_hand(var/obj/item/W)
if(!..() || r_hand)
return 0
W.forceMove(src)
r_hand = W
W.equipped(src,slot_r_hand)
W.add_fingerprint(src)
update_inv_r_hand()
return 1
/mob/living/carbon/human/proc/update_noise_level()
is_noisy = FALSE
if (lying || !shoes || !istype(shoes, /obj/item/clothing/shoes))
@@ -535,8 +535,6 @@ There are several things that need to be remembered:
overlays_raw[UNIFORM_LAYER] = null
if(check_draw_underclothing())
w_uniform.screen_loc = ui_iclothing
//determine the icon to use
var/icon/under_icon
var/under_state = ""
@@ -604,7 +602,6 @@ There are several things that need to be remembered:
overlays_raw[ID_LAYER_ALT] = null
if(wear_id)
var/image/result_layer
wear_id.screen_loc = ui_id //TODO
if(w_uniform)
if(!w_uniform:displays_id)
return
@@ -678,7 +675,6 @@ There are several things that need to be remembered:
bloodsies.color = gloves.blood_color
result_layer = list(result_layer, bloodsies)
gloves.screen_loc = ui_gloves
overlays_raw[GLOVES_LAYER] = result_layer
else if(blood_DNA)
var/image/bloodsies = image(species.blood_mask, "bloodyhands")
@@ -726,8 +722,6 @@ There are several things that need to be remembered:
if(check_draw_ears())
if(l_ear)
l_ear.screen_loc = ui_l_ear
var/image/result_layer = null
//Determine the icon to use
@@ -771,8 +765,6 @@ There are several things that need to be remembered:
if(check_draw_ears())
if(r_ear)
r_ear.screen_loc = ui_r_ear
var/image/result_layer = null
//Determine the icon to use
@@ -815,8 +807,6 @@ There are several things that need to be remembered:
return
if(check_draw_shoes())
shoes.screen_loc = ui_shoes
var/image/result_layer = null
//Determine the icon to use
@@ -890,13 +880,11 @@ There are several things that need to be remembered:
var/image/s_store_image = image(s_store.icon_override || s_store.icon, state)
s_store_image.appearance_flags = RESET_ALPHA
overlays_raw[SUIT_STORE_LAYER] = s_store_image
s_store.screen_loc = ui_sstore1
else
//s_store.auto_adapt_species(src)
var/image/s_store_image = image('icons/mob/belt_mirror.dmi', s_store.item_state || s_store.icon_state)
s_store_image.appearance_flags = RESET_ALPHA
overlays_raw[SUIT_STORE_LAYER] = s_store_image
s_store.screen_loc = ui_sstore1 //TODO
else
overlays_raw[SUIT_STORE_LAYER] = null
if(update_icons)
@@ -908,7 +896,6 @@ There are several things that need to be remembered:
overlays_raw[HEAD_LAYER] = null
if(head)
head.screen_loc = ui_head //TODO
var/image/standing = null
//Determine the icon to use
var/t_icon = INV_HEAD_DEF_ICON
@@ -967,8 +954,6 @@ There are several things that need to be remembered:
return
if(belt)
belt.screen_loc = ui_belt
var/image/result_layer = null
//Determine the icon to use
@@ -1032,8 +1017,6 @@ There are several things that need to be remembered:
return
if(wear_suit)
wear_suit.screen_loc = ui_oclothing
var/image/result_layer = null
//Determine the icon to use
@@ -1099,11 +1082,6 @@ There are several things that need to be remembered:
if (QDELING(src))
return
if(l_store)
l_store.screen_loc = ui_storage1 //TODO
if(r_store)
r_store.screen_loc = ui_storage2 //TODO
if(update_icons)
update_icon()
@@ -1114,7 +1092,6 @@ There are several things that need to be remembered:
overlays_raw[FACEMASK_LAYER] = null
if(check_draw_mask())
wear_mask.screen_loc = ui_mask //TODO
var/image/standing
if(wear_mask.contained_sprite)
@@ -1158,8 +1135,6 @@ There are several things that need to be remembered:
overlays_raw[BACK_LAYER] = null
if(back)
back.screen_loc = ui_back //TODO
//determine the icon to use
var/icon/overlay_icon
var/overlay_state = ""
@@ -1276,8 +1251,6 @@ There are several things that need to be remembered:
overlays_raw[L_HAND_LAYER] = null
if(l_hand)
l_hand.screen_loc = ui_lhand //TODO
//determine icon state to use
var/t_state = l_hand.item_state || l_hand.icon_state
@@ -1328,8 +1301,6 @@ There are several things that need to be remembered:
overlays_raw[R_HAND_LAYER] = null
if(r_hand)
r_hand.screen_loc = ui_rhand //TODO
//determine icon state to use
var/t_state = r_hand.item_state || r_hand.icon_state
@@ -1380,8 +1351,6 @@ There are several things that need to be remembered:
overlays_raw[WRISTS_LAYER] = null
if(check_draw_wrists())
wrists.screen_loc = ui_lhand //TODO
//determine icon state to use
var/t_state = wrists.item_state || wrists.icon_state
@@ -48,8 +48,8 @@
switch(over_object.name)
if("right hand")
usr.u_equip(src)
usr.put_in_r_hand(src)
usr.equip_to_slot_if_possible(src, slot_r_hand)
if("left hand")
usr.u_equip(src)
usr.put_in_l_hand(src)
usr.equip_to_slot_if_possible(src, slot_l_hand)
add_fingerprint(usr)
+2 -2
View File
@@ -29,10 +29,10 @@
switch(over_object.name)
if("right hand")
M.u_equip(src)
M.put_in_r_hand(src)
M.equip_to_slot_if_possible(src, slot_r_hand)
if("left hand")
M.u_equip(src)
M.put_in_l_hand(src)
M.equip_to_slot_if_possible(src, slot_l_hand)
add_fingerprint(usr)
return
+2 -2
View File
@@ -442,10 +442,10 @@
var/mob/living/carbon/human/h_user = user
if (h_user.r_hand == src)
h_user.drop_from_inventory(src)
h_user.put_in_r_hand(B)
h_user.equip_to_slot_if_possible(B, slot_r_hand)
else if (h_user.l_hand == src)
h_user.drop_from_inventory(src)
h_user.put_in_l_hand(B)
h_user.equip_to_slot_if_possible(B, slot_l_hand)
else if (h_user.l_store == src)
h_user.drop_from_inventory(src)
B.forceMove(h_user)
+2 -2
View File
@@ -105,10 +105,10 @@ var/global/photo_count = 0
switch(over_object.name)
if("right hand")
M.u_equip(src)
M.put_in_r_hand(src)
M.equip_to_slot_if_possible(src, slot_r_hand)
if("left hand")
M.u_equip(src)
M.put_in_l_hand(src)
M.equip_to_slot_if_possible(src, slot_l_hand)
add_fingerprint(usr)
return
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+6
View File
@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- bugfix: "Equipping items will now put them into the correct slot position, depending on which HUD your species has."