mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Adds unread changes notification
This commit is contained in:
@@ -308,6 +308,11 @@
|
||||
|
||||
send_resources()
|
||||
|
||||
if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates. -CP
|
||||
winset(src, "rpane.changelog", "background-color=#f4aa94;font-style=bold")
|
||||
prefs.SetChangelog(src,changelog_hash)
|
||||
src << "<span class='info'>Changelog has changed since your last visit.</span>"
|
||||
|
||||
if(!void)
|
||||
void = new()
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
|
||||
var/last_id
|
||||
|
||||
//game-preferences
|
||||
// var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
|
||||
var/lastchangelog = "" //Saved changelog filesize to detect if there was a change
|
||||
var/ooccolor = "#b82e00"
|
||||
var/be_special = list() //Special role selection
|
||||
var/UI_style = "Midnight"
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
randomslot,
|
||||
volume,
|
||||
nanoui_fancy,
|
||||
show_ghostitem_attack
|
||||
show_ghostitem_attack,
|
||||
lastchangelog
|
||||
FROM [format_table_name("player")]
|
||||
WHERE ckey='[C.ckey]'"}
|
||||
)
|
||||
@@ -38,10 +39,10 @@
|
||||
volume = text2num(query.item[10])
|
||||
nanoui_fancy = text2num(query.item[11])
|
||||
show_ghostitem_attack = text2num(query.item[12])
|
||||
lastchangelog = query.item[13]
|
||||
|
||||
//Sanitize
|
||||
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
|
||||
// lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style))
|
||||
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
|
||||
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
|
||||
@@ -52,6 +53,7 @@
|
||||
volume = sanitize_integer(volume, 0, 100, initial(volume))
|
||||
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))
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences(client/C)
|
||||
@@ -75,7 +77,8 @@
|
||||
randomslot='[randomslot]',
|
||||
volume='[volume]',
|
||||
nanoui_fancy='[nanoui_fancy]',
|
||||
show_ghostitem_attack='[show_ghostitem_attack]'
|
||||
show_ghostitem_attack='[show_ghostitem_attack]',
|
||||
lastchangelog='[lastchangelog]',
|
||||
WHERE ckey='[C.ckey]'"}
|
||||
)
|
||||
|
||||
@@ -449,4 +452,14 @@
|
||||
load_character(C)
|
||||
return 0
|
||||
load_character(C,pick(saves))
|
||||
return 1*/
|
||||
return 1*/
|
||||
|
||||
/datum/preferences/proc/SetChangelog(client/C,hash)
|
||||
lastchangelog=hash
|
||||
var/DBQuery/query = dbcon.NewQuery("UPDATE client SET lastchangelog='[lastchangelog]' WHERE ckey='[C.ckey]'")
|
||||
if(!query.Execute())
|
||||
var/err = query.ErrorMsg()
|
||||
log_game("SQL ERROR during lastchangelog updating. Error : \[[err]\]\n")
|
||||
message_admins("SQL ERROR during lastchangelog updating. Error : \[[err]\]\n")
|
||||
return
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user