Resolves issue 594 - You can no longer use Mech-drills/clamps/etc to interact with your hud items.

Fixed an old feature that diverted clicks on a hud inventory-slot (say, the place you put your bag) to the object in that slot (i.e. making it easier to click small items and also making it possible to remove things that have borked and turned invisible

Fixed admins being able to change their own rank via chgadlvl.

Insignificant tweaks to DblClick() just removed some useless bits near the top.

Known issues:
Can't put straight jackets on aliums anymore for some reason
Aliums can remove straight jackets from themselves.
Can still mecha-drill a few things you shouldn't be able to >_>

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4032 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-07-11 07:48:14 +00:00
parent ff2ac76177
commit f92bec2a22
10 changed files with 134 additions and 230 deletions

View File

@@ -347,19 +347,17 @@
/atom/Click(location,control,params)
//world << "atom.Click() on [src] by [usr] : src.type is [src.type]"
if(usr.client.buildmode)
build_click(usr, usr.client.buildmode, location, control, params, src)
return
if(using_new_click_proc) //TODO ERRORAGE (see message below)
return DblClickNew()
// if(using_new_click_proc) //TODO ERRORAGE (see message below)
// return DblClickNew()
return DblClick(location, control, params)
var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblClickNew() proc is being tested)
/atom/proc/DblClickNew()
if(!usr) return
// TODO DOOHL: Intergrate params to new proc. Saved for another time because var/valid_place is a fucking brainfuck
//Spamclick server-overloading prevention delay... THING
@@ -649,8 +647,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
attack_animal(animal)
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
// world << "checking if this shit gets called at all"
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1)
@@ -660,51 +657,49 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
// world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]"
usr:lastDblClick = world.time
// ------- DIR CHANGING WHEN CLICKING (changes facting direction) ------
//Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
if( usr && iscarbon(usr) && !usr.buckled )
// ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x
var/dy = src.y - usr.y
if( dy > 0 && abs(dx) < dy ) //North
usr.dir = 1
if( dy < 0 && abs(dx) < abs(dy) ) //South
usr.dir = 2
if( dx > 0 && abs(dy) <= dx ) //East
usr.dir = 4
if( dx < 0 && abs(dy) <= abs(dx) ) //West
usr.dir = 8
if( dx == 0 && dy == 0 )
if(src.pixel_y > 16)
usr.dir = 1
if(src.pixel_y < -16)
usr.dir = 2
if(src.pixel_x > 16)
usr.dir = 4
if(src.pixel_x < -16)
usr.dir = 8
if(dy || dx)
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST
else
if(pixel_y > 16) usr.dir = NORTH
else if(pixel_y < -16) usr.dir = SOUTH
else if(pixel_x > 16) usr.dir = EAST
else if(pixel_x < -16) usr.dir = WEST
// ------- AI -------
if (istype(usr, /mob/living/silicon/ai))
else if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled)
return
// ------- CYBORG -------
if (istype (usr, /mob/living/silicon/robot))
else if (istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return
..()
// ------- SHIFT-CLICK -------
if(params)
@@ -752,17 +747,16 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
// ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active))
W = usr:module_active
else
W = null
*/
// ------- ATTACK SELF -------
if (W == src && usr.stat == 0)
// spawn (0) //would cause a runtime if W was deconstructed during a lagspike
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand() //update in-hand overlays
@@ -784,19 +778,15 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
return
// ------- 1 TILE AWAY -------
var/t5 = in_range(src, usr) || src.loc == usr
var/t5
// ------- AI CAN CLICK ANYTHING -------
if(istype(usr, /mob/living/silicon/ai))
t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
if ((istype(usr, /mob/living/silicon/robot)) && W == null)
else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1
// ------- CLICKING ON ORGANS -------
if (istype(src, /datum/organ) && src in usr.contents)
return
else
t5 = in_range(src, usr) || src.loc == usr
// world << "according to dblclick(), t5 is [t5]"

View File

@@ -82,12 +82,12 @@
return 0
if(!chassis)
return 0
if(energy_drain && !chassis.has_charge(energy_drain))
return 0
if(!equip_ready)
return 0
if(crit_fail)
return 0
if(energy_drain && !chassis.has_charge(energy_drain))
return 0
return 1
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)

View File

@@ -73,6 +73,9 @@
action(atom/target)
if(!action_checks(target)) return
if(isobj(target))
var/obj/target_obj = target
if(target_obj.unacidable) return
set_ready_state(0)
chassis.use_power(energy_drain)
chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.")
@@ -127,6 +130,9 @@
action(atom/target)
if(!action_checks(target)) return
if(isobj(target))
var/obj/target_obj = target
if(target_obj.unacidable) return
set_ready_state(0)
chassis.use_power(energy_drain)
chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.")

View File

@@ -195,14 +195,14 @@
////////////////////////////
///// Action processing ////
////////////////////////////
/client/Click(object,location,control,params)
/*
/atom/DblClick(object,location,control,params)
var/mob/M = src.mob
if(M && M.in_contents_of(/obj/mecha))
/*
if(mech_click == world.time) return
mech_click = world.time
*/
if(!istype(object, /atom)) return
if(istype(object, /obj/screen))
var/obj/screen/using = object
@@ -214,8 +214,9 @@
spawn() //this helps prevent clickspam fest.
if (Mech)
Mech.click_action(object,M)
else
return ..()
// else
// return ..()
*/
/obj/mecha/proc/click_action(atom/target,mob/user)
if(!src.occupant || src.occupant != user ) return

View File

@@ -4,14 +4,6 @@
icon = 'alien.dmi'
// unacidable = 1 //Aliens won't ment their own.
/obj/effect/alien/head
name = "severed head"
desc = "a severed head..."
icon_state = "weeds"
density = 0
anchored = 0
/obj/effect/alien/resin
name = "resin"
desc = "Looks like some kind of slimy growth."

View File

@@ -1417,6 +1417,7 @@ var/global/BSACooldown = 0
//change admin level
var/rank = href_list["chgadlvl"]
var/client/C = locate(href_list["client4ad"])
if(!istype(C)) return
if(rank == "Remove")
C.clear_admin_verbs()
C.update_admins(null)
@@ -1424,6 +1425,9 @@ var/global/BSACooldown = 0
message_admins("[key_name_admin(usr)] has removed [C]'s adminship", 1)
admins.Remove(C.ckey)
else
if(C == owner) //no promoting/demoting yourself
message_admins("[C] tried to change their own admin-rank >:(")
return
C.clear_admin_verbs()
C.update_admins(rank)
log_admin("[key_name(usr)] has made [C] a [rank]")

View File

@@ -66,7 +66,7 @@
/mob/proc/drop_item_v() //this is dumb.
if(stat == CONSCIOUS)
if(stat == CONSCIOUS && isturf(loc))
return drop_item()
return 0

View File

@@ -21,60 +21,34 @@
/mob/living/carbon/alien/humanoid/db_click(text, t1)
var/obj/item/W = get_active_hand()
var/emptyHand = (W == null)
if ((!emptyHand) && (!istype(W, /obj/item)))
if(W && !istype(W))
return
if (emptyHand)
usr.next_move = usr.prev_move
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
switch(text)
//if emptyhand then wear the suit, no bedsheet clothes for the alien
if("o_clothing")
if(wear_suit)
if (emptyHand)
wear_suit.DblClick()
// else
// update_inv_wear_suit()
if(!W) wear_suit.attack_alien(src)
return
/* if (!( istype(W, /obj/item/clothing/suit) ))
return
u_equip(W)
wear_suit = W
W.get_active_hand(src, text)
*/
if("head")
if(head)
if (emptyHand)
head.DblClick()
else if (( istype(W, /obj/effect/alien/head) )) //TODO: figure out wtf this is about ~Carn
u_equip(W)
head = W
update_inv_head()
if(!W) head.attack_alien(src)
return
/* if (!( istype(W, /obj/item/clothing/head) ))
return
u_equip(W)
head = W
W.get_active_hand(src, text)
*/
if("storage1")
if(l_store)
if (emptyHand)
l_store.DblClick()
if(!W) l_store.attack_alien(src)
return
if ((!( istype(W, /obj/item) ) || W.w_class > 3))
if(W.w_class > 3)
return
u_equip(W)
l_store = W
update_inv_pockets()
if("storage2")
if(r_store)
if (emptyHand)
r_store.DblClick()
if(!W) r_store.attack_alien(src)
return
if ((!( istype(W, /obj/item) ) || W.w_class > 3))
if(W.w_class > 3)
return
u_equip(W)
r_store = W

View File

@@ -1013,65 +1013,41 @@ It can still be worn/put on as normal.
/mob/living/carbon/human/db_click(text, t1)
var/obj/item/W = get_active_hand()
var/emptyHand = (W == null)
if(emptyHand)
usr.next_move = usr.prev_move
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
else
if( !istype(W, /obj/item) ) return
if(W && !istype(W)) return
switch(text)
if("mask")
if(wear_mask)
if(emptyHand)
wear_mask.DblClick()
return
if (!istype(W, /obj/item))
if(!W) wear_mask.attack_hand(src)
return
if( !(W.slot_flags & SLOT_MASK) )
return
u_equip(W)
wear_mask = W
if(wear_mask && (wear_mask.flags & BLOCKHAIR))
if(wear_mask.flags & BLOCKHAIR)
update_hair(0) //rebuild hair
W.equipped(src, text)
update_inv_wear_mask()
if("back")
if(back)
if (emptyHand)
back.DblClick()
return
if (!istype(W, /obj/item))
if(!W) back.attack_hand(src)
return
if( !(W.slot_flags & SLOT_BACK) )
return
if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
if(istype(W,/obj/item/weapon/twohanded) && W:wielded) //TODO
usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>"
return
u_equip(W)
back = W
W.equipped(src, text)
update_inv_back()
/* if("headset")
if (ears)
if (emptyHand)
ears.DblClick()
return
if (!( istype(W, /obj/item/device/radio/headset) ))
return
u_equip(W)
w_radio = W
W.equipped(src, text) */
if("o_clothing")
if(wear_suit)
if (emptyHand)
wear_suit.DblClick()
return
if (!istype(W, /obj/item))
if(!W) wear_suit.attack_hand(src)
return
if( !(W.slot_flags & SLOT_OCLOTHING) )
return
if ((FAT in src.mutations) && !(W.flags & ONESIZEFITSALL))
if( !(W.flags & ONESIZEFITSALL) && (FAT in mutations) )
src << "\red You're too fat to wear the [W.name]!"
return
u_equip(W)
@@ -1080,10 +1056,7 @@ It can still be worn/put on as normal.
update_inv_wear_suit()
if("gloves")
if(gloves)
if (emptyHand)
gloves.DblClick()
return
if (!istype(W, /obj/item))
if(!W) gloves.attack_hand(src)
return
if( !(W.slot_flags & SLOT_GLOVES) )
return
@@ -1093,10 +1066,7 @@ It can still be worn/put on as normal.
update_inv_gloves()
if("shoes")
if(shoes)
if (emptyHand)
shoes.DblClick()
return
if (!istype(W, /obj/item))
if(!W) shoes.attack_hand(src)
return
if( !( W.slot_flags & SLOT_FEET) )
return
@@ -1106,13 +1076,10 @@ It can still be worn/put on as normal.
update_inv_shoes()
if("belt")
if(belt)
if (emptyHand)
belt.DblClick()
if(!W) belt.attack_hand(src)
return
if(!w_uniform)
return
if (!istype(W, /obj/item))
return
if( !(W.slot_flags & SLOT_BELT) )
return
u_equip(W)
@@ -1121,10 +1088,7 @@ It can still be worn/put on as normal.
update_inv_belt()
if("eyes")
if(glasses)
if (emptyHand)
glasses.DblClick()
return
if (!istype(W, /obj/item))
if(!W) glasses.attack_hand(src)
return
if( !(W.slot_flags & SLOT_EYES) )
return
@@ -1134,28 +1098,21 @@ It can still be worn/put on as normal.
update_inv_glasses()
if("head")
if(head)
if (emptyHand)
head.DblClick()
return
if (!istype(W, /obj/item))
if(!W) head.attack_hand(src)
return
if( !(W.slot_flags & SLOT_HEAD) )
return
u_equip(W)
head = W
if(head.flags & BLOCKHAIR)
//rebuild hair
update_hair(0)
update_hair(0) //rebuild hair
if(istype(W,/obj/item/clothing/head/kitty))
W.update_icon(src)
W.equipped(src, text)
update_inv_head()
if("ears")
if(ears)
if (emptyHand)
ears.DblClick()
return
if (!istype(W, /obj/item))
if(!W) ears.attack_hand(src)
return
if( !(W.slot_flags & SLOT_EARS) )
return
@@ -1165,14 +1122,11 @@ It can still be worn/put on as normal.
update_inv_ears()
if("i_clothing")
if(w_uniform)
if (emptyHand)
w_uniform.DblClick()
return
if (!istype(W, /obj/item))
if(!W) w_uniform.attack_hand(src)
return
if( !(W.slot_flags & SLOT_ICLOTHING) )
return
if ((FAT in src.mutations) && !(W.flags & ONESIZEFITSALL))
if( !(W.flags & ONESIZEFITSALL) && (FAT in src.mutations) )
src << "\red You're too fat to wear the [W.name]!"
return
u_equip(W)
@@ -1181,13 +1135,10 @@ It can still be worn/put on as normal.
update_inv_w_uniform()
if("id")
if(wear_id)
if (emptyHand)
wear_id.DblClick()
if(!W) wear_id.attack_hand(src)
return
if(!w_uniform)
return
if (!istype(W, /obj/item))
return
if( !(W.slot_flags & SLOT_ID) )
return
u_equip(W)
@@ -1196,14 +1147,11 @@ It can still be worn/put on as normal.
update_inv_wear_id()
if("storage1")
if(l_store)
if (emptyHand)
l_store.DblClick()
if(!W) l_store.attack_hand(src)
return
if(!w_uniform)
return
if (!istype(W, /obj/item))
return
if ( ( W.slot_flags & SLOT_DENYPOCKET ) )
if(W.slot_flags & SLOT_DENYPOCKET)
return
if( W.w_class <= 2 || (W.slot_flags & SLOT_POCKET) )
u_equip(W)
@@ -1211,14 +1159,11 @@ It can still be worn/put on as normal.
update_inv_pockets()
if("storage2")
if(r_store)
if (emptyHand)
r_store.DblClick()
if(!W) r_store.attack_hand(src)
return
if(!w_uniform)
return
if (!istype(W, /obj/item))
return
if ( ( W.slot_flags & SLOT_DENYPOCKET ) )
if(W.slot_flags & SLOT_DENYPOCKET)
return
if( W.w_class <= 2 || (W.slot_flags & SLOT_POCKET) )
u_equip(W)
@@ -1226,20 +1171,14 @@ It can still be worn/put on as normal.
update_inv_pockets()
if("suit storage")
if(s_store)
if (emptyHand)
s_store.DblClick()
if(!W) s_store.attack_hand(src)
return
if(!wear_suit)
return
var/confirm
if (wear_suit)
if(!wear_suit.allowed)
usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
return
if (istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen))
confirm = 1
if (is_type_in_list(W, wear_suit.allowed))
confirm = 1
if (!confirm) return
else
if( istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen) || is_type_in_list(W, wear_suit.allowed) )
u_equip(W)
s_store = W
update_inv_s_store()

View File

@@ -108,7 +108,8 @@
//Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn
/mob/proc/db_click(text, t1)
var/obj/item/weapon/W = get_active_hand()
var/obj/item/W = get_active_hand()
if(W && !istype(W)) return
switch(text)
if("mask")
if(wear_mask)
@@ -122,18 +123,15 @@
if("back")
if(back)
return
if (!istype(W, /obj/item))
return
if( !(W.slot_flags & SLOT_BACK) )
return
if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
if( istype(W,/obj/item/weapon/twohanded) && W:wielded ) //TODO: Carn
usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>"
return
u_equip(W)
back = W
W.equipped(src, text)
update_inv_back()
return
/mob/proc/reset_view(atom/A)