Skip to content

Commit

Permalink
Merge pull request #3500 from out-of-phaze/feature/holodeck-turnoff
Browse files Browse the repository at this point in the history
Add support for per-preset default/off holodeck programs
  • Loading branch information
MistakeNot4892 authored Dec 2, 2023
2 parents 42f8ce1 + bcbd594 commit 3266684
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/modules/holodeck/HolodeckControl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
dat += "<A href='?src=\ref[src];program=[supported_programs[prog]]'>([prog])</A><BR>"

dat += "<BR>"
dat += "<A href='?src=\ref[src];program=turnoff'>(Turn Off)</A><BR>"
dat += "<A href='?src=\ref[src];program=[global.using_map.holodeck_off_program[programs_list_id]]'>(Turn Off)</A><BR>"

dat += "<BR>"
dat += "Please ensure that only holographic weapons are used in the holodeck if a combat simulation has been loaded.<BR>"
Expand Down Expand Up @@ -198,7 +198,7 @@

if(!checkInteg(linkedholodeck))
damaged = 1
loadProgram(global.using_map.holodeck_programs["turnoff"], 0)
loadProgram(global.using_map.holodeck_programs[global.using_map.holodeck_default_program[programs_list_id] || "turnoff"], 0)
active = 0
update_use_power(POWER_USE_IDLE)
visible_message("The holodeck overloads!", null, "You hear electricity arcing!", range = 10)
Expand Down Expand Up @@ -230,9 +230,9 @@
//Why is it called toggle if it doesn't toggle?
/obj/machinery/computer/HolodeckControl/proc/togglePower(var/toggleOn = 0)
if(toggleOn)
loadProgram(global.using_map.holodeck_programs["emptycourt"], 0)
loadProgram(global.using_map.holodeck_programs[global.using_map.holodeck_default_program[programs_list_id] || "emptycourt"], 0)
else
loadProgram(global.using_map.holodeck_programs["turnoff"], 0)
loadProgram(global.using_map.holodeck_programs[global.using_map.holodeck_default_program[programs_list_id] || "turnoff"], 0)

if(!linkedholodeck.has_gravity)
linkedholodeck.gravitychange(1)
Expand Down Expand Up @@ -324,7 +324,7 @@

/obj/machinery/computer/HolodeckControl/proc/emergencyShutdown()
//Turn it back to the regular non-holographic room
loadProgram(global.using_map.holodeck_programs["turnoff"], 0)
loadProgram(global.using_map.holodeck_programs[global.using_map.holodeck_default_program[programs_list_id] || "turnoff"], 0)

if(!linkedholodeck.has_gravity)
linkedholodeck.gravitychange(1,linkedholodeck)
Expand Down
2 changes: 2 additions & 0 deletions maps/~mapsystem/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ var/global/const/MAP_HAS_RANK = 2 //Rank system, also togglable
// second level maps from program friendly display names ("Picnic Area") to program string ids ("picnicarea")
// as defined in holodeck_programs
var/list/holodeck_restricted_programs = list() // as above... but EVIL!
var/list/holodeck_default_program = list() // map of program list string ids to default program string id
var/list/holodeck_off_program = list() // as above... but for being off i guess

var/allowed_latejoin_spawns = list(
/decl/spawnpoint/arrivals
Expand Down

0 comments on commit 3266684

Please sign in to comment.