Skip to content

Commit

Permalink
Makes drag/drop that dont have any use call click (tgstation#20774)
Browse files Browse the repository at this point in the history
Makes drag/drop that dont have any particular defined behaviour be treated as just click on the dragged object
  • Loading branch information
Razharas authored and optimumtact committed Oct 12, 2016
1 parent 7a202b9 commit 7753b04
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 10 deletions.
10 changes: 5 additions & 5 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
if(!usr || !over) return
if(over == src)
return usr.client.Click(src, src_location, src_control, params)
if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows
if(!Adjacent(usr) || !over.Adjacent(usr))
return usr.client.Click(src, src_location, src_control, params) // should stop you from dragging through windows

over.MouseDrop_T(src,usr)
return
if(!over.MouseDrop_T(src,usr))
usr.client.Click(src, src_location, src_control, params)

// recieve a mousedrop
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
return
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
if(isabductor(target))
return
close_machine(target)
. = TRUE

/obj/machinery/abductor/experiment/attack_hand(mob/user)
if(..())
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
return
close_machine(target)
. = TRUE

/obj/machinery/sleeper/attackby(obj/item/I, mob/user, params)
if(!state_open && !occupant)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/pipe/pipe_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Nah
if (pipe.anchored)
return

. = TRUE
qdel(pipe)

/obj/machinery/pipedispenser/disposal/attack_hand(mob/user)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
target.visible_message("<span class='warning'>[user] pushes [target] into [src] and shuts its door!<span>", "<span class='userdanger'>[user] shoves you into [src] and shuts the door!</span>")
close_machine(target)
add_fingerprint(user)
. = TRUE

/obj/machinery/suit_storage_unit/proc/cook()
if(uv_cycles)
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@
log_append_to_last("Permission denied.")
return
var/passed
. = TRUE
if(dna_lock)
if(user.has_dna())
var/mob/living/carbon/C = user
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/implants/implantchair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
data["ready_implants"] = ready_implants
data["ready"] = ready
data["replenishing"] = replenishing

return data

/obj/machinery/implantchair/ui_act(action, params)
Expand Down Expand Up @@ -137,6 +137,7 @@
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
return
close_machine(target)
. = TRUE

/obj/machinery/implantchair/close_machine(mob/user)
if((isnull(user) || istype(user)) && state_open)
Expand Down Expand Up @@ -189,4 +190,3 @@
log_game("[key_name_admin(user)] brainwashed [key_name_admin(C)] with objective '[objective]'.")
return 1


1 change: 1 addition & 0 deletions code/game/objects/items/weapons/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
if(!L.incapacitated() && I == L.get_active_held_item())
if(can_be_inserted(I, 0))
handle_item_insertion(I, 0 , L)
. = TRUE


//Check if this storage can dump the items
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if(ismob(O) && user == O && iscarbon(user))
if(user.canmove)
climb_structure(user)
return
return 1
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_held_item() != O))
return
if(iscyborg(user))
Expand All @@ -61,7 +61,7 @@
return
if (O.loc != src.loc)
step(O, get_dir(O, src))
return
return 1

/obj/structure/proc/climb_structure(mob/user)
src.add_fingerprint(user)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
actuallyismob = 1
else if(!istype(O, /obj/item))
return
. = TRUE
var/turf/T = get_turf(src)
var/list/targets = list(O, src)
add_fingerprint(user)
Expand All @@ -276,9 +277,9 @@
L.Weaken(2)
O.forceMove(T)
close()
return
else
O.forceMove(T)
return 1

/obj/structure/closet/relaymove(mob/user)
if(user.stat || !isturf(loc) || !isliving(user))
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/morgue.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ var/global/list/crematoriums = new/list()
return
if(!ismob(user) || user.lying || user.incapacitated())
return
. = TRUE
O.loc = src.loc
if (user != O)
visible_message("<span class='warning'>[user] stuffs [O] into [src].</span>")
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@
return
if(!user.drop_item())
return
. = TRUE
if(O.loc != src.loc)
step(O, get_dir(O, src))

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/transit_tubes/station.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
return
for(var/obj/structure/transit_tube_pod/pod in loc)
return //no fun allowed
. = TRUE
var/obj/structure/transit_tube_pod/T = new/obj/structure/transit_tube_pod(src)
R.transfer_fingerprints_to(T)
T.add_fingerprint(user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user)
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
return
. = TRUE
close_machine(target)

/obj/machinery/atmospherics/components/unary/cryo_cell/attackby(obj/item/I, mob/user, params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
if(!istype(target))
return
if(ismonkey(target))
. = TRUE
stuff_monkey_in(target, user)

/obj/machinery/monkey_recycler/proc/stuff_monkey_in(mob/living/carbon/monkey/target, mob/living/user)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/simple_animal/bot/mulebot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ var/global/mulebot_count = 0
if(!istype(AM))
return

. = TRUE
load(AM)

// called to load a crate
Expand Down
1 change: 1 addition & 0 deletions code/modules/paperwork/photocopier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
check_ass() //Just to make sure that you can re-drag somebody onto it after they moved off.
if (!istype(target) || target.anchored || target.buckled || !Adjacent(user) || !Adjacent(target) || !user.canUseTopic(src, 1) || target == ass || copier_blocked())
return
. = TRUE
src.add_fingerprint(user)
if(target == user)
user.visible_message("[user] starts climbing onto the photocopier!", "<span class='notice'>You start climbing onto the photocopier...</span>")
Expand Down
1 change: 1 addition & 0 deletions code/modules/recycling/disposal-unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

/obj/machinery/disposal/MouseDrop_T(mob/living/target, mob/living/user)
if(istype(target))
. = TRUE
stuff_mob_in(target, user)

/obj/machinery/disposal/proc/stuff_mob_in(mob/living/target, mob/living/user)
Expand Down

0 comments on commit 7753b04

Please sign in to comment.