Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] 516 relay screen_loc #13713

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions code/_onclick/hud/rendering/plane_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
// set to null if you don't want to render plane on anything (for example, if you want to use it for filters)
// todo: make it associative list(PLANE = BLEND_MODE) if we ever need different blend_mode for different relays
var/list/render_relay_planes = list(RENDER_PLANE_GAME)
var/relay_loc = "1,1"

var/no_render_target = FALSE

Expand All @@ -40,8 +41,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
// here I assume that plane always exists with client and we don't need to destroy it,
// so there is no need to keep render_plane_relay referenced anywhere except for client.screen
// for outer maps we just cleanup it all at once based on assigned_map value
var/atom/movable/screen/render_plane_relay/relay = new(null, src, relay_plane)

var/atom/movable/screen/render_plane_relay/relay = new(null, src, relay_plane, relay_loc)
. += relay

// Apply/update plane filters and other effects, can be called multiple times
Expand Down Expand Up @@ -75,3 +75,8 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/plane_master)
if(map_view && map_view != plane.assigned_map)
continue
plane.update_effects(src)

// delete this with 516 release
/client/proc/update_relays(relay_loc)
for(var/atom/movable/screen/render_plane_relay/relay in screen)
relay.screen_loc = relay_loc
Comment on lines +82 to +83
Copy link
Member

@volas volas Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут проблема с камерами, у всех /atom/movable/screen/map_view сбрасывается плейн на уровень игры, т.к. byond использует переменную одновременно и для координат, и для экрана.

if(map_view)
assigned_map = map_view
// don't use fixed size, it can break map_view scaling
screen_loc = "[map_view]:1,1"

думаю костыль с проверкой версии клиента можно было бы вытащить в /atom/movable/screen/plane_master/atom_init()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

атом_инит не совсем подходит, потому что плейны (за исключением камер) всего раз создаются и хранятся, а игрок может зайти с 515 и перезайти с 516

закоммитил фикс, реле теперь должно нормально на камерах сидеть

6 changes: 3 additions & 3 deletions code/_onclick/hud/rendering/render_plane_relay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

INITIALIZE_IMMEDIATE(/atom/movable/screen/render_plane_relay)
/atom/movable/screen/render_plane_relay
screen_loc = "CENTER"
screen_loc = "1,1"
layer = -1
plane = 0
appearance_flags = PASS_MOUSE | NO_CLIENT_COLOR | KEEP_TOGETHER

/atom/movable/screen/render_plane_relay/atom_init(mapload, atom/movable/screen/plane_master/source_plane, render_plane)
/atom/movable/screen/render_plane_relay/atom_init(mapload, atom/movable/screen/plane_master/source_plane, render_plane, relay_loc)
. = ..()

name = source_plane.render_target

render_source = source_plane.render_target

assigned_map = source_plane.assigned_map // for cleaning external maps
screen_loc = source_plane.screen_loc
screen_loc = relay_loc

plane = render_plane
layer = (source_plane.plane + abs(LOWEST_EVER_PLANE)) * 0.5 //layer must be positive but can be a decimal
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
client.perspective = MOB_PERSPECTIVE

client.update_plane_masters()
client.update_relays(client.byond_version >= 516 ? "1,1" : "CENTER")

// atom_huds
reload_huds()
Expand Down
Loading