From b7035f563f67fd7d2d58699c2cb1e5f507eee8ef Mon Sep 17 00:00:00 2001 From: Changelogs Date: Sat, 26 Feb 2022 00:53:45 +0000 Subject: [PATCH 1/2] Automatic changelog compile [ci skip] --- html/changelogs/AutoChangeLog-pr-15523.yml | 4 ---- html/changelogs/archive/2022-02.yml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-15523.yml diff --git a/html/changelogs/AutoChangeLog-pr-15523.yml b/html/changelogs/AutoChangeLog-pr-15523.yml deleted file mode 100644 index 48767debcb..0000000000 --- a/html/changelogs/AutoChangeLog-pr-15523.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Putnam3145" -delete-after: True -changes: - - balance: "Now slightly easier to get 50,000 points with toxins (50,000 point baseline changed from 200 light range to 175)" diff --git a/html/changelogs/archive/2022-02.yml b/html/changelogs/archive/2022-02.yml index 0715711ef7..d46305bd06 100644 --- a/html/changelogs/archive/2022-02.yml +++ b/html/changelogs/archive/2022-02.yml @@ -154,3 +154,7 @@ now' timothyteakettle: - rscadd: adds snake coiling +2022-02-26: + Putnam3145: + - balance: Now slightly easier to get 50,000 points with toxins (50,000 point baseline + changed from 200 light range to 175) From 45a49c6106374bae5376cecddd7993a3c2719073 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sat, 5 Mar 2022 13:49:26 -0300 Subject: [PATCH 2/2] Upload files --- code/__DEFINES/_flags/_flags.dm | 2 ++ code/_globalvars/bitfields.dm | 1 + code/_onclick/hud/hud.dm | 20 +++++++++++++++ code/_onclick/hud/screentip.dm | 19 ++++++++++++++ code/game/atoms.dm | 15 +++++------ code/game/turfs/simulated/floor.dm | 1 + code/modules/client/client_procs.dm | 1 + code/modules/client/preferences.dm | 10 ++++++++ code/modules/client/preferences_savefile.dm | 4 +++ interface/skin.dmf | 28 +++++++++++++++------ tgstation.dme | 1 + 11 files changed, 87 insertions(+), 15 deletions(-) create mode 100644 code/_onclick/hud/screentip.dm diff --git a/code/__DEFINES/_flags/_flags.dm b/code/__DEFINES/_flags/_flags.dm index 5f591b429b..a73841eff5 100644 --- a/code/__DEFINES/_flags/_flags.dm +++ b/code/__DEFINES/_flags/_flags.dm @@ -37,6 +37,8 @@ GLOBAL_LIST_INIT(bitflags, list( #define OVERLAY_QUEUED_1 (1<<8) ///Item has priority to check when entering or leaving. #define ON_BORDER_1 (1<<9) +///Whether or not this atom shows screentips when hovered over +#define NO_SCREENTIPS_1 (1<<10) ///Prevent clicking things below it on the same turf eg. doors/ fulltile windows. #define PREVENT_CLICK_UNDER_1 (1<<11) #define HOLOGRAM_1 (1<<12) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index df3b6e5334..2dc77d3bcb 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -160,6 +160,7 @@ GLOBAL_LIST_INIT(bitfields, list( "HOLOGRAM_1" = HOLOGRAM_1, "SHOCKED_1" = SHOCKED_1, "INITIALIZED_1" = INITIALIZED_1, + "NO_SCREENTIPS_1" = NO_SCREENTIPS_1, "ADMIN_SPAWNED_1" = ADMIN_SPAWNED_1, "BLOCK_FACE_ATOM_1" = BLOCK_FACE_ATOM_1, "PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1 diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index a5fe8f4ba8..fbd62f0565 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -53,6 +53,22 @@ GLOBAL_LIST_INIT(available_ui_styles, list( var/list/hand_slots // /atom/movable/screen/inventory/hand objects, assoc list of "[held_index]" = object var/list/atom/movable/screen/plane_master/plane_masters = list() // see "appearance_flags" in the ref, assoc list of "[plane]" = object + + ///UI for screentips that appear when you mouse over things + var/atom/movable/screen/screentip/screentip_text + + /// Whether or not screentips are enabled. + /// This is updated by the preference for cheaper reads than would be + /// had with a proc call, especially on one of the hottest procs in the + /// game (MouseEntered). + var/screentips_enabled = TRUE + + /// The color to use for the screentips. + /// This is updated by the preference for cheaper reads than would be + /// had with a proc call, especially on one of the hottest procs in the + /// game (MouseEntered). + var/screentip_color + var/atom/movable/screen/movable/action_button/hide_toggle/hide_actions_toggle var/action_buttons_hidden = FALSE @@ -83,6 +99,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list( plane_masters["[instance.plane]"] = instance instance.backdrop(mymob) + screentip_text = new(null, src) + static_inventory += screentip_text /datum/hud/Destroy() if(mymob.hud_used == src) @@ -117,6 +135,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list( QDEL_LIST(screenoverlays) mymob = null + QDEL_NULL(screentip_text) + return ..() diff --git a/code/_onclick/hud/screentip.dm b/code/_onclick/hud/screentip.dm new file mode 100644 index 0000000000..43b728ade6 --- /dev/null +++ b/code/_onclick/hud/screentip.dm @@ -0,0 +1,19 @@ +/atom/movable/screen/screentip + icon = null + icon_state = null + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + screen_loc = "TOP,LEFT" + maptext_height = 480 + maptext_width = 480 + maptext = "" + +/atom/movable/screen/screentip/Initialize(mapload, _hud) + . = ..() + hud = _hud + update_view() + +/atom/movable/screen/screentip/proc/update_view(datum/source) + SIGNAL_HANDLER + if(!hud || !hud.mymob.client.view_size) //Might not have been initialized by now + return + maptext_width = getviewsize(hud.mymob.client.view_size.getView())[1] * world.icon_size diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 40162a6c9b..925ac41a0b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1406,11 +1406,12 @@ //Update the screentip to reflect what we're hoverin over /atom/MouseEntered(location, control, params) . = ..() - // Statusbar - // status_bar_set_text(usr, name) // Screentips - // if(usr?.hud_used) - // if(!usr.client?.prefs.screentip_pref || (flags_1 & NO_SCREENTIPS_1)) - // usr.hud_used.screentip_text.maptext = "" - // else - // usr.hud_used.screentip_text.maptext = MAPTEXT("[name]") + var/client/client = usr?.client + var/datum/hud/active_hud = client?.mob?.hud_used + if(active_hud) + if(!client.prefs.screentip_pref || (flags_1 & NO_SCREENTIPS_1)) + active_hud.screentip_text.maptext = "" + else + //We inline a MAPTEXT() here, because there's no good way to statically add to a string like this + active_hud.screentip_text.maptext = MAPTEXT("[name]") diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 9b6767b874..5e2b5284e1 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -11,6 +11,7 @@ barefootstep = FOOTSTEP_HARD_BAREFOOT clawfootstep = FOOTSTEP_HARD_CLAW heavyfootstep = FOOTSTEP_GENERIC_HEAVY + flags_1 = NO_SCREENTIPS_1 /// Minimum explosion power to break tile var/explosion_power_break_tile = EXPLOSION_POWER_FLOOR_TILE_BREAK diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 9948802bc9..a1f9aacf18 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -1012,6 +1012,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( var/list/actualview = getviewsize(view) update_clickcatcher() parallax_holder.Reset() + mob.hud_used.screentip_text.update_view() mob.reload_fullscreen() if (isliving(mob)) var/mob/living/M = mob diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 3f31540fe2..5fcb6787d2 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -62,6 +62,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/UI_style = null var/outline_enabled = TRUE var/outline_color = COLOR_THEME_MIDNIGHT + var/screentip_pref = TRUE + var/screentip_color = "#ffd391" var/buttons_locked = FALSE var/hotkeys = FALSE @@ -788,6 +790,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "UI Style: [UI_style]
" dat += "Outline: [outline_enabled ? "Enabled" : "Disabled"]
" dat += "Outline Color: [outline_color ? "" : "Theme-based (null)"]    Change
" + dat += "Screentip: [screentip_pref ? "Enabled" : "Disabled"]
" + dat += "Screentip Color:     Change
" dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
" dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
" dat += "Show Runechat Chat Bubbles: [chat_on_map ? "Enabled" : "Disabled"]
" @@ -2748,6 +2752,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/pickedOutlineColor = input(user, "Choose your outline color.", "General Preference", outline_color) as color|null if(pickedOutlineColor != pickedOutlineColor) outline_color = pickedOutlineColor // nullable + if("screentip_pref") + screentip_pref = !screentip_pref + if("screentip_color") + var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null + if(pickedScreentipColor) + screentip_color = pickedScreentipColor if("tgui_lock") tgui_lock = !tgui_lock if("winflash") diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 72b2f5d949..628a51ed44 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -385,6 +385,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["UI_style"] >> UI_style S["outline_color"] >> outline_color S["outline_enabled"] >> outline_enabled + S["screentip_pref"] >> screentip_pref + S["screentip_color"] >> screentip_color S["hotkeys"] >> hotkeys S["chat_on_map"] >> chat_on_map S["max_chat_length"] >> max_chat_length @@ -567,6 +569,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["UI_style"], UI_style) WRITE_FILE(S["outline_enabled"], outline_enabled) WRITE_FILE(S["outline_color"], outline_color) + WRITE_FILE(S["screentip_pref"], screentip_pref) + WRITE_FILE(S["screentip_color"], screentip_color) WRITE_FILE(S["hotkeys"], hotkeys) WRITE_FILE(S["chat_on_map"], chat_on_map) WRITE_FILE(S["max_chat_length"], max_chat_length) diff --git a/interface/skin.dmf b/interface/skin.dmf index ccfcd76571..82a35160e6 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -2,21 +2,21 @@ macro "default" menu "menu" - elem + elem name = "&File" command = "" saved-params = "is-checked" - elem + elem name = "&Quick screenshot\tF2" command = ".screenshot auto" category = "&File" saved-params = "is-checked" - elem + elem name = "&Save screenshot as...\tShift+F2" command = ".screenshot" category = "&File" saved-params = "is-checked" - elem + elem name = "" command = "" category = "&File" @@ -26,21 +26,21 @@ menu "menu" command = ".reconnect" category = "&File" saved-params = "is-checked" - elem + elem name = "&Quit\tAlt-F4" command = ".quit" category = "&File" saved-params = "is-checked" - elem + elem name = "&Help" command = "" saved-params = "is-checked" - elem + elem name = "&Admin Help\tF1" command = "adminhelp" category = "&Help" saved-params = "is-checked" - elem + elem name = "&Hotkeys" command = "hotkeys-help" category = "&Help" @@ -56,6 +56,7 @@ window "mainwindow" anchor2 = none is-default = true saved-params = "pos;size;is-minimized;is-maximized" + statusbar = false icon = 'icons\\ss13_64.png' macro = "default" menu = "menu" @@ -95,6 +96,7 @@ window "mapwindow" anchor2 = none saved-params = "pos;size;is-minimized;is-maximized" is-pane = true + on-status = ".winset \"status_bar.text=[[*]]\" " elem "map" type = MAP pos = 0,0 @@ -107,6 +109,16 @@ window "mapwindow" is-default = true saved-params = "zoom;letterbox;zoom-mode" style = ".center { text-align: center; } .maptext { font-family: 'Small Fonts'; font-size: 7px; -dm-text-outline: 1px black; color: white; line-height: 1.1; } .command_headset { font-weight: bold;\tfont-size: 8px; } .small { font-size: 6px; } .big { font-size: 8px; } .reallybig { font-size: 8px; } .extremelybig { font-size: 8px; } .greentext { color: #00FF00; font-size: 7px; } .redtext { color: #FF0000; font-size: 7px; } .clown { color: #FF69Bf; font-size: 7px; font-weight: bold; } .his_grace { color: #15D512; } .hypnophrase { color: #0d0d0d; font-weight: bold; } .yell { font-weight: bold; } .italics { font-size: 6px; }" + elem "status_bar" + type = LABEL + pos = 0,1008 + size = 280x16 + anchor1 = 0,100 + text = "" + align = left + background-color = #222222 + text-color = #ffffff + border = line window "infowindow" elem "infowindow" diff --git a/tgstation.dme b/tgstation.dme index 8c7f064d60..eafcf93610 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -288,6 +288,7 @@ #include "code\_onclick\hud\revenanthud.dm" #include "code\_onclick\hud\robot.dm" #include "code\_onclick\hud\screen_objects.dm" +#include "code\_onclick\hud\screentip.dm" #include "code\_onclick\hud\simple_animal.dm" #include "code\_onclick\hud\swarmer.dm" #include "code\_onclick\hud\screen_objects\clickdelay.dm"