mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 11:13:16 +00:00
New Player/Character Setup (Fake)NanoUI
While I consider Polaris' character setup screen to be mechanically better than most others, it wasn't prettier. Well. It was a bit. But now it's more pretty-er. Used the fake NanoUI 'browser' datum to render the pages for the New Player panel and the Character Setup screen.
This commit is contained in:
@@ -43,8 +43,8 @@ datum/preferences/proc/set_biological_gender(var/gender)
|
|||||||
/datum/category_item/player_setup_item/general/basic/content()
|
/datum/category_item/player_setup_item/general/basic/content()
|
||||||
. = "<b>Name:</b> "
|
. = "<b>Name:</b> "
|
||||||
. += "<a href='?src=\ref[src];rename=1'><b>[pref.real_name]</b></a><br>"
|
. += "<a href='?src=\ref[src];rename=1'><b>[pref.real_name]</b></a><br>"
|
||||||
. += "(<a href='?src=\ref[src];random_name=1'>Random Name</A>) "
|
. += "<a href='?src=\ref[src];random_name=1'>Randomize Name</A><br>"
|
||||||
. += "(<a href='?src=\ref[src];always_random_name=1'>Always Random Name: [pref.be_random_name ? "Yes" : "No"]</a>)"
|
. += "<a href='?src=\ref[src];always_random_name=1'>Always Random Name: [pref.be_random_name ? "Yes" : "No"]</a>"
|
||||||
. += "<br>"
|
. += "<br>"
|
||||||
. += "<b>Biological Gender:</b> <a href='?src=\ref[src];bio_gender=1'><b>[gender2text(pref.biological_gender)]</b></a><br>"
|
. += "<b>Biological Gender:</b> <a href='?src=\ref[src];bio_gender=1'><b>[gender2text(pref.biological_gender)]</b></a><br>"
|
||||||
. += "<b>Gender Identity:</b> <a href='?src=\ref[src];id_gender=1'><b>[gender2text(pref.identifying_gender)]</b></a><br>"
|
. += "<b>Gender Identity:</b> <a href='?src=\ref[src];id_gender=1'><b>[gender2text(pref.identifying_gender)]</b></a><br>"
|
||||||
|
|||||||
@@ -105,15 +105,9 @@ var/list/gear_datums = list()
|
|||||||
else
|
else
|
||||||
. += " |"
|
. += " |"
|
||||||
if(category == current_tab)
|
if(category == current_tab)
|
||||||
. += " [category] "
|
. += " <span class='linkOff'>[category]</span> "
|
||||||
else
|
else
|
||||||
var/datum/loadout_category/LC = loadout_categories[category]
|
. += " <a href='?src=\ref[src];select_category=[category]'>[category]</a> "
|
||||||
var/tcolor = "#3366CC"
|
|
||||||
for(var/thing in LC.gear)
|
|
||||||
if(thing in pref.gear)
|
|
||||||
tcolor = "#E67300"
|
|
||||||
break
|
|
||||||
. += " <a href='?src=\ref[src];select_category=[category]'><font color = '[tcolor]'>[category]</font></a> "
|
|
||||||
. += "</b></center></td></tr>"
|
. += "</b></center></td></tr>"
|
||||||
|
|
||||||
var/datum/loadout_category/LC = loadout_categories[current_tab]
|
var/datum/loadout_category/LC = loadout_categories[current_tab]
|
||||||
@@ -123,7 +117,7 @@ var/list/gear_datums = list()
|
|||||||
for(var/gear_name in LC.gear)
|
for(var/gear_name in LC.gear)
|
||||||
var/datum/gear/G = LC.gear[gear_name]
|
var/datum/gear/G = LC.gear[gear_name]
|
||||||
var/ticked = (G.display_name in pref.gear)
|
var/ticked = (G.display_name in pref.gear)
|
||||||
. += "<tr style='vertical-align:top'><td width=25%><a href='?src=\ref[src];toggle_gear=[G.display_name]'><font color='[ticked ? "#E67300" : "#3366CC"]'>[G.display_name]</font></a></td>"
|
. += "<tr style='vertical-align:top;'><td width=25%><a style='white-space:normal;' [ticked ? "class='linkOff' " : ""]href='?src=\ref[src];toggle_gear=[G.display_name]'>[G.display_name]</a></td>"
|
||||||
. += "<td width = 10% style='vertical-align:top'>[G.cost]</td>"
|
. += "<td width = 10% style='vertical-align:top'>[G.cost]</td>"
|
||||||
. += "<td><font size=2><i>[G.description]</i></font></td></tr>"
|
. += "<td><font size=2><i>[G.description]</i></font></td></tr>"
|
||||||
if(ticked)
|
if(ticked)
|
||||||
|
|||||||
@@ -60,8 +60,8 @@
|
|||||||
|
|
||||||
. += "<tt><center>"
|
. += "<tt><center>"
|
||||||
. += "<b>Choose occupation chances</b><br>Unavailable occupations are crossed out.<br>"
|
. += "<b>Choose occupation chances</b><br>Unavailable occupations are crossed out.<br>"
|
||||||
. += "<table width='100%' cellpadding='1' cellspacing='0'><tr><td width='20%'>" // Table within a table for alignment, also allows you to easily add more colomns.
|
. += "<table width='100%' cellpadding='1' cellspacing='0'><tr><td width='20%'>" // Table within a table for alignment, also allows you to easily add more columns.
|
||||||
. += "<table width='100%' cellpadding='1' cellspacing='0'>"
|
. += "<table width='100%' cellpadding='1' cellspacing='0' style='color:black;'>"
|
||||||
var/index = -1
|
var/index = -1
|
||||||
|
|
||||||
//The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
|
//The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
|
||||||
@@ -76,14 +76,14 @@
|
|||||||
//the last job's selection color. Creating a rather nice effect.
|
//the last job's selection color. Creating a rather nice effect.
|
||||||
for(var/i = 0, i < (limit - index), i += 1)
|
for(var/i = 0, i < (limit - index), i += 1)
|
||||||
. += "<tr bgcolor='[lastJob.selection_color]'><td width='60%' align='right'><a> </a></td><td><a> </a></td></tr>"
|
. += "<tr bgcolor='[lastJob.selection_color]'><td width='60%' align='right'><a> </a></td><td><a> </a></td></tr>"
|
||||||
. += "</table></td><td width='20%'><table width='100%' cellpadding='1' cellspacing='0'>"
|
. += "</table></td><td width='20%'><table width='100%' cellpadding='1' cellspacing='0' style='color:black;'>"
|
||||||
index = 0
|
index = 0
|
||||||
|
|
||||||
. += "<tr bgcolor='[job.selection_color]'><td width='60%' align='right'>"
|
. += "<tr bgcolor='[job.selection_color]'><td width='60%' align='right'>"
|
||||||
var/rank = job.title
|
var/rank = job.title
|
||||||
lastJob = job
|
lastJob = job
|
||||||
if(jobban_isbanned(user, rank))
|
if(jobban_isbanned(user, rank))
|
||||||
. += "<del>[rank]</del></td><td><b> \[BANNED]</b></td></tr>"
|
. += "\black <del>[rank]</del></td><td><b> \[BANNED]</b></td></tr>"
|
||||||
continue
|
continue
|
||||||
if(!job.player_old_enough(user.client))
|
if(!job.player_old_enough(user.client))
|
||||||
var/available_in_days = job.available_in_days(user.client)
|
var/available_in_days = job.available_in_days(user.client)
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
. += "<del>[rank]</del></td><td> \[MINIMUM CHARACTER AGE: [job.minimum_character_age]]</td></tr>"
|
. += "<del>[rank]</del></td><td> \[MINIMUM CHARACTER AGE: [job.minimum_character_age]]</td></tr>"
|
||||||
continue
|
continue
|
||||||
if((pref.job_civilian_low & ASSISTANT) && (rank != "Assistant"))
|
if((pref.job_civilian_low & ASSISTANT) && (rank != "Assistant"))
|
||||||
. += "<font color=orange>[rank]</font></td><td></td></tr>"
|
. += "<font color=grey>[rank]</font></style></td><td></td></tr>"
|
||||||
continue
|
continue
|
||||||
if((rank in command_positions) || (rank == "AI"))//Bold head jobs
|
if((rank in command_positions) || (rank == "AI"))//Bold head jobs
|
||||||
. += "<b>[rank]</b>"
|
. += "<b>[rank]</b>"
|
||||||
@@ -132,11 +132,11 @@
|
|||||||
|
|
||||||
switch(pref.alternate_option)
|
switch(pref.alternate_option)
|
||||||
if(GET_RANDOM_JOB)
|
if(GET_RANDOM_JOB)
|
||||||
. += "<center><br><u><a href='?src=\ref[src];job_alternative=1'><font color=green>Get random job if preferences unavailable</font></a></u></center><br>"
|
. += "<center><br><u><a href='?src=\ref[src];job_alternative=1'>Get random job if preferences unavailable</a></u></center><br>"
|
||||||
if(BE_ASSISTANT)
|
if(BE_ASSISTANT)
|
||||||
. += "<center><br><u><a href='?src=\ref[src];job_alternative=1'><font color=red>Be assistant if preference unavailable</font></a></u></center><br>"
|
. += "<center><br><u><a href='?src=\ref[src];job_alternative=1'>Be assistant if preference unavailable</a></u></center><br>"
|
||||||
if(RETURN_TO_LOBBY)
|
if(RETURN_TO_LOBBY)
|
||||||
. += "<center><br><u><a href='?src=\ref[src];job_alternative=1'><font color=purple>Return to lobby if preference unavailable</font></a></u></center><br>"
|
. += "<center><br><u><a href='?src=\ref[src];job_alternative=1'>Return to lobby if preference unavailable</a></u></center><br>"
|
||||||
|
|
||||||
. += "<center><a href='?src=\ref[src];reset_jobs=1'>\[Reset\]</a></center>"
|
. += "<center><a href='?src=\ref[src];reset_jobs=1'>\[Reset\]</a></center>"
|
||||||
. += "</tt>"
|
. += "</tt>"
|
||||||
|
|||||||
@@ -211,7 +211,10 @@ datum/preferences
|
|||||||
dat += player_setup.content(user)
|
dat += player_setup.content(user)
|
||||||
|
|
||||||
dat += "</html></body>"
|
dat += "</html></body>"
|
||||||
user << browse(dat, "window=preferences;size=635x736")
|
//user << browse(dat, "window=preferences;size=635x736")
|
||||||
|
var/datum/browser/popup = new(user, "Character Setup","Character Setup", 635, 736, src)
|
||||||
|
popup.set_content(dat)
|
||||||
|
popup.open()
|
||||||
|
|
||||||
/datum/preferences/proc/process_link(mob/user, list/href_list)
|
/datum/preferences/proc/process_link(mob/user, list/href_list)
|
||||||
if(!user) return
|
if(!user) return
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/mob/new_player/proc/new_player_panel_proc()
|
/mob/new_player/proc/new_player_panel_proc()
|
||||||
var/output = "<div align='center'><B>New Player Options</B>"
|
var/output = "<div align='center'>"
|
||||||
output +="<hr>"
|
output +="<hr>"
|
||||||
output += "<p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
|
output += "<p><a href='byond://?src=\ref[src];show_preferences=1'>Setup Character</A></p>"
|
||||||
|
|
||||||
@@ -61,7 +61,11 @@
|
|||||||
|
|
||||||
output += "</div>"
|
output += "</div>"
|
||||||
|
|
||||||
src << browse(output,"window=playersetup;size=210x280;can_close=0")
|
//src << browse(output,"window=playersetup;size=210x280;can_close=0")
|
||||||
|
var/datum/browser/popup = new(src, "New Player","New Player", 210, 280, src)
|
||||||
|
popup.set_window_options("can_close=0")
|
||||||
|
popup.set_content(output)
|
||||||
|
popup.open()
|
||||||
return
|
return
|
||||||
|
|
||||||
/mob/new_player/Stat()
|
/mob/new_player/Stat()
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ a, a:link, a:visited, a:active, .linkOn, .linkOff
|
|||||||
padding: 1px 4px 1px 4px;
|
padding: 1px 4px 1px 4px;
|
||||||
margin: 0 2px 0 0;
|
margin: 0 2px 0 0;
|
||||||
cursor:default;
|
cursor:default;
|
||||||
|
white-space:nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover
|
a:hover
|
||||||
|
|||||||
Reference in New Issue
Block a user