diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm
index 26b83e30bb..1c4cba78f8 100644
--- a/code/modules/mob/new_player/new_player.dm
+++ b/code/modules/mob/new_player/new_player.dm
@@ -15,468 +15,468 @@
anchored = 1 // don't get pushed around
- New()
- mob_list += src
+/mob/new_player/New()
+ mob_list += src
- verb/new_player_panel()
- set src = usr
- new_player_panel_proc()
+/mob/new_player/verb/new_player_panel()
+ set src = usr
+ new_player_panel_proc()
- proc/new_player_panel_proc()
- var/output = "
New Player Options"
- output +="
"
- output += "
Setup Character
"
-
- if(!ticker || ticker.current_state <= GAME_STATE_PREGAME)
- if(ready)
- output += "
\[ Ready | Not Ready \]
"
- else
- output += "
\[ Ready | Not Ready \]
"
+/mob/new_player/proc/new_player_panel_proc()
+ var/output = "
New Player Options"
+ output +="
"
+ output += "
Setup Character
"
+ if(!ticker || ticker.current_state <= GAME_STATE_PREGAME)
+ if(ready)
+ output += "
\[ Ready | Not Ready \]
"
else
- output += "
View the Crew Manifest"
- output += "
Join Game!
"
+ output += "
\[ Ready | Not Ready \]
"
- output += "
Observe
"
+ else
+ output += "
View the Crew Manifest"
+ output += "
Join Game!
"
- if(!IsGuestKey(src.key))
- establish_db_connection()
+ output += "
Observe
"
- if(dbcon.IsConnected())
- var/isadmin = 0
- if(src.client && src.client.holder)
- isadmin = 1
- var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM erro_poll_textreply WHERE ckey = \"[ckey]\")")
- query.Execute()
- var/newpoll = 0
- while(query.NextRow())
- newpoll = 1
- break
+ if(!IsGuestKey(src.key))
+ establish_db_connection()
- if(newpoll)
- output += "
Show Player Polls (NEW!)
"
- else
- output += "
Show Player Polls
"
-
- output += "
"
-
- src << browse(output,"window=playersetup;size=210x280;can_close=0")
- return
-
- Stat()
- ..()
-
- if(statpanel("Lobby") && ticker)
- if(ticker.hide_mode)
- stat("Game Mode:", "Secret")
- else
- if(ticker.hide_mode == 0)
- stat("Game Mode:", "[master_mode]") // Old setting for showing the game mode
-
- if(ticker.current_state == GAME_STATE_PREGAME)
- stat("Time To Start:", "[ticker.pregame_timeleft][round_progressing ? "" : " (DELAYED)"]")
- stat("Players: [totalPlayers]", "Players Ready: [totalPlayersReady]")
- totalPlayers = 0
- totalPlayersReady = 0
- for(var/mob/new_player/player in player_list)
- stat("[player.key]", (player.ready)?("(Playing)"):(null))
- totalPlayers++
- if(player.ready)totalPlayersReady++
-
- Topic(href, href_list[])
- if(!client) return 0
-
- if(href_list["show_preferences"])
- client.prefs.ShowChoices(src)
- return 1
-
- if(href_list["ready"])
- if(!ticker || ticker.current_state <= GAME_STATE_PREGAME) // Make sure we don't ready up after the round has started
- ready = text2num(href_list["ready"])
- else
- ready = 0
-
- if(href_list["refresh"])
- src << browse(null, "window=playersetup") //closes the player setup window
- new_player_panel_proc()
-
- if(href_list["observe"])
-
- if(alert(src,"Are you sure you wish to observe? You will have to wait 15 minutes before being able to respawn!","Player Setup","Yes","No") == "Yes")
- if(!client) return 1
- var/mob/dead/observer/observer = new()
-
- spawning = 1
- src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo
-
-
- observer.started_as_observer = 1
- close_spawn_windows()
- var/obj/O = locate("landmark*Observer-Start")
- if(istype(O))
- src << "
Now teleporting."
- observer.loc = O.loc
- else
- src << "
Could not locate an observer spawn point. Use the Teleport verb to jump to the station map."
- observer.timeofdeath = world.time // Set the time of death so that the respawn timer works correctly.
-
- announce_ghost_joinleave(src)
- client.prefs.update_preview_icon()
- observer.icon = client.prefs.preview_icon
- observer.alpha = 127
-
- if(client.prefs.be_random_name)
- client.prefs.real_name = random_name(client.prefs.gender)
- observer.real_name = client.prefs.real_name
- observer.name = observer.real_name
- if(!client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed.
- observer.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing!
- observer.key = key
- qdel(src)
-
- return 1
-
- if(href_list["late_join"])
-
- if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
- usr << "\red The round is either not ready, or has already finished..."
- return
-
- if(client.prefs.species != "Human" && !check_rights(R_ADMIN, 0))
- if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
- src << alert("You are currently not whitelisted to play [client.prefs.species].")
- return 0
-
- var/datum/species/S = all_species[client.prefs.species]
- if(!(S.spawn_flags & IS_WHITELISTED))
- src << alert("Your current species,[client.prefs.species], is not available for play on the station.")
- return 0
-
- LateChoices()
-
- if(href_list["manifest"])
- ViewManifest()
-
- if(href_list["SelectedJob"])
-
- if(!config.enter_allowed)
- usr << "
There is an administrative lock on entering the game!"
- return
- else if(ticker && ticker.mode && ticker.mode.explosion_in_progress)
- usr << "
The station is currently exploding. Joining would go poorly."
- return
-
- if(client.prefs.species != "Human")
- if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
- src << alert("You are currently not whitelisted to play [client.prefs.species].")
- return 0
-
- var/datum/species/S = all_species[client.prefs.species]
- if(!(S.spawn_flags & CAN_JOIN))
- src << alert("Your current species, [client.prefs.species], is not available for play on the station.")
- return 0
-
- AttemptLateSpawn(href_list["SelectedJob"],client.prefs.spawnpoint)
- return
-
- if(href_list["privacy_poll"])
- establish_db_connection()
- if(!dbcon.IsConnected())
- return
- var/voted = 0
-
- //First check if the person has not voted yet.
- var/DBQuery/query = dbcon.NewQuery("SELECT * FROM erro_privacy WHERE ckey='[src.ckey]'")
+ if(dbcon.IsConnected())
+ var/isadmin = 0
+ if(src.client && src.client.holder)
+ isadmin = 1
+ var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM erro_poll_textreply WHERE ckey = \"[ckey]\")")
query.Execute()
+ var/newpoll = 0
while(query.NextRow())
- voted = 1
+ newpoll = 1
break
- //This is a safety switch, so only valid options pass through
- var/option = "UNKNOWN"
- switch(href_list["privacy_poll"])
- if("signed")
- option = "SIGNED"
- if("anonymous")
- option = "ANONYMOUS"
- if("nostats")
- option = "NOSTATS"
- if("later")
- usr << browse(null,"window=privacypoll")
- return
- if("abstain")
- option = "ABSTAIN"
+ if(newpoll)
+ output += "
Show Player Polls (NEW!)
"
+ else
+ output += "
Show Player Polls
"
- if(option == "UNKNOWN")
- return
+ output += "
"
- if(!voted)
- var/sql = "INSERT INTO erro_privacy VALUES (null, Now(), '[src.ckey]', '[option]')"
- var/DBQuery/query_insert = dbcon.NewQuery(sql)
- query_insert.Execute()
- usr << "