Changelog Overhaul (#13051)

* Changelog Overhaul

* SQL Update

* This is why I hate merge conflicts

* Comment Correction

* Farie Fixes + Tested with blank DB

* Colours + Titles

* Colour tweaks

* I fell victim to my own CI Chains!

* Cleans up the remains of the old changelogs

* Fixes formatting

* Kyet Changes

* Date
This commit is contained in:
AffectedArc07
2020-05-18 08:34:28 +01:00
committed by GitHub
parent b2b12c36e8
commit 7ea6f190c5
62 changed files with 15167 additions and 14542 deletions
+6 -24
View File
@@ -373,13 +373,11 @@
send_resources()
if(prefs.toggles & UI_DARKMODE) // activates dark mode if its flagged. -AA07
if(establish_db_connection())
activate_darkmode()
activate_darkmode()
else
// activate_darkmode() calls the CL update button proc, so we dont want it double called
SSchangelog.UpdatePlayerChangelogButton(src)
if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates. -CP
if(establish_db_connection())
to_chat(src, "<span class='info'>Changelog has changed since your last visit.</span>")
update_changelog_button()
if(prefs.toggles & DISABLE_KARMA) // activates if karma is disabled
if(establish_db_connection())
@@ -825,7 +823,7 @@
// IF YOU CHANGE ANYTHING IN ACTIVATE, MAKE SURE IT HAS A DEACTIVATE METHOD, -AA07
/client/proc/activate_darkmode()
///// BUTTONS /////
update_changelog_button()
SSchangelog.UpdatePlayerChangelogButton(src)
/* Rpane */
winset(src, "rpane.textb", "background-color=#40628a;text-color=#FFFFFF")
winset(src, "rpane.infob", "background-color=#40628a;text-color=#FFFFFF")
@@ -857,7 +855,7 @@
/client/proc/deactivate_darkmode()
///// BUTTONS /////
update_changelog_button()
SSchangelog.UpdatePlayerChangelogButton(src)
/* Rpane */
winset(src, "rpane.textb", "background-color=none;text-color=#000000")
winset(src, "rpane.infob", "background-color=none;text-color=#000000")
@@ -887,22 +885,6 @@
///// NOTIFY USER /////
to_chat(src, "<span class='notice'>Darkmode Disabled</span>") // what a sick fuck
// Better changelog button handling
/client/proc/update_changelog_button()
if(establish_db_connection())
if(prefs.lastchangelog != GLOB.changelog_hash)
winset(src, "rpane.changelog", "background-color=#bb7700;text-color=#FFFFFF;font-style=bold")
else
if(prefs.toggles & UI_DARKMODE)
winset(src, "rpane.changelog", "background-color=#40628a;text-color=#FFFFFF")
else
winset(src, "rpane.changelog", "background-color=none;text-color=#000000")
else
if(prefs.toggles & UI_DARKMODE)
winset(src, "rpane.changelog", "background-color=#40628a;text-color=#FFFFFF")
else
winset(src, "rpane.changelog", "background-color=none;text-color=#000000")
/client/proc/generate_clickcatcher()
if(!void)
void = new()
@@ -79,7 +79,7 @@ GLOBAL_LIST_INIT(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 = "1" //Saved changlog timestamp (unix epoch) to detect if there was a change. Dont set this to 0 unless you want the last changelog date to be 4x longer than the expected lifespan of the universe.
var/exp
var/ooccolor = "#b82e00"
var/list/be_special = list() //Special role selection
@@ -491,18 +491,3 @@
load_character(C,pick(saves))
return 1
/datum/preferences/proc/SetChangelog(client/C,hash)
lastchangelog=hash
var/datum/preferences/P = GLOB.preferences_datums[C.ckey]
if(P.toggles & UI_DARKMODE)
winset(C, "rpane.changelog", "background-color=#40628a;font-color=#ffffff;font-style=none")
else
winset(C, "rpane.changelog", "background-color=none;font-style=none")
var/DBQuery/query = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] 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")
to_chat(C, "Couldn't update your last seen changelog, please try again later.")
return
return 1