mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
TG: Added Giacomand's UI tweak to Job Selection:
http://nanotrasen.com/phpBB3/viewtopic.php?f=16&t=8879 Revision: r3726 Author: ericgfw...@hotmail.com ALSO FIXES Library starting with empty sprites.
This commit is contained in:
@@ -119,6 +119,7 @@
|
|||||||
// add to inventory
|
// add to inventory
|
||||||
if(comp)
|
if(comp)
|
||||||
comp.inventory += B
|
comp.inventory += B
|
||||||
|
update_icon()
|
||||||
|
|
||||||
/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob)
|
/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob)
|
||||||
if(istype(O, /obj/item/weapon/book))
|
if(istype(O, /obj/item/weapon/book))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
|
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||||
|
|
||||||
#define UI_OLD 0
|
#define UI_OLD 0
|
||||||
#define UI_NEW 1
|
#define UI_NEW 1
|
||||||
@@ -439,14 +439,48 @@ datum/preferences
|
|||||||
if(job.title != new_title)
|
if(job.title != new_title)
|
||||||
job_alt_titles[job.title] = new_title
|
job_alt_titles[job.title] = new_title
|
||||||
|
|
||||||
proc/SetChoices(mob/user, changedjob)
|
proc/SetChoices(mob/user, limit = 17, list/splitJobs, width = 550, height = 500)
|
||||||
|
//limit - The amount of jobs allowed per column. Defaults to 17 to make it look nice.
|
||||||
|
//splitJobs - Allows you split the table by job. You can make different tables for each department by including their heads. Defaults to CE to make it look nice.
|
||||||
|
//width - Screen' width. Defaults to 550 to make it look nice.
|
||||||
|
//height - Screen's height. Defaults to 500 to make it look nice.
|
||||||
|
|
||||||
|
// Modify this if you added more jobs and it looks like a mess. Add the jobs in the splitJobs that you want to trigger and intitate a new table.
|
||||||
|
|
||||||
|
if(splitJobs == null)
|
||||||
|
if (ticker.current_state >= GAME_STATE_PLAYING
|
||||||
|
)
|
||||||
|
splitJobs = list()
|
||||||
|
else
|
||||||
|
splitJobs = list("Chief Engineer")
|
||||||
|
|
||||||
|
|
||||||
var/HTML = "<body>"
|
var/HTML = "<body>"
|
||||||
HTML += "<tt><center>"
|
HTML += "<tt><center>"
|
||||||
HTML += "<b>Choose occupation chances</b><br>Unavailable occupations are in red.<br>"
|
HTML += "<b>Choose occupation chances</b><br>Unavailable occupations are in red.<br><br>"
|
||||||
HTML += "<table width='100%' cellpadding='1' cellspacing='0' align='center'>"
|
HTML += "<a align='center' href=\"byond://?src=\ref[user];preferences=1;occ=0;job=cancel\">\[Done\]</a><br><br>" // Easier to press up here.
|
||||||
|
HTML += "<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.
|
||||||
|
HTML += "<table width='100%' cellpadding='1' cellspacing='0'>"
|
||||||
|
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.
|
||||||
|
var/datum/job/lastJob
|
||||||
|
|
||||||
for(var/datum/job/job in job_master.occupations)
|
for(var/datum/job/job in job_master.occupations)
|
||||||
|
|
||||||
|
index += 1
|
||||||
|
if((index >= limit) || (job.title in splitJobs))
|
||||||
|
if((index < limit) && (lastJob != null))
|
||||||
|
//If the cells were broken up by a job in the splitJob list then it will fill in the rest of the cells with
|
||||||
|
//the last job's selection color. Creating a rather nice effect.
|
||||||
|
for(var/i = 0, i < (limit - index), i += 1)
|
||||||
|
HTML += "<tr bgcolor='[lastJob.selection_color]'><td width='60%' align='right'><a> </a></td><td><a> </a></td></tr>"
|
||||||
|
HTML += "</table></td><td width='20%'><table width='100%' cellpadding='1' cellspacing='0'>"
|
||||||
|
index = 0
|
||||||
|
|
||||||
HTML += "<tr bgcolor='[job.selection_color]'><td width='60%' align='right'>"
|
HTML += "<tr bgcolor='[job.selection_color]'><td width='60%' align='right'>"
|
||||||
var/rank = job.title
|
var/rank = job.title
|
||||||
|
lastJob = job
|
||||||
if(jobban_isbanned(user, rank))
|
if(jobban_isbanned(user, rank))
|
||||||
HTML += "<font color=red>[rank]</font></td><td><font color=red><b> \[BANNED]</b></font></td></tr>"
|
HTML += "<font color=red>[rank]</font></td><td><font color=red><b> \[BANNED]</b></font></td></tr>"
|
||||||
continue
|
continue
|
||||||
@@ -483,12 +517,10 @@ datum/preferences
|
|||||||
else
|
else
|
||||||
HTML += "</a></td></tr>"
|
HTML += "</a></td></tr>"
|
||||||
|
|
||||||
HTML += "</table><br>"
|
|
||||||
HTML += "<a href=\"byond://?src=\ref[user];preferences=1;occ=0;job=cancel\">\[Done\]</a>"
|
|
||||||
HTML += "</center></tt>"
|
HTML += "</center></tt>"
|
||||||
|
|
||||||
user << browse(null, "window=preferences")
|
user << browse(null, "window=preferences")
|
||||||
user << browse(HTML, "window=mob_occupation;size=320x600")
|
user << browse(HTML, "window=mob_occupation;size=[width]x[height]")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user