diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index f465317db9c..0e849bb3371 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -25,6 +25,7 @@ #define CHAT_NO_ADMINLOGS 16384 #define DONATOR_PUBLIC 32768 #define CHAT_NO_TICKETLOGS 65536 +#define UI_DARKMODE 131072 #define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 50176f96c5e..c6f057a982b 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -366,9 +366,16 @@ send_resources() + if(prefs.toggles & UI_DARKMODE) // activates dark mode if its flagged. -AA07 + if(establish_db_connection()) + activate_darkmode() + if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates. -CP if(establish_db_connection()) - winset(src, "rpane.changelog", "background-color=#f4aa94;font-style=bold") + if(prefs.toggles & UI_DARKMODE) + winset(src, "rpane.changelog", "background-color=#bb7700;font-style=bold") + else + winset(src, "rpane.changelog", "background-color=#f4aa94;text-color=#FFFFFF;font-style=bold") to_chat(src, "Changelog has changed since your last visit.") if(!void) @@ -660,3 +667,50 @@ /client/proc/on_varedit() var_edited = TRUE + +///////////////// +// DARKMODE UI // +///////////////// +// IF YOU CHANGE ANYTHING IN ACTIVATE, MAKE SURE IT HAS A DEACTIVATE METHOD, -AA07 +/client/proc/activate_darkmode() + ///// BUTTONS ///// + /* Rpane */ + winset(src, "rpane.textb", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.infob", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.wikib", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.forumb", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.rulesb", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.githubb", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "rpane.changelog", "background-color=#40628a;text-color=#FFFFFF") + /* Mainwindow */ + winset(src, "mainwindow.saybutton", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "mainwindow.mebutton", "background-color=#40628a;text-color=#FFFFFF") + winset(src, "mainwindow.hotkey_toggle", "background-color=#40628a;text-color=#FFFFFF") + ///// UI ELEMENTS ///// + /* Mainwindow */ + winset(src, "mainwindow.mainwindow", "background-color=#272727") + winset(src, "mainwindow.asset_cache_browser", "background-color=#272727") + winset(src, "mainwindow.mainvsplit", "background-color=#272727") + winset(src, "mainwindow.tooltip", "background-color=#272727") + /* Mapwindow */ + winset(src, "mapwindow.mapwindow", "background-color=#272727") + winset(src, "mapwindow.map", "background-color=#272727") + /* Outputwindow */ + winset(src, "outputwindow.outputwindow", "background-color=#272727") + winset(src, "outputwindow.browseroutput", "background-color=#272727") + /* Rpane */ + winset(src, "rpane.rpane", "background-color=#272727") + winset(src, "rpane.rpanewindow", "background-color=#272727") + /* Browserwindow */ + winset(src, "browserwindow.browserwindow", "background-color=#272727") + winset(src, "browserwindow.browser", "background-color=#272727") + /* Infowindow */ + winset(src, "infowindow.infowindow", "background-color=#272727;text-color=#FFFFFF") + winset(src, "infowindow.info", "background-color=#272727;text-color=#FFFFFF;highlight-color=#009900;tab-text-color=#FFFFFF;tab-background-color=#272727") + // NOTIFY USER + to_chat(src, "Darkmode Enabled") + +/client/proc/deactivate_darkmode() + ///// BUTTONS ///// + ///// NOTIFY USER ///// + to_chat(src, "Darkmode Disabled") // what a sick fuck \ No newline at end of file diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm index 086040b5595..878cdb1f4a6 100644 --- a/code/modules/client/preference/preferences_mysql.dm +++ b/code/modules/client/preference/preferences_mysql.dm @@ -55,7 +55,7 @@ ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor)) 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)) + toggles = sanitize_integer(toggles, 0, 262143, initial(toggles)) sound = sanitize_integer(sound, 0, 65535, initial(sound)) UI_style_color = sanitize_hexcolor(UI_style_color, initial(UI_style_color)) UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha)) diff --git a/code/modules/client/preference/preferences_toggles.dm b/code/modules/client/preference/preferences_toggles.dm index 40804aa83b2..655f244e7bd 100644 --- a/code/modules/client/preference/preferences_toggles.dm +++ b/code/modules/client/preference/preferences_toggles.dm @@ -195,4 +195,16 @@ 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) \ No newline at end of file + prefs.ShowChoices(usr) + +/client/verb/toggle_darkmode() + set name = "Toggle Darkmode" + set category = "Preferences" + set desc = "Toggles UI style between dark and light" + prefs.toggles ^= UI_DARKMODE + prefs.save_preferences(src) + if(prefs.toggles & UI_DARKMODE) + activate_darkmode() + else + deactivate_darkmode() + feedback_add_details("admin_verb","TDarkmode") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! \ No newline at end of file diff --git a/icons/paradise.png b/icons/paradise.png new file mode 100644 index 00000000000..9b7e3b6db3d Binary files /dev/null and b/icons/paradise.png differ diff --git a/interface/skin.dmf b/interface/skin.dmf index ab8e7ef370c..996edf78905 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1523,7 +1523,7 @@ window "mainwindow" is-default = true is-maximized = true title = "Paradise Station 13" - icon = 'icons\\ss13_64.png' + icon = 'icons\\paradise.png' menu = "menu" macro = "macro" saved-params = "pos;size;is-minimized;is-maximized" @@ -1658,7 +1658,7 @@ window "rpane" show-splitter = true elem "textb" type = BUTTON - pos = 0,0 + pos = 0,7 size = 60x16 is-visible = false saved-params = "is-checked" @@ -1669,7 +1669,7 @@ window "rpane" button-type = pushbox elem "infob" type = BUTTON - pos = 64,0 + pos = 64,7 size = 60x16 is-visible = false saved-params = "is-checked" @@ -1679,37 +1679,37 @@ window "rpane" button-type = pushbox elem "wikib" type = BUTTON - pos = 155,0 + pos = 155,7 size = 60x16 text = "Wiki" command = "wiki" elem "forumb" type = BUTTON - pos = 220,0 + pos = 220,7 size = 60x16 text = "Forum" command = "forum" elem "rulesb" type = BUTTON - pos = 285,0 + pos = 285,7 size = 60x16 text = "Rules" command = "rules" elem "githubb" type = BUTTON - pos = 350,0 + pos = 350,7 size = 60x16 text = "GitHub" command = "github" elem "changelog" type = BUTTON - pos = 415,0 + pos = 415,7 size = 67x16 text = "Changelog" command = "Changelog" elem "discordb" type = BUTTON - pos = 487,0 + pos = 487,7 size = 60x16 background-color = #7289DA text-color = #FFFFFF @@ -1718,7 +1718,7 @@ window "rpane" command = "discord" elem "karma" type = BUTTON - pos = 552,0 + pos = 552,7 size = 60x16 background-color = #FF4500 text-color = #FFFFFF @@ -1727,7 +1727,7 @@ window "rpane" command = "karmashop" elem "donate" type = BUTTON - pos = 617,0 + pos = 617,7 size = 60x16 background-color = #008000 text-color = #FFFFFF @@ -1736,7 +1736,7 @@ window "rpane" command = "Donate" elem "browseb" type = BUTTON - pos = 561,0 + pos = 561,7 size = 60x16 is-visible = false saved-params = "is-checked" @@ -1758,8 +1758,8 @@ window "browserwindow" anchor1 = 0,0 anchor2 = 100,100 is-default = true - on-show = ".winset\"rpane.infob.is-visible=true?rpane.infob.pos=130,0;rpane.textb.is-visible=true;rpane.browseb.is-visible=true;rpane.browseb.is-checked=true;rpane.rpanewindow.pos=0,30;rpane.rpanewindow.size=0x0;rpane.rpanewindow.left=browserwindow\"" - on-hide = ".winset\"rpane.infob.is-visible=true?rpane.infob.is-checked=true rpane.infob.pos=65,0 rpane.rpanewindow.left=infowindow:rpane.rpanewindow.left=textwindow rpane.textb.is-visible=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0\"" + on-show = ".winset\"rpane.infob.is-visible=true?rpane.infob.pos=130,7;rpane.textb.is-visible=true;rpane.browseb.is-visible=true;rpane.browseb.is-checked=true;rpane.rpanewindow.pos=0,30;rpane.rpanewindow.size=0x0;rpane.rpanewindow.left=browserwindow\"" + on-hide = ".winset\"rpane.infob.is-visible=true?rpane.infob.is-checked=true rpane.infob.pos=65,7 rpane.rpanewindow.left=infowindow:rpane.rpanewindow.left=textwindow rpane.textb.is-visible=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0\"" window "infowindow" elem "infowindow" @@ -1778,5 +1778,5 @@ window "infowindow" tab-text-color = #000000 allow-html = true multi-line = true - on-show = ".winset\"rpane.infob.is-visible=true;rpane.browseb.is-visible=true?rpane.infob.pos=130,0:rpane.infob.pos=65,0 rpane.textb.is-visible=true rpane.infob.is-checked=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0 rpane.rpanewindow.left=infowindow\"" + on-show = ".winset\"rpane.infob.is-visible=true;rpane.browseb.is-visible=true?rpane.infob.pos=130,7:rpane.infob.pos=65,7 rpane.textb.is-visible=true rpane.infob.is-checked=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0 rpane.rpanewindow.left=infowindow\"" on-hide = ".winset\"rpane.infob.is-visible=false;rpane.browseb.is-visible=true?rpane.browseb.is-checked=true rpane.rpanewindow.left=browserwindow:rpane.textb.is-visible=true rpane.rpanewindow.pos=0,30 rpane.rpanewindow.size=0x0 rpane.rpanewindow.left=\""