Skip to content

Commit

Permalink
Update lobby buttons (#4477)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Dec 5, 2024
1 parent e1cd42e commit 3b40e9f
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions code/_onclick/hud/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@
var/mob/dead/new_player/new_player = hud.mymob
new_player.handle_player_polling()

#define NRP_PORT 2102
#define MRP_PORT 3121
#define HRP_PORT 1342
#define VANDERLIN_PORT 1541

//This is the changing You are here Button
/atom/movable/screen/lobby/youarehere
var/vanderlin = 0
Expand All @@ -464,11 +469,11 @@
. = ..()
var/port = world.port
switch(port)
if(1342) //HRP
if(HRP_PORT) //HRP
screen_loc = "TOP:-32,CENTER:+215"
if(1337) //MRP
if(MRP_PORT) //MRP
screen_loc = "TOP:-65,CENTER:+215"
if(2102) //NRP
if(NRP_PORT) //NRP
screen_loc = "TOP:-98,CENTER:+215"
else //Sticks it in the middle, "TOP:0,CENTER:+128" will point at the MonkeStation logo itself.
screen_loc = "TOP:0,CENTER:+128"
Expand All @@ -477,6 +482,8 @@
icon = 'icons/hud/lobby/sister_server_buttons.dmi'
abstract_type = /atom/movable/screen/lobby/button/server
enabled = FALSE
/// The name of the server, used for the connecting message.
var/server_name
/// The IP of this server.
var/server_ip = "play.monkestation.com"
/// The port of this server.
Expand All @@ -502,13 +509,20 @@
/atom/movable/screen/lobby/button/server/Click(location, control, params)
. = ..()
if(. && world.port != server_port && is_available())
hud.mymob.client << link("byond://[server_ip]:[server_port]")
var/server_link = "byond://[server_ip]:[server_port]"
to_chat_immediate(
target = hud.mymob,
html = examine_block(span_info(span_big("Connecting you to [server_name]\nIf nothing happens, try manually connecting to the server ([server_link]), or the server may be down!"))),
type = MESSAGE_TYPE_INFO,
)
hud.mymob.client << link(server_link)

//HRP MONKE
/atom/movable/screen/lobby/button/server/hrp
base_icon_state = "hrp"
screen_loc = "TOP:-44,CENTER:+173"
server_port = 1342
server_name = "Well-Done Roleplay (HRP)"
server_port = HRP_PORT

/atom/movable/screen/lobby/button/server/hrp/should_be_up(day, hour)
return day == SATURDAY && ISINRANGE(hour, 12, 18)
Expand All @@ -518,20 +532,23 @@
base_icon_state = "mrp"
screen_loc = "TOP:-77,CENTER:+173"
enabled = TRUE
server_port = 1337
server_name = "Medium-Rare Roleplay (MRP)"
server_port = MRP_PORT

//NRP MONKE
/atom/movable/screen/lobby/button/server/nrp
screen_loc = "TOP:-110,CENTER:+173"
base_icon_state = "nrp"
server_port = 2102
server_name = "Raw Roleplay (NRP)"
server_port = NRP_PORT

//The Vanderlin Project
/atom/movable/screen/lobby/button/server/vanderlin
icon = 'icons/hud/lobby/vanderlin_button.dmi'
base_icon_state = "vanderlin"
screen_loc = "TOP:-140,CENTER:+177"
server_port = 1541
server_name = "Vanderlin"
server_port = VANDERLIN_PORT

/atom/movable/screen/lobby/button/server/vanderlin/should_be_up(day, hour)
switch(day)
Expand All @@ -541,6 +558,11 @@
return TRUE
return FALSE

#undef VANDERLIN_PORT
#undef HRP_PORT
#undef MRP_PORT
#undef NRP_PORT

//Monke button
/atom/movable/screen/lobby/button/ook
screen_loc = "TOP:-126,CENTER:110"
Expand Down

0 comments on commit 3b40e9f

Please sign in to comment.