Lamp Bloom, Exposure and Glare (#24534)

* Light Update

* Not failing tests I hope

* Whitespace Removal

* Tweaking here and there

* Merge Conflict Fix

* Rebuild TGUI Bundle to Fix Merge Conflict

* Settings are now in "Game Preferences" too

* ColorMatrix formatting and removal of unused procs

* A little mistake on matrices

* A little mistake x2 (last I hope)

* Moving Glare under every other effect, tweaking values, playing with blending

* Update TGUI Bundle for Merge Conflict

* Apply suggestions from code reviews

* Fuck it, it just works

* No tabs cool

* Remove unused

* Am I retarded

* We better return

* Whitespace we need

* oh

* New SQL update version

* Missing comma fix and recompiled tgui.bundle

* Updating SQL version in misc_defines and config

* Remove datum in holder

* BloomEdit empty lines removal

* No more unneeded functions calls

* Tgui.bundle rebuild

* SQL Changes

* SQL Version = 56 now

* Documentation and some formatting

* tgui.bundle.js rebuild

* Remove unused layers and variables

* Allow cameras to render backdrops

* Possible runtime issue fix

* Remove "baked" bloom from the lamps

* Revert the "remove". Make it low on alpha channel

* Shuttle rotation light update fix

* We don't need this

* Possible runtime issue fix x2

* tgui.bundle.js update

* tgui.bundle.js update

* tgui.bundle.js update

* Revert config.toml changes

* Revert the revertion of config.toml changes

* Bring that config changes back!

* Entry added

* tgui.bundle.js update

* Prettier possible fix (?)

* Runtime fix (and broken tubes now have light after reinstalling them)

* config update

---------

Co-authored-by: Mikhail Dzianishchyts <mikhail.dzianishchyts@gmail.com>
This commit is contained in:
RomainzZ
2024-07-05 21:16:16 +00:00
committed by GitHub
co-authored by Mikhail Dzianishchyts
parent 97eb823d4e
commit e386cfd9bf
28 changed files with 774 additions and 54 deletions
@@ -14,6 +14,8 @@
toggles,
toggles_2,
sound,
light,
glowlevel,
volume_mixer,
lastchangelog,
exp,
@@ -896,7 +896,6 @@
return
switch(newgender)
if("Male")
active_character.gender = MALE
if("Female")
active_character.gender = FEMALE
@@ -954,6 +953,22 @@
if("ghost_att_anim")
toggles2 ^= PREFTOGGLE_2_ITEMATTACK
if("enablelighting")
var/datum/preference_toggle/special_toggle/toggle = GLOB.preference_toggles[/datum/preference_toggle/toggle_new_lighting]
toggle.set_toggles(user.client)
if("glowlevel")
var/datum/preference_toggle/special_toggle/toggle = GLOB.preference_toggles[/datum/preference_toggle/special_toggle/set_glow_level]
toggle.set_toggles(user.client)
if("exposure")
var/datum/preference_toggle/special_toggle/toggle = GLOB.preference_toggles[/datum/preference_toggle/toggle_lamp_exposure]
toggle.set_toggles(user.client)
if("glare")
var/datum/preference_toggle/special_toggle/toggle = GLOB.preference_toggles[/datum/preference_toggle/toggle_lamps_glare]
toggle.set_toggles(user.client)
if("winflash")
toggles2 ^= PREFTOGGLE_2_WINDOWFLASHING
+26 -2
View File
@@ -63,11 +63,15 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
var/toggles = TOGGLES_DEFAULT
var/toggles2 = TOGGLES_2_DEFAULT // Created because 1 column has a bitflag limit of 24 (BYOND limitation not MySQL)
var/sound = SOUND_DEFAULT
var/light = LIGHT_DEFAULT
/// Glow level for the lighting. Takes values from GLOW_HIGH to GLOW_DISABLE.
var/glowlevel = GLOW_MED
var/UI_style_color = "#ffffff"
var/UI_style_alpha = 255
var/clientfps = 63
var/atklog = ATKLOG_ALL
var/fuid // forum userid
/// Forum userid
var/fuid
/// Volume mixer, indexed by channel as TEXT (numerical indexes will not work). Volume goes from 0 to 100.
var/list/volume_mixer = list(
@@ -437,6 +441,23 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<b>View Range:</b> <a href='byond://?_src_=prefs;preference=setviewrange'>[viewrange]</a><br>"
dat += "<b>Window Flashing:</b> <a href='byond://?_src_=prefs;preference=winflash'>[(toggles2 & PREFTOGGLE_2_WINDOWFLASHING) ? "Yes" : "No"]</a><br>"
dat += "<b>Modsuit Activation Method:</b> <a href='byond://?_src_=prefs;preference=mam'>[(toggles2 & PREFTOGGLE_2_MOD_ACTIVATION_METHOD) ? "Middle Click" : "Alt Click"]</a><br>"
dat += "<b>Lighting settings:</b><br>"
dat += "<b> - New Lighting:</b> <a href='byond://?_src_=prefs;preference=enablelighting'>[(light & LIGHT_NEW_LIGHTING) ? "Yes" : "No"]</a><br>"
dat += "<b> - Glow Level:</b> <a href='byond://?_src_=prefs;preference=glowlevel'>"
switch(glowlevel)
if(GLOW_LOW)
dat += "Low"
if(GLOW_MED)
dat += "Medium"
if(GLOW_HIGH)
dat += "High"
if(GLOW_DISABLE)
dat += "Disabled"
else
dat += "Medium"
dat += "</a><br>"
dat += "<b> - Lamp Exposure:</b> <a href='byond://?_src_=prefs;preference=exposure'>[(light & LIGHT_EXPOSURE) ? "Yes" : "No"]</a><br>"
dat += "<b> - Lamp Glare:</b> <a href='byond://?_src_=prefs;preference=glare'>[(light & LIGHT_GLARE) ? "Yes" : "No"]</a><br>"
// RIGHT SIDE OF THE PAGE
dat += "</td><td width='405px' height='300px' valign='top'>"
dat += "<h2>Interface Settings</h2>"
@@ -603,7 +624,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
var/static/list/pref_toggles_by_category
if(!pref_toggles_by_category)
pref_toggles_by_category = list()
for(var/datum/preference_toggle/toggle as anything in GLOB.preference_toggles)
for(var/toggle_type in GLOB.preference_toggles)
var/datum/preference_toggle/toggle = GLOB.preference_toggles[toggle_type]
pref_toggles_by_category["[toggle.preftoggle_category]"] += list(toggle)
for(var/category in GLOB.preference_toggle_groups)
@@ -627,6 +649,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<td style='width: 20%'><a href='byond://?_src_=prefs;preference=preference_toggles;toggle=[toggle.UID()];'>[(toggles2 & toggle.preftoggle_bitflag) ? "<span class='good'>Enabled</span>" : "<span class='bad'>Disabled</span>"]</a></td>"
if(PREFTOGGLE_SOUND)
dat += "<td style='width: 20%'><a href='byond://?_src_=prefs;preference=preference_toggles;toggle=[toggle.UID()];'>[(sound & toggle.preftoggle_bitflag) ? "<span class='good'>Enabled</span>" : "<span class='bad'>Disabled</span>"]</a></td>"
if(PREFTOGGLE_LIGHT)
dat += "<td style='width: 20%'><a href='byond://?_src_=prefs;preference=preference_toggles;toggle=[toggle.UID()];'>[(light & toggle.preftoggle_bitflag) ? "<span class='good'>Enabled</span>" : "<span class='bad'>Disabled</span>"]</a></td>"
dat += "</tr>"
dat += "<tr><td colspan=4><br></td></tr>"
@@ -14,22 +14,24 @@
toggles = text2num(query.item[7])
toggles2 = text2num(query.item[8])
sound = text2num(query.item[9])
volume_mixer = deserialize_volume_mixer(query.item[10])
lastchangelog = query.item[11]
exp = query.item[12]
clientfps = text2num(query.item[13])
atklog = text2num(query.item[14])
fuid = text2num(query.item[15])
parallax = text2num(query.item[16])
_2fa_status = query.item[17]
screentip_mode = query.item[18]
screentip_color = query.item[19]
ghost_darkness_level = query.item[20]
colourblind_mode = query.item[21]
keybindings = init_keybindings(raw = query.item[22])
server_region = query.item[23]
raw_muted_admins = query.item[24]
viewrange = query.item[25]
light = text2num(query.item[10])
glowlevel = query.item[11]
volume_mixer = deserialize_volume_mixer(query.item[12])
lastchangelog = query.item[13]
exp = query.item[14]
clientfps = text2num(query.item[15])
atklog = text2num(query.item[16])
fuid = text2num(query.item[17])
parallax = text2num(query.item[18])
_2fa_status = query.item[19]
screentip_mode = query.item[20]
screentip_color = query.item[21]
ghost_darkness_level = query.item[22]
colourblind_mode = query.item[23]
keybindings = init_keybindings(raw = query.item[24])
server_region = query.item[25]
raw_muted_admins = query.item[26]
viewrange = query.item[27]
lastchangelog_2 = lastchangelog // Clone please
@@ -88,6 +90,8 @@
toggles_2=:toggles2,
atklog=:atklog,
sound=:sound,
light=:light,
glowlevel=:glowlevel,
volume_mixer=:volume_mixer,
lastchangelog=:lastchangelog,
clientfps=:clientfps,
@@ -114,6 +118,8 @@
"toggles2" = num2text(toggles2, CEILING(log(10, (TOGGLES_2_TOTAL)), 1)),
"atklog" = atklog,
"sound" = sound,
"light" = light,
"glowlevel" = glowlevel,
"volume_mixer" = serialize_volume_mixer(volume_mixer),
"lastchangelog" = lastchangelog,
"clientfps" = clientfps,
@@ -39,6 +39,9 @@
if(PREFTOGGLE_SOUND)
our_prefs.sound ^= preftoggle_bitflag
to_chat(user, "<span class='notice'>[(our_prefs.sound & preftoggle_bitflag) ? enable_message : disable_message]</span>")
if(PREFTOGGLE_LIGHT)
our_prefs.light ^= preftoggle_bitflag
to_chat(user, "<span class='notice'>[(our_prefs.light & preftoggle_bitflag) ? enable_message : disable_message]</span>")
SSblackbox.record_feedback("tally", "toggle_verbs", 1, blackbox_message)
our_prefs.save_preferences(user)
@@ -516,3 +519,80 @@
user.prefs.atklog = ATKLOG_NONE
to_chat(usr, "Your attack logs preference is now: show NO attack logs")
return ..()
/datum/preference_toggle/toggle_new_lighting
name = "Toggle New Lighting"
description = "Toggles new lighting"
preftoggle_bitflag = LIGHT_NEW_LIGHTING
preftoggle_toggle = PREFTOGGLE_LIGHT
preftoggle_category = PREFTOGGLE_CATEGORY_GENERAL
enable_message = "You've enabled new lighting."
disable_message = "You've disabled new lighting."
blackbox_message = "New lighting toggled"
/datum/preference_toggle/toggle_new_lighting/set_toggles(client/user)
. = ..()
if(length(user.screen))
var/atom/movable/screen/plane_master/exposure/exposure_master = locate() in user.screen
var/atom/movable/screen/plane_master/lamps_selfglow/glow_master = locate() in user.screen
var/atom/movable/screen/plane_master/lamps_glare/glare_master = locate() in user.screen
exposure_master.alpha = user.prefs.light & LIGHT_NEW_LIGHTING ? 255 : 0
exposure_master.backdrop(user.mob)
glow_master.backdrop(user.mob)
glare_master.backdrop(user.mob)
/datum/preference_toggle/special_toggle/set_glow_level
name = "Set Glow Level"
description = "Changes glow level of light sources"
preftoggle_category = PREFTOGGLE_CATEGORY_GENERAL
blackbox_message = "Changed glow level of light sources"
/datum/preference_toggle/special_toggle/set_glow_level/set_toggles(client/user)
var/glow_levels = list(
"Disable" = GLOW_DISABLE,
"Low" = GLOW_LOW,
"Medium (Default)" = GLOW_MED,
"High" = GLOW_HIGH,
)
var/new_level = tgui_input_list(user, "Set glow level of light sources", "Glow Level", glow_levels)
if(!new_level)
return
user.prefs.glowlevel = glow_levels[new_level]
to_chat(usr, "Glow level: [new_level].")
if(length(user.screen))
var/atom/movable/screen/plane_master/lamps_selfglow/glow_master = locate() in user.screen
glow_master.backdrop(user.mob)
return ..()
/datum/preference_toggle/toggle_lamp_exposure
name = "Toggle Lamp Exposure"
description = "Toggles lamp exposure"
preftoggle_bitflag = LIGHT_EXPOSURE
preftoggle_toggle = PREFTOGGLE_LIGHT
preftoggle_category = PREFTOGGLE_CATEGORY_GENERAL
enable_message = "You've enabled lamp exposure."
disable_message = "You've disabled lamp exposure."
blackbox_message = "Lamp exposure toggled"
/datum/preference_toggle/toggle_lamp_exposure/set_toggles(client/user)
. = ..()
if(length(user.screen))
var/atom/movable/screen/plane_master/exposure/exposure_master = locate() in user.screen
exposure_master.backdrop(user.mob)
/datum/preference_toggle/toggle_lamps_glare
name = "Toggle Lamp Glare"
description = "Toggles lamp glare"
preftoggle_bitflag = LIGHT_GLARE
preftoggle_toggle = PREFTOGGLE_LIGHT
preftoggle_category = PREFTOGGLE_CATEGORY_GENERAL
enable_message = "You've enabled lamp glare."
disable_message = "You've disabled lamp glare."
blackbox_message = "Lamp glare toggled"
/datum/preference_toggle/toggle_lamps_glare/set_toggles(client/user)
. = ..()
if(length(user.screen))
var/atom/movable/screen/plane_master/lamps_glare/glare_master = locate() in user.screen
glare_master.backdrop(user.mob)