Status Bar: Reloaded: Revengeance - Back to Perfection (#57531)

This commit is contained in:
Aleksej Komarov
2021-03-09 10:16:35 +02:00
committed by GitHub
parent 39727344b1
commit 51efbbe0f2
4 changed files with 38 additions and 3 deletions

View File

@@ -1925,7 +1925,10 @@
//Update the screentip to reflect what we're hoverin over
/atom/MouseEntered(location, control, params)
. = ..()
if(flags_1 & NO_SCREENTIPS_1 || !usr?.client?.prefs.screentip_pref)
// Statusbar
status_bar_set_text(usr, name)
// Screentips
if(!usr?.client?.prefs.screentip_pref || (flags_1 & NO_SCREENTIPS_1))
usr.hud_used.screentip_text.maptext = ""
return
usr.hud_used.screentip_text.maptext = MAPTEXT("<span style='text-align: center'><span style='font-size: 32px'><span style='color:[usr.client.prefs.screentip_color]: 32px'>[name]</span>")
else
usr.hud_used.screentip_text.maptext = MAPTEXT("<span style='text-align: center'><span style='font-size: 32px'><span style='color:[usr.client.prefs.screentip_color]: 32px'>[name]</span>")

View File

@@ -0,0 +1,20 @@
/*!
* Copyright (c) 2021 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
/client/var/status_bar_prev_text = ""
/**
* Set status bar text for the provided `target`.
*
* Target can be either of `/client` or `/mob`.
*/
/proc/status_bar_set_text(target, text)
var/client/client = CLIENT_FROM_VAR(target)
// Stop a winset call if text didn't change.
if(!client || client.status_bar_prev_text == text)
return
client.status_bar_prev_text = text
winset(client, "mapwindow.status_bar",
"text=[url_encode(text)]&is-visible=[!!text]")

View File

@@ -116,6 +116,17 @@ window "mapwindow"
right-click = 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,464
size = 280x16
anchor1 = 0,100
is-visible = false
text = ""
align = left
background-color = #222222
text-color = #ffffff
border = line
window "infowindow"
elem "infowindow"

View File

@@ -3252,6 +3252,7 @@
#include "code\modules\station_goals\dna_vault.dm"
#include "code\modules\station_goals\shield.dm"
#include "code\modules\station_goals\station_goal.dm"
#include "code\modules\status_bar\status_bar.dm"
#include "code\modules\surgery\amputation.dm"
#include "code\modules\surgery\blood_filter.dm"
#include "code\modules\surgery\bone_mending.dm"