Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a preference for facing your mouse while in combat mode #3

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/game/atom/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@
if (isnull(user))
return

if(user.face_mouse) // DOPPLER SHIFT ADDITION
user.face_atom(src) // DOPPLER SHIFT ADDITION

// Screentips
var/datum/hud/active_hud = user.hud_used
if(!active_hud)
Expand Down
9 changes: 6 additions & 3 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
/// Example: If req_one_access = list(ACCESS_ENGINE, ACCESS_CE)- then the user must have either ACCESS_ENGINE or ACCESS_CE in order to use the object.
var/list/req_one_access

/// Whether a user will face atoms on entering them with a mouse. Despite being a mob variable, it is here for performances // DOPPLER SHIFT ADDITION
var/face_mouse = FALSE // DOPPLER SHIFT ADDITION

/mutable_appearance/emissive_blocker

/mutable_appearance/emissive_blocker/New()
Expand Down Expand Up @@ -634,7 +637,7 @@
if(!direction)
direction = get_dir(src, newloc)

if(set_dir_on_move && dir != direction && update_dir)
if(set_dir_on_move && dir != direction && update_dir && !face_mouse) // DOPPLER SHIFT EDIT : ORIGINAL : if(set_dir_on_move && dir != direction && update_dir)
setDir(direction)

var/is_multi_tile_object = is_multi_tile_object(src)
Expand Down Expand Up @@ -761,7 +764,7 @@
moving_diagonally = SECOND_DIAG_STEP
. = step(src, SOUTH)
if(moving_diagonally == SECOND_DIAG_STEP)
if(!. && set_dir_on_move && update_dir)
if(!. && set_dir_on_move && update_dir && !face_mouse) // DOPPLER SHIFT EDIT : ORIGINAL : if(!. && set_dir_on_move && update_dir)
setDir(first_step_dir)
else if(!inertia_moving)
newtonian_move(direct)
Expand Down Expand Up @@ -808,7 +811,7 @@

last_move = direct

if(set_dir_on_move && dir != direct && update_dir)
if(set_dir_on_move && dir != direct && update_dir && !face_mouse) // DOPPLER SHIFT EDIT : ORIGINAL : if(set_dir_on_move && dir != direct && update_dir)
setDir(direct)
if(. && has_buckled_mobs() && !handle_buckled_mob_movement(loc, direct, glide_size_override)) //movement failed due to buckled mob(s)
. = FALSE
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
combat_mode = new_mode
if(hud_used?.action_intent)
hud_used.action_intent.update_appearance()
face_mouse = (client?.prefs?.read_preference(/datum/preference/toggle/face_cursor_combat_mode) && combat_mode) ? TRUE : FALSE // DOPPLER SHIFT ADDITION
if(silent || !(client?.prefs.read_preference(/datum/preference/toggle/sound_combatmode)))
return
if(combat_mode)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/preference/toggle/face_cursor_combat_mode
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "face_cursor_combat_mode"
savefile_identifier = PREFERENCE_PLAYER
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6353,4 +6353,5 @@
#include "interface\fonts\spess_font.dm"
#include "interface\fonts\tiny_unicode.dm"
#include "interface\fonts\vcr_osd_mono.dm"
#include "modular_doppler\face_mouse_preferences\code\face_mouse_pref.dm"
// END_INCLUDE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { CheckboxInput, FeatureToggle } from '../base';

export const face_cursor_combat_mode: FeatureToggle = {
name: 'Face mouse in combat mode',
category: 'GAMEPLAY',
description:
'If your character should face towards your cursor while in combat mode.',
component: CheckboxInput,
};
Loading