Ports /vg/ parallax

This commit is contained in:
monster860
2016-06-21 14:58:49 -04:00
parent b20089057a
commit 120e470458
22 changed files with 393 additions and 6 deletions
+11 -1
View File
@@ -84,4 +84,14 @@
var/datum/click_intercept/click_intercept = null
//datum that controls the displaying and hiding of tooltips
var/datum/tooltip/tooltips
var/datum/tooltip/tooltips
////////////
//PARALLAX//
////////////
var/updating_parallax = 0
var/list/parallax = list()
var/list/parallax_offset = list()
var/turf/previous_turf = null
var/obj/screen/plane_master/parallax_master/parallax_master = null
var/obj/screen/plane_master/parallax_dustmaster/parallax_dustmaster = null
+21
View File
@@ -90,6 +90,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/show_ghostitem_attack = TRUE
var/UI_style_color = "#ffffff"
var/UI_style_alpha = 255
var/space_parallax = 1
var/space_dust = 1
var/parallax_speed = 1
//character preferences
@@ -370,6 +373,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(TAB_GAME) // General Preferences
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>General Settings</h2>"
dat += "<b>Space Parallax:</b> <a href='?_src_=prefs;preference=parallax'><b>[space_parallax ? "Enabled" : "Disabled"]</b></a><br>"
dat += "<b>Parallax Speed:</b> <a href='?_src_=prefs;preference=p_speed'><b>[parallax_speed]</b></a><br>"
dat += "<b>Space Dust:</b> <a href='?_src_=prefs;preference=dust'><b>[space_dust ? "Yes" : "No"]</b></a><br>"
dat += "<b>Fancy NanoUI:</b> <a href='?_src_=prefs;preference=nanoui'>[(nanoui_fancy) ? "Yes" : "No"]</a><br>"
dat += "<b>Ghost-Item Attack Animation:</b> <a href='?_src_=prefs;preference=ghost_att_anim'>[(show_ghostitem_attack) ? "Yes" : "No"]</a><br>"
dat += "<b>Custom UI settings:</b><br>"
@@ -1632,6 +1638,21 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(ishuman(usr)) //mid-round preference changes, for aesthetics
var/mob/living/carbon/human/H = usr
H.remake_hud()
if("parallax")
space_parallax = !space_parallax
if(usr && usr.hud_used)
usr.hud_used.update_parallax_and_dust()
if("dust")
space_dust = !space_dust
if(usr && usr.hud_used)
usr.hud_used.update_parallax_and_dust()
if("p_speed")
parallax_speed = min(max(input(user, "Enter a number between 0 and 5 included (default=2)","Parallax Speed Preferences",parallax_speed),0),5)
if("be_special")
var/r = href_list["role"]
+14 -2
View File
@@ -13,7 +13,10 @@
volume,
nanoui_fancy,
show_ghostitem_attack,
lastchangelog
lastchangelog,
space_parallax,
space_dust,
parallax_speed
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"}
)
@@ -40,6 +43,9 @@
nanoui_fancy = text2num(query.item[11])
show_ghostitem_attack = text2num(query.item[12])
lastchangelog = query.item[13]
space_parallax = text2num(query.item[14])
space_dust = text2num(query.item[15])
parallax_speed = text2num(query.item[16])
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
@@ -54,6 +60,9 @@
nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy))
show_ghostitem_attack = sanitize_integer(show_ghostitem_attack, 0, 1, initial(show_ghostitem_attack))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
space_parallax = sanitize_integer(space_parallax, 0, 1, initial(space_parallax))
space_dust = sanitize_integer(space_dust, 0, 1, initial(space_dust))
parallax_speed = sanitize_integer(parallax_speed, 0, 5, initial(parallax_speed))
return 1
/datum/preferences/proc/save_preferences(client/C)
@@ -78,7 +87,10 @@
volume='[volume]',
nanoui_fancy='[nanoui_fancy]',
show_ghostitem_attack='[show_ghostitem_attack]',
lastchangelog='[lastchangelog]'
lastchangelog='[lastchangelog]',
space_parallax='[space_parallax]',
space_dust='[space_dust]',
parallax_speed='[parallax_speed]'
WHERE ckey='[C.ckey]'"}
)
+42 -1
View File
@@ -213,4 +213,45 @@
set category = "Preferences"
set desc = "Allows you to access the Setup Character screen. Changes to your character won't take effect until next round, but other changes will."
prefs.current_tab = 1
prefs.ShowChoices(usr)
prefs.ShowChoices(usr)
/client/verb/toggle_space_parallax()
set name = "Toggle Space Parallax"
set category = "Preferences"
set desc = "Toggle the parallax effect of space turfs."
prefs.space_parallax = !prefs.space_parallax
prefs.save_preferences(src)
if(!prefs.space_parallax)
to_chat(usr, "Space parallax is now deactivated.")
else
to_chat(usr, "Space parallax is now activated.")
if(mob && mob.hud_used)
mob.hud_used.update_parallax_and_dust()
/client/verb/toggle_space_dust()
set name = "Toggle Space Dust"
set category = "Preferences"
set desc = "Toggle the presence of dust on space turfs."
prefs.space_dust = !prefs.space_dust
prefs.save_preferences(src)
if(!prefs.space_dust)
to_chat(usr, "Space dust is now deactivated.")
else
to_chat(usr, "Space dust is now activated.")
if(mob && mob.hud_used)
mob.hud_used.update_parallax_and_dust()
/client/verb/toggle_parallax_speed()
set name = "Change Parallax Speed"
set category = "Preferences"
set desc = "Change the speed at which parallax moves."
prefs.parallax_speed = min(max(input(usr, "Enter a number between 0 and 5 included (default=2)","Parallax Speed Preferences",prefs.parallax_speed),0),5)
prefs.save_preferences(src)