Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrotechnics2 committed Feb 4, 2025
2 parents ef7ef4c + 318bb43 commit acccb66
Show file tree
Hide file tree
Showing 16 changed files with 448 additions and 156 deletions.
29 changes: 15 additions & 14 deletions code/game/objects/items/RPD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -440,24 +440,24 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if((mode & DESTROY_MODE) && istype(attack_target, /obj/item/pipe) || istype(attack_target, /obj/structure/disposalconstruct) || istype(attack_target, /obj/structure/c_transit_tube) || istype(attack_target, /obj/structure/c_transit_tube_pod) || istype(attack_target, /obj/item/pipe_meter) || istype(attack_target, /obj/structure/disposalpipe/broken))
activate()
qdel(attack_target)
return
return TRUE

if(mode & REPROGRAM_MODE)
// If this is a placed smart pipe, try to reprogram it
var/obj/machinery/atmospherics/pipe/smart/target_smart_pipe = attack_target
if(istype(target_smart_pipe))
if(target_smart_pipe.dir == ALL_CARDINALS)
balloon_alert(user, "has no unconnected directions!")
return
return TRUE
var/old_init_dir = target_smart_pipe.get_init_directions()
if(old_init_dir == p_init_dir)
balloon_alert(user, "already configured!")
return
return TRUE
// Check for differences in unconnected directions
var/target_differences = (p_init_dir ^ old_init_dir) & ~target_smart_pipe.connections
if(!target_differences)
balloon_alert(user, "already configured for its directions!")
return
return TRUE

activate()

Expand All @@ -467,7 +467,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
// Double check to make sure that nothing has changed. If anything we were about to change was connected during do_after, abort
if(target_differences & target_smart_pipe.connections)
balloon_alert(user, "can't configure for its direction!")
return
return TRUE
// Grab the current initializable directions, which may differ from old_init_dir if someone else was working on the same pipe at the same time
var/current_init_dir = target_smart_pipe.get_init_directions()
// Access p_init_dir directly. The RPD can change target layer and initializable directions (though not pipe type or dir) while working to dispense and connect a component,
Expand All @@ -476,7 +476,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
// Don't make a smart pipe with only one connection
if(ISSTUB(new_init_dir))
balloon_alert(user, "no one directional pipes allowed!")
return
return TRUE
target_smart_pipe.set_init_directions(new_init_dir)
// We're now reconfigured.
// We can never disconnect from existing connections, but we can connect to previously unconnected directions, and should immediately do so
Expand All @@ -502,57 +502,58 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
// Finally, update our internal state - update_pipe_icon also updates dir and connections
target_smart_pipe.update_pipe_icon()
user.visible_message(span_notice("[user] reprograms the [target_smart_pipe]."), span_notice("You reprogram the [target_smart_pipe]."))
return
return TRUE
// If this is an unplaced smart pipe, try to reprogram it
var/obj/item/pipe/quaternary/target_unsecured_pipe = attack_target
if(istype(target_unsecured_pipe) && ispath(target_unsecured_pipe.pipe_type, /obj/machinery/atmospherics/pipe/smart))
// An unplaced pipe never has any existing connections, so just directly assign the new configuration
target_unsecured_pipe.p_init_dir = p_init_dir
target_unsecured_pipe.update()
return
return TRUE

if(mode & BUILD_MODE)
switch(category) //if we've gotten this var, the target is valid
if(ATMOS_CATEGORY) //Making pipes
if(!do_pipe_build(attack_target, user, params))
return ..()
return TRUE

if(DISPOSALS_CATEGORY) //Making disposals pipes
if(!can_make_pipe)
return ..()
attack_target = get_turf(attack_target)
if(isclosedturf(attack_target))
balloon_alert(user, "target is blocked!")
return
return TRUE
activate()
if(do_after(user, disposal_build_speed, target = attack_target))
var/obj/structure/disposalconstruct/new_disposals_segment = new (attack_target, queued_pipe_type, queued_pipe_dir, queued_pipe_flipped)

if(!new_disposals_segment.can_place())
balloon_alert(user, "not enough room!")
qdel(new_disposals_segment)
return
return TRUE

activate()

new_disposals_segment.add_fingerprint(usr)
new_disposals_segment.update_appearance()
if(mode & WRENCH_MODE)
new_disposals_segment.wrench_act(user, src)
return
return TRUE

if(TRANSIT_CATEGORY) //Making transit tubes
if(!can_make_pipe)
return ..()
attack_target = get_turf(attack_target)
if(isclosedturf(attack_target))
balloon_alert(user, "something in the way!")
return
return TRUE

var/turf/target_turf = get_turf(attack_target)
if(target_turf.is_blocked_turf(exclude_mobs = TRUE))
balloon_alert(user, "something in the way!")
return
return TRUE

activate()
if(do_after(user, transit_build_speed, target = attack_target))
Expand All @@ -574,7 +575,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
tube.add_fingerprint(usr)
if(mode & WRENCH_MODE)
tube.wrench_act(user, src)
return
return TRUE
else
return ..()

Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/heretic/heretic_antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@
return ..()

/datum/antagonist/heretic/on_gain()
var/mob/living/carbon/C = owner.current //only carbons have dna now, so we have to typecast
if(isipc(owner.current))//Due to IPCs having a mechanical heart it messes with the living heart, so no IPC heretics for now
var/mob/living/carbon/C = owner.current //only carbons have dna now, so we have to typecast
C.set_species(/datum/species/human)
var/prefs_name = C.client?.prefs?.read_character_preference(/datum/preference/name/backup_human)
if(prefs_name)
Expand All @@ -170,6 +170,7 @@

GLOB.reality_smash_track.add_tracked_mind(owner)
addtimer(CALLBACK(src, PROC_REF(passive_influence_gain)), passive_gain_timer) // Gain +1 knowledge every 20 minutes.
addtimer(CALLBACK(C, TYPE_PROC_REF(/mob/living/carbon, finish_manus_dream_cooldown)), 1 MINUTES)
return ..()

/datum/antagonist/heretic/on_removal()
Expand Down
74 changes: 41 additions & 33 deletions code/modules/client/preferences/entries/player/fullscreen.dm
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
#if (MIN_COMPILER_VERSION > 515 && MIN_COMPILER_BUILD > 1630)
#warn ATTENTION!! ONCE 515.1631 IS REQUIRED REPLACE WITH winset(client, "mainwindow", "menu=;is-fullscreen=true"). This means no double maximise calls to make sure window fits, and supresses titlebar, can-resize and is-maximized here making those redundant both implementations are functionally "windowed borderless"
#endif

/datum/preference/toggle/fullscreen
db_key = "fullscreen"
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
preference_type = PREFERENCE_PLAYER
default_value = FALSE

/datum/preference/toggle/fullscreen/apply_to_client(client/client, value)
if (value)
// Delete the menu
winset(client, "mainwindow", "menu=\"\"")
// Switch to the cool status bar
winset(client, "mainwindow", "on-status=\".winset \\\"\[\[*]]=\\\"\\\" ? status_bar.text=\[\[*]] status_bar.is-visible=true : status_bar.is-visible=false\\\"\"")
winset(client, "status_bar_wide", "is-visible=false")
// Switch to fullscreen mode
winset(client, "mainwindow","titlebar=false")
winset(client, "mainwindow","can-resize=false")
// Set it to minimized first because otherwise it doesn't enter fullscreen properly
// This line is important, and the game won't properly enter fullscreen mode otherwise
winset(client, "mainwindow","is-minimized=true")
winset(client, "mainwindow","is-maximized=true")
// Set the main window's size
winset(client, null, "split.size=mainwindow.size")
// Fit the viewport
INVOKE_ASYNC(client, TYPE_VERB_REF(/client, fit_viewport))
if(client.byond_version <= 515 || client.byond_build <= 1630)
if (value)
// Delete the menu
winset(client, "mainwindow", "menu=\"\"")
// Switch to the cool status bar
winset(client, "mainwindow", "on-status=\".winset \\\"\[\[*]]=\\\"\\\" ? status_bar.text=\[\[*]] status_bar.is-visible=true : status_bar.is-visible=false\\\"\"")
winset(client, "status_bar_wide", "is-visible=false")
// Switch to fullscreen mode
winset(client, "mainwindow","titlebar=false")
winset(client, "mainwindow","can-resize=false")
// Set it to minimized first because otherwise it doesn't enter fullscreen properly
// This line is important, and the game won't properly enter fullscreen mode otherwise
winset(client, "mainwindow","is-minimized=true")
winset(client, "mainwindow","is-maximized=true")
// Set the main window's size
winset(client, null, "split.size=mainwindow.size")
// Fit the viewport
INVOKE_ASYNC(client, TYPE_VERB_REF(/client, fit_viewport))
else
// Restore the menu
winset(client, "mainwindow", "menu=\"menu\"")
// Switch to the lame status bar
winset(client, "mainwindow", "on-status=\".winset \\\"status_bar_wide.text = \[\[*]]\\\"\"")
winset(client, "status_bar", "is-visible=false")
winset(client, "status_bar_wide", "is-visible=true")
// Exit fullscreen mode
winset(client, "mainwindow","titlebar=true")
winset(client, "mainwindow","can-resize=true")
winset(client, "mainwindow","is-maximized=true")
// Fix the mapsize, turning off statusbar doesn't update scaling
INVOKE_ASYNC(src, PROC_REF(fix_mapsize), client)
else
// Restore the menu
winset(client, "mainwindow", "menu=\"menu\"")
// Switch to the lame status bar
winset(client, "mainwindow", "on-status=\".winset \\\"status_bar_wide.text = \[\[*]]\\\"\"")
winset(client, "status_bar", "is-visible=false")
winset(client, "status_bar_wide", "is-visible=true")
// Exit fullscreen mode
winset(client, "mainwindow","titlebar=true")
winset(client, "mainwindow","can-resize=true")
winset(client, "mainwindow","is-maximized=true")
// Fix the mapsize, turning off statusbar doesn't update scaling
INVOKE_ASYNC(src, PROC_REF(fix_mapsize), client)
if(value)
winset(client, "mainwindow", "menu=;is-fullscreen=true")
winset(client, "status_bar_wide", "is-visible=false")
winset(client, "mainwindow", "on-status=\".winset \\\"\[\[*]]=\\\"\\\" ? status_bar.text=\[\[*]] status_bar.is-visible=true : status_bar.is-visible=false\\\"\"")
else
winset(client, "mainwindow", "menu=;is-fullscreen=false")
winset(client, "status_bar_wide", "is-visible=true")
winset(client, "mainwindow", "on-status=\".winset \\\"status_bar_wide.text = \[\[*]]\\\"\"")
winset(client, "status_bar", "is-visible=false")
INVOKE_ASYNC(client, TYPE_VERB_REF(/client, fit_viewport))

/datum/preference/toggle/fullscreen/proc/fix_mapsize(client/client)
var/windowsize = winget(client, "split", "size")
Expand Down
Loading

0 comments on commit acccb66

Please sign in to comment.