[READY] Widescreen (#20861)

* TM Needed - Widescreen

* A lot of fixes

* TM notice

* Feedback thread

* Minor tweaks

* Expans silicon view stuff

* Fix viewmods

* The preferential option

* Why were these global

* Fix clickcatch sizing, fix parallax issues

* Maybe fixes the runtime

* READY
This commit is contained in:
AffectedArc07
2023-06-07 21:09:16 +01:00
committed by GitHub
parent fa7e321f10
commit 48b0210064
30 changed files with 264 additions and 189 deletions
+1 -1
View File
@@ -56,7 +56,7 @@
preload_rsc = 0 // This is 0 so we can set it to an URL once the player logs in and have them download the resources from a different server.
var/global/obj/screen/click_catcher/void
var/obj/screen/click_catcher/void
var/ip_intel = "Disabled"
+13 -3
View File
@@ -322,6 +322,9 @@
// ToS accepted
tos_consent = TRUE
// Setup widescreen
view = prefs.viewrange
prefs.init_keybindings(prefs.keybindings_overrides) //The earliest sane place to do it where prefs are not null, if they are null you can't do crap at lobby
prefs.last_ip = address //these are gonna be used for banning
prefs.last_id = computer_id //these are gonna be used for banning
@@ -371,6 +374,10 @@
winset(src, null, "command=\".configure graphics-hwmode off\"")
winset(src, null, "command=\".configure graphics-hwmode on\"")
// Try doing this before mob login
generate_clickcatcher()
apply_clickcatcher()
. = ..() //calls mob.Login()
mob.update_client_colour(0) // Activate colourblind mode if they have one set
@@ -394,9 +401,6 @@
// activate_darkmode() calls the CL update button proc, so we dont want it double called
SSchangelog.UpdatePlayerChangelogButton(src)
generate_clickcatcher()
apply_clickcatcher()
if(show_update_prompt)
show_update_notice()
@@ -433,6 +437,7 @@
to_chat(src, "<span class='notice'>You are currently connected [prefs.server_region ? "via the <b>[prefs.server_region]</b> relay" : "directly"] to Paradise.</span>")
to_chat(src, "<span class='notice'>You can change this using the <code>Change Region</code> verb in the OOC tab, as selecting a region closer to you may reduce latency.</span>")
/client/proc/is_connecting_from_localhost()
var/static/list/localhost_addresses = list("127.0.0.1", "::1")
if((!address && !world.port) || (address in localhost_addresses))
@@ -1251,6 +1256,11 @@
winset(src, null, "command=\".configure graphics-hwmode off\"")
winset(src, null, "command=\".configure graphics-hwmode on\"")
/// Returns the biggest number from client.view so we can do easier maths
/client/proc/maxview()
var/list/screensize = getviewsize(view)
return max(screensize[1], screensize[2])
#undef LIMITER_SIZE
#undef CURRENT_SECOND
#undef SECOND_COUNT
@@ -28,7 +28,8 @@
colourblind_mode,
keybindings,
server_region,
muted_adminsounds_ckeys
muted_adminsounds_ckeys,
viewrange
FROM player
WHERE ckey=:ckey"}, list(
"ckey" = C.ckey
@@ -937,6 +937,24 @@
if("winflash")
toggles2 ^= PREFTOGGLE_2_WINDOWFLASHING
if("setviewrange")
var/list/viewrange_options = list(
"15x15 (Classic)" = "15x15",
"17x15 (Wide)" = "17x15",
"19x15 (Ultrawide)" = "19x15"
)
var/new_range = input(user, "Select a view range") as anything in viewrange_options
var/actual_new_range = viewrange_options[new_range]
viewrange = actual_new_range
if(actual_new_range != parent.view)
parent.view = actual_new_range
// Update the size of the click catcher
var/list/actualview = getviewsize(parent.view)
parent.void.UpdateGreed(actualview[1],actualview[2])
if("afk_watch")
if(!(toggles2 & PREFTOGGLE_2_AFKWATCH))
to_chat(user, "<span class='info'>You will now get put into cryo dorms after [GLOB.configuration.afk.auto_cryo_minutes] minutes. \
@@ -128,6 +128,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
var/server_region = null
/// List of admin ckeys this player wont hear sounds from
var/list/admin_sound_ckey_ignore = list()
/// View range preference for this client
var/viewrange = DEFAULT_CLIENT_VIEWSIZE
/datum/preferences/New(client/C, datum/db_query/Q) // Process our query
parent = C
@@ -431,6 +433,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<b>Play Lobby Music:</b> <a href='?_src_=prefs;preference=lobby_music'><b>[(sound & SOUND_LOBBY) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Randomized Character Slot:</b> <a href='?_src_=prefs;preference=randomslot'><b>[toggles2 & PREFTOGGLE_2_RANDOMSLOT ? "Yes" : "No"]</b></a><br>"
dat += "<b>Thought Bubble:</b> <a href='?_src_=prefs;preference=thought_bubble'>[(toggles2 & PREFTOGGLE_2_THOUGHT_BUBBLE) ? "Yes" : "No"]</a><br>"
dat += "<b>View Range:</b> <a href='?_src_=prefs;preference=setviewrange'>[viewrange]</a><br>"
dat += "<b>Window Flashing:</b> <a href='?_src_=prefs;preference=winflash'>[(toggles2 & PREFTOGGLE_2_WINDOWFLASHING) ? "Yes" : "No"]</a><br>"
// RIGHT SIDE OF THE PAGE
dat += "</td><td width='300px' height='300px' valign='top'>"
@@ -573,7 +576,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<a href='?_src_=prefs;preference=reset_all'>Reset Setup</a>"
dat += "</center>"
var/datum/browser/popup = new(user, "preferences", "<div align='center'>Character Setup</div>", 820, 720)
var/datum/browser/popup = new(user, "preferences", "<div align='center'>Character Setup</div>", 820, 770)
popup.set_content(dat.Join(""))
popup.open(FALSE)
@@ -29,6 +29,7 @@
keybindings = init_keybindings(raw = query.item[22])
server_region = query.item[23]
raw_muted_admins = query.item[24]
viewrange = query.item[25]
lastchangelog_2 = lastchangelog // Clone please
@@ -98,7 +99,8 @@
colourblind_mode=:colourblind_mode,
keybindings=:keybindings,
server_region=:server_region,
muted_adminsounds_ckeys=:muted_adminsounds_ckeys
muted_adminsounds_ckeys=:muted_adminsounds_ckeys,
viewrange=:viewrange
WHERE ckey=:ckey"}, list(
// OH GOD THE PARAMETERS
"ooccolour" = ooccolor,
@@ -125,6 +127,7 @@
"ckey" = C.ckey,
"server_region" = server_region,
"muted_adminsounds_ckeys" = json_encode(admin_sound_ckey_ignore),
"viewrange" = viewrange,
))
if(!query.warn_execute())
+7 -5
View File
@@ -38,22 +38,24 @@
var/datum/viewmod/V = ViewMods[mod_id]
highest_range = max(highest_range, V.size)
SetView(highest_range ? highest_range : world.view)
SetView(highest_range ? highest_range : prefs.viewrange)
ViewModsActive = (highest_range > 0)
/client/proc/SetView(view_range)
if(view_range == world.view)
if(view_range == prefs.viewrange)
winset(src, "mapwindow.map", "icon-size=[ViewPreferedIconSize]")
else
winset(src, "mapwindow.map", "icon-size=0")
view = view_range
if(mob && mob.hud_used)
var/view_range_calc = maxview()
if(mob?.hud_used)
// If view range is less than world.view, assume the HUD will not fit under normal mode and turn it to reduced
if(view_range < world.view)
if(view_range_calc < world.view)
// If it's really tiny, turn their hud off completely
if(view_range <= ARBITRARY_VIEWRANGE_NOHUD)
if(view_range_calc <= ARBITRARY_VIEWRANGE_NOHUD)
mob.hud_used.show_hud(HUD_STYLE_NOHUD)
else
mob.hud_used.show_hud(HUD_STYLE_REDUCED)