Skip to content

Commit

Permalink
[MIRROR] Fixes mod paint kit [MDB IGNORE] (#3704)
Browse files Browse the repository at this point in the history
* Fixes mod paint kit (#84835)

## About The Pull Request

After all the attack chain refactors, the modsuit paint kit was bugged.
If you tried to use it on a modsuit that had storage installed, then the
paint kit would simply be inserted into the modsuit instead of allowing
you to change the skin/color.

Fixes #84620 
Fixes #84490 
## Changelog
:cl:
fix: The modsuit paint kit is no longer broken.
/:cl:

* Fixes mod paint kit

---------

Co-authored-by: GPeckman <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Jul 11, 2024
1 parent 7ee51a6 commit 5731a92
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
20 changes: 20 additions & 0 deletions code/modules/mod/mod_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,26 @@
return ITEM_INTERACT_BLOCKING
insert_pai(user, tool)
return ITEM_INTERACT_SUCCESS
if(istype(tool, /obj/item/mod/paint))
var/obj/item/mod/paint/paint_kit = tool
if(active || activating)
balloon_alert(user, "suit is active!")
return ITEM_INTERACT_BLOCKING
if(LAZYACCESS(modifiers, RIGHT_CLICK)) // Right click
if(paint_kit.editing_mod == src)
return ITEM_INTERACT_BLOCKING
paint_kit.editing_mod = src
paint_kit.proxy_view = new()
paint_kit.proxy_view.generate_view("color_matrix_proxy_[REF(user.client)]")

paint_kit.proxy_view.appearance = paint_kit.editing_mod.appearance
paint_kit.proxy_view.color = null
paint_kit.proxy_view.display_to(user)
paint_kit.ui_interact(user)
return ITEM_INTERACT_SUCCESS
else // Left click
paint_kit.paint_skin(src, user)
return ITEM_INTERACT_SUCCESS
if(istype(tool, /obj/item/mod/module))
if(!open)
balloon_alert(user, "open the cover first!")
Expand Down
28 changes: 0 additions & 28 deletions code/modules/mod/mod_paint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,6 @@
. += span_notice("<b>Left-click</b> a MODsuit to change skin.")
. += span_notice("<b>Right-click</b> a MODsuit to recolor.")

/obj/item/mod/paint/pre_attack(atom/attacked_atom, mob/living/user, params)
if(!istype(attacked_atom, /obj/item/mod/control))
return ..()
var/obj/item/mod/control/mod = attacked_atom
if(mod.active || mod.activating)
balloon_alert(user, "suit is active!")
return TRUE
paint_skin(mod, user)

/obj/item/mod/paint/pre_attack_secondary(atom/attacked_atom, mob/living/user, params)
if(!istype(attacked_atom, /obj/item/mod/control))
return ..()
var/obj/item/mod/control/mod = attacked_atom
if(mod.active || mod.activating)
balloon_alert(user, "suit is active!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
if(editing_mod)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
editing_mod = mod
proxy_view = new()
proxy_view.generate_view("color_matrix_proxy_[REF(user.client)]")

proxy_view.appearance = editing_mod.appearance
proxy_view.color = null
proxy_view.display_to(user)
ui_interact(user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN

/obj/item/mod/paint/ui_interact(mob/user, datum/tgui/ui)
if(!editing_mod)
return
Expand Down

0 comments on commit 5731a92

Please sign in to comment.