Merge pull request #11615 from Tayyyyyyy/aa/parallax-no-sql

Parallax
This commit is contained in:
Fox McCloud
2019-08-19 21:13:33 -04:00
committed by GitHub
31 changed files with 544 additions and 34 deletions
+3
View File
@@ -433,6 +433,9 @@
GLOB.admins -= src
GLOB.directory -= ckey
GLOB.clients -= src
if(movingmob)
movingmob.client_mobs_in_contents -= mob
UNSETEMPTY(movingmob.client_mobs_in_contents)
Master.UpdateTickRate()
return ..()
@@ -201,6 +201,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
//Gear stuff
var/list/gear = list()
var/gear_tab = "General"
// Parallax
var/parallax = PARALLAX_HIGH
/datum/preferences/New(client/C)
parent = C
@@ -462,6 +464,19 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "<b>OOC Color:</b> <span style='border: 1px solid #161616; background-color: [ooccolor ? ooccolor : normal_ooc_colour];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=ooccolor;task=input'><b>Change</b></a><br>"
if(config.allow_Metadata)
dat += "<b>OOC Notes:</b> <a href='?_src_=prefs;preference=metadata;task=input'><b>Edit</b></a><br>"
dat += "<b>Parallax (Fancy Space):</b> <a href='?_src_=prefs;preference=parallax'>"
switch (parallax)
if(PARALLAX_LOW)
dat += "Low"
if(PARALLAX_MED)
dat += "Medium"
if(PARALLAX_INSANE)
dat += "Insane"
if(PARALLAX_DISABLE)
dat += "Disabled"
else
dat += "High"
dat += "</a><br>"
dat += "<b>Play Admin MIDIs:</b> <a href='?_src_=prefs;preference=hear_midis'><b>[(sound & SOUND_MIDI) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Play Lobby Music:</b> <a href='?_src_=prefs;preference=lobby_music'><b>[(sound & SOUND_LOBBY) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Randomized Character Slot:</b> <a href='?_src_=prefs;preference=randomslot'><b>[randomslot ? "Yes" : "No"]</b></a><br>"
@@ -2072,6 +2087,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(href_list["tab"])
current_tab = text2num(href_list["tab"])
if("ambientocclusion")
toggles ^= AMBIENT_OCCLUSION
if(parent && parent.screen && parent.screen.len)
@@ -2080,6 +2096,19 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(toggles & AMBIENT_OCCLUSION)
PM.filters += FILTER_AMBIENT_OCCLUSION
if("parallax")
var/parallax_styles = list(
"Off" = PARALLAX_DISABLE,
"Low" = PARALLAX_LOW,
"Medium" = PARALLAX_MED,
"High" = PARALLAX_HIGH,
"Insane" = PARALLAX_INSANE
)
parallax = parallax_styles[input(user, "Pick a parallax style", "Parallax Style") as null|anything in parallax_styles]
if(parent && parent.mob && parent.mob.hud_used)
parent.mob.hud_used.update_parallax_pref()
ShowChoices(user)
return 1
@@ -20,7 +20,8 @@
clientfps,
atklog,
fuid,
afk_watch
afk_watch,
parallax
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"}
)
@@ -54,6 +55,7 @@
atklog = text2num(query.item[18])
fuid = text2num(query.item[19])
afk_watch = text2num(query.item[20])
parallax = text2num(query.item[21])
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
@@ -75,6 +77,7 @@
atklog = sanitize_integer(atklog, 0, 100, initial(atklog))
fuid = sanitize_integer(fuid, 0, 10000000, initial(fuid))
afk_watch = sanitize_integer(afk_watch, 0, 1, initial(afk_watch))
parallax = sanitize_integer(parallax, 0, 16, initial(parallax))
return 1
/datum/preferences/proc/save_preferences(client/C)
@@ -105,7 +108,8 @@
ghost_anonsay='[ghost_anonsay]',
clientfps='[clientfps]',
atklog='[atklog]',
afk_watch='[afk_watch]'
afk_watch='[afk_watch]',
parallax='[parallax]'
WHERE ckey='[C.ckey]'"}
)
@@ -236,6 +236,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 1
/mob/dead/observer/Move(NewLoc, direct)
update_parallax_contents()
following = null
setDir(direct)
ghostimage.setDir(dir)
@@ -417,6 +418,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
forceMove(pick(L))
update_parallax_contents()
following = null
/mob/dead/observer/verb/follow()
@@ -511,6 +513,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
A.forceMove(T)
M.update_parallax_contents()
following = null
return
to_chat(A, "This mob is not located in the game world.")
@@ -31,6 +31,7 @@
ai.camera_visibility(src)
if(ai.client && !ai.multicam_on)
ai.client.eye = src
update_parallax_contents()
//Holopad
if(ai.master_multicam)
ai.master_multicam.refresh_view()
+20 -7
View File
@@ -30,17 +30,22 @@
if(id_tag == "s_docking_airlock")
INVOKE_ASYNC(src, .proc/lock)
/mob/onShuttleMove()
/mob/onShuttleMove(turf/oldT, turf/T1, rotation, travelDir)
if(!move_on_shuttle)
return 0
. = ..()
if(!.)
return
if(client)
if(buckled)
shake_camera(src, 2, 1) // turn it down a bit come on
else
shake_camera(src, 7, 1)
if(!client)
return
if(buckled)
shake_camera(src, 2, 1) // turn it down a bit come on
else
shake_camera(src, 7, 1)
client.new_parallax_movedir = travelDir ? WEST : NORTH
update_parallax_contents()
/mob/living/carbon/onShuttleMove()
. = ..()
@@ -54,8 +59,16 @@
if(smooth)
queue_smooth(src)
/mob/postDock(obj/docking_port/S1, transit, list/parallax_mobs)
if(!client)
return
if(transit)
parallax_mobs.Add(src)
return
client.new_parallax_movedir = 0
update_parallax_contents()
/obj/machinery/door/airlock/postDock(obj/docking_port/stationary/S1)
. = ..()
if(!S1.lock_shuttle_doors && id_tag == "s_docking_airlock")
INVOKE_ASYNC(src, .proc/unlock)
+14 -5
View File
@@ -189,7 +189,7 @@
/obj/docking_port/stationary/transit
name = "In transit"
turf_type = /turf/space/transit
var/area/shuttle/transit/assigned_area
lock_shuttle_doors = 1
/obj/docking_port/stationary/transit/register()
@@ -215,6 +215,7 @@
var/roundstart_move //id of port to send shuttle to at roundstart
var/travelDir = 0 //direction the shuttle would travel in
var/rebuildable = 0 //can build new shuttle consoles for this one
var/list/parallax_mobs = list() //mobs to unparallax
var/obj/docking_port/stationary/destination
var/obj/docking_port/stationary/previous
@@ -358,7 +359,7 @@
var/obj/docking_port/stationary/S0 = get_docked()
var/obj/docking_port/stationary/S1 = findTransitDock()
if(S1)
if(dock(S1))
if(dock(S1, , TRUE))
WARNING("shuttle \"[id]\" could not enter transit space. Docked at [S0 ? S0.id : "null"]. Transit dock [S1 ? S1.id : "null"].")
else
previous = S0
@@ -429,7 +430,7 @@
//this is the main proc. It instantly moves our mobile port to stationary port S1
//it handles all the generic behaviour, such as sanity checks, closing doors on the shuttle, stunning mobs, etc
/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1, force=FALSE)
/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1, force=FALSE, transit=FALSE)
// Crashing this ship with NO SURVIVORS
if(S1.get_docked() == src)
remove_ripples()
@@ -494,7 +495,7 @@
//move mobile to new location
for(var/atom/movable/AM in T0)
AM.onShuttleMove(T0, T1, rotation)
AM.onShuttleMove(T0, T1, rotation, travelDir)
if(rotation)
T1.shuttleRotate(rotation)
@@ -516,7 +517,15 @@
var/turf/T1 = A1
T1.postDock(S1)
for(var/atom/movable/M in T1)
M.postDock(S1)
M.postDock(S1, transit, parallax_mobs)
// For mobs who move away from a transiting shuttle for whatever reason (teleportation, jumping, etc) so that they don't get stuck parallaxing
if(!transit)
for(var/mob/M in parallax_mobs)
if(M.client && M.client.new_parallax_movedir)
M.client.new_parallax_movedir = 0
M.update_parallax_contents()
parallax_mobs = list()
loc = S1.loc
dir = S1.dir