Skip to content

Commit

Permalink
adds crosshairs to hmgs
Browse files Browse the repository at this point in the history
  • Loading branch information
VileBeggar committed Dec 4, 2024
1 parent aa2cdcb commit d8bd743
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,17 @@
if (PF)
PF.flags_can_pass_all = PASS_AROUND|PASS_OVER_THROW_ITEM|PASS_OVER_THROW_MOB

///Turns the mouse cursor into a crosshair if new_cursor is set to TRUE. If set to FALSE, returns the cursor to its initial icon.
/obj/structure/machinery/m56d_hmg/proc/update_mouse_pointer(mob/user, new_cursor)
if(!user.client?.prefs.custom_cursors)
return

user.client?.mouse_pointer_icon = new_cursor ? get_mouse_pointer() : initial(user.client?.mouse_pointer_icon)

///Getter proc. Returns the weapon's crosshair icon.
/obj/structure/machinery/m56d_hmg/proc/get_mouse_pointer()
return 'icons/effects/mouse_pointer/lmg_mouse.dmi'

//Making so rockets don't hit M56D
/obj/structure/machinery/m56d_hmg/calculate_cover_hit_boolean(obj/projectile/P, distance = 0, cade_direction_correct = FALSE)
var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags
Expand Down Expand Up @@ -676,6 +687,7 @@
/obj/structure/machinery/m56d_hmg/proc/exit_interaction()
SIGNAL_HANDLER

update_mouse_pointer(operator, FALSE)
operator.unset_interaction()

/obj/structure/machinery/m56d_hmg/proc/update_damage_state()
Expand Down Expand Up @@ -917,6 +929,7 @@
RegisterSignal(user, COMSIG_MOB_MOUSEUP, PROC_REF(stop_fire))

operator = user
update_mouse_pointer(operator, TRUE)
flags_atom |= RELAY_CLICK

/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/user)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,14 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w
update_mouse_pointer(user, FALSE)
slowdown = initial(slowdown)

///Turns the mouse cursor into a crosshair if new_cursor is set to TRUE. If set to FALSE, returns the cursor to its initial icon.
/obj/item/weapon/gun/proc/update_mouse_pointer(mob/user, new_cursor)
if(!user.client?.prefs.custom_cursors)
return

user.client?.mouse_pointer_icon = new_cursor ? get_mouse_pointer() : initial(user.client?.mouse_pointer_icon)

///Getter proc. Returns the weapon's crosshair icon.
/obj/item/weapon/gun/proc/get_mouse_pointer()
return 'icons/effects/mouse_pointer/rifle_mouse.dmi'

Expand Down

0 comments on commit d8bd743

Please sign in to comment.