Files
Yogstation/code/game/machinery/computer/warrant.dm
TheGamerdk 65e3fe7465 CDN Assets + TGChat + Statbrowser Restyle (#10211)
* asset cache cdn

* Fix cdn rsc (#52886)

I was converting this to use length so it didn't have to care if the list existed or not, and forgot to remove the .len. this broke cdn .rsc files because length(num) returns 0.

* Add warning about https to the external rsc config (#53367)

today in hostchat we discovered that most of the servers who tried to 
do cdn the .rsc, had unknown issues because they had used https:// 
urls. Byond can't into https.

like 5 servers had failed to get this to work because of that pitfall, 
so im gonna add a warning to the config.

* tchat

* tgchat compile

* fixes

* Merge pull request #53011 from stylemistake/tgui-chat-fix-asay

tgchat: Fix asay

* chat color

* logging

* webstorage

* compile TGUI

* actually like compiles on the DM side

* Update chat-dark.scss

* Update chat-light.scss

* Update resources.txt

* Update tgui-panel.bundle.css

* Colors

* compile

* s

* s

* Ports Gamers TGChat so we can edit it. - NOT LIVE TGCHAT BRANCH (#10226)

* asset cache cdn

* Fix cdn rsc (#52886)

I was converting this to use length so it didn't have to care if the list existed or not, and forgot to remove the .len. this broke cdn .rsc files because length(num) returns 0.

* Add warning about https to the external rsc config (#53367)

today in hostchat we discovered that most of the servers who tried to 
do cdn the .rsc, had unknown issues because they had used https:// 
urls. Byond can't into https.

like 5 servers had failed to get this to work because of that pitfall, 
so im gonna add a warning to the config.

* tchat

* tgchat compile

* fixes

* Merge pull request #53011 from stylemistake/tgui-chat-fix-asay

tgchat: Fix asay

* chat color

* logging

* webstorage

* compile TGUI

* actually like compiles on the DM side

* Update chat-dark.scss

* Update chat-light.scss

* Update resources.txt

* Update tgui-panel.bundle.css

* Colors

* compile

* s

* s

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com>
Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
Co-authored-by: TheSmallBlue <ilanmori@hotmail.com>

* Fixes Replay Chat

* Update to_chat.dm

* Update chat.dm

* Update demo.dm

* yarn berry

* yarn berry compile

* Update resources.txt

* Update config/resources.txt

* Update resources.txt

* Attempt at fixing reconnect.

* Lets try fix it again

* oops

* THROW THE SINK AT IT

* ree

* Makes Travis work again thank you jamie

* Fixes snowflake images

* Update security.dm

* Updates TGChat Test Merge (#10307)

* asset cache cdn

* Fix cdn rsc (#52886)

I was converting this to use length so it didn't have to care if the list existed or not, and forgot to remove the .len. this broke cdn .rsc files because length(num) returns 0.

* Add warning about https to the external rsc config (#53367)

today in hostchat we discovered that most of the servers who tried to 
do cdn the .rsc, had unknown issues because they had used https:// 
urls. Byond can't into https.

like 5 servers had failed to get this to work because of that pitfall, 
so im gonna add a warning to the config.

* tchat

* tgchat compile

* fixes

* Merge pull request #53011 from stylemistake/tgui-chat-fix-asay

tgchat: Fix asay

* chat color

* logging

* webstorage

* compile TGUI

* actually like compiles on the DM side

* Update chat-dark.scss

* Update chat-light.scss

* Update resources.txt

* Update tgui-panel.bundle.css

* Colors

* compile

* s

* s

* Ports Gamers TGChat so we can edit it. - NOT LIVE TGCHAT BRANCH (#10226)

* asset cache cdn

* Fix cdn rsc (#52886)

I was converting this to use length so it didn't have to care if the list existed or not, and forgot to remove the .len. this broke cdn .rsc files because length(num) returns 0.

* Add warning about https to the external rsc config (#53367)

today in hostchat we discovered that most of the servers who tried to 
do cdn the .rsc, had unknown issues because they had used https:// 
urls. Byond can't into https.

like 5 servers had failed to get this to work because of that pitfall, 
so im gonna add a warning to the config.

* tchat

* tgchat compile

* fixes

* Merge pull request #53011 from stylemistake/tgui-chat-fix-asay

tgchat: Fix asay

* chat color

* logging

* webstorage

* compile TGUI

* actually like compiles on the DM side

* Update chat-dark.scss

* Update chat-light.scss

* Update resources.txt

* Update tgui-panel.bundle.css

* Colors

* compile

* s

* s

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com>
Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
Co-authored-by: TheSmallBlue <ilanmori@hotmail.com>

* Fixes Replay Chat

* Update to_chat.dm

* Update chat.dm

* Update demo.dm

* yarn berry

* yarn berry compile

* Update resources.txt

* Update config/resources.txt

* Update resources.txt

* Attempt at fixing reconnect.

* Lets try fix it again

* oops

* THROW THE SINK AT IT

* ree

* Makes Travis work again thank you jamie

* Fixes snowflake images

* Update security.dm

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: TheGamerdk <5618080+TheGamerdk@users.noreply.github.com>
Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
Co-authored-by: TheSmallBlue <ilanmori@hotmail.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>

* Fixes

* Undo Kitchen Sink

* Fucking 7 Hours.

* status panel

* stat panel fixes

* fixes

* stat panel stuff

* Stat panel finish

* Compile, oops

* Update server_maint.dm

* Update world.dm

* Update interface.dm

* tgui compile

* Update subsystems.dm

* fix statpanel deleting whole admin tab (#54211)

fix: adminhelping no longer removes entire admin tab
fix: end of round no longer removes entire admin tab

* Update skin.dmf

* verbs?

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
Co-authored-by: TheSmallBlue <ilanmori@hotmail.com>
Co-authored-by: Jamie D <993128+JamieD1@users.noreply.github.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Co-authored-by: Couls <coul422@gmail.com>
Co-authored-by: Tad Hardesty <tad@platymuus.com>
Co-authored-by: Bobbahbrown <bobbahbrown@gmail.com>
2020-11-10 19:10:27 +00:00

150 lines
4.9 KiB
Plaintext

/obj/machinery/computer/warrant//TODO:SANITY
name = "security warrant console"
desc = "Used to view crewmember security records"
icon_screen = "security"
icon_keyboard = "security_key"
circuit = /obj/item/circuitboard/computer/warrant
light_color = LIGHT_COLOR_RED
var/screen = null
var/datum/data/record/current = null
/obj/machinery/computer/warrant/ui_interact(mob/user)
. = ..()
var/list/dat = list("Logged in as: ")
if(authenticated)
dat += {"<a href='?src=[REF(src)];choice=Logout'>[authenticated]</a><hr>"}
if(current)
var/background
var/notice = ""
switch(current.fields["criminal"])
if("*Arrest*")
background = "background-color:#990000;"
notice = "<br>**REPORT TO THE BRIG**"
if("Search")
background = "background-color:#5C4949;"
if("Incarcerated")
background = "background-color:#CD6500;"
if("Paroled")
background = "background-color:#CD6500;"
if("Discharged")
background = "background-color:#006699;"
if("None")
background = "background-color:#4F7529;"
if("")
background = "''" //"'background-color:#FFFFFF;'"
dat += "<font size='4'><b>Warrant Data</b></font>"
dat += {"<table>
<tr><td>Name:</td><td>&nbsp;[current.fields["name"]]&nbsp;</td></tr>
<tr><td>ID:</td><td>&nbsp;[current.fields["id"]]&nbsp;</td></tr>
</table>"}
dat += {"Criminal Status:<br>
<div style='[background] padding: 3px; text-align: center;'>
<strong>[current.fields["criminal"]][notice]</strong>
</div>"}
dat += "<br><br>Citations:"
dat +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Fine</th>
<th>Author</th>
<th>Time Added</th>
<th>Amount Due</th>
<th>Make Payment</th>
</tr>"}
for(var/datum/data/crime/c in current.fields["citation"])
var/owed = c.fine - c.paid
dat += {"<tr><td>[c.crimeName]</td>
<td>$[c.fine]</td>
<td>[c.author]</td>
<td>[c.time]</td>"}
if(owed > 0)
dat += {"<td>$[owed]</td>
<td><A href='?src=[REF(src)];choice=Pay;field=citation_pay;cdataid=[c.dataId]'>\[Pay\]</A></td>"}
else
dat += "<td colspan='2'>All Paid Off</td>"
dat += "</tr>"
dat += "</table>"
dat += "<br>Minor Crimes:"
dat +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>"}
for(var/datum/data/crime/c in current.fields["mi_crim"])
dat += {"<tr><td>[c.crimeName]</td>
<td>[c.crimeDetails]</td>
<td>[c.author]</td>
<td>[c.time]</td>
</tr>"}
dat += "</table>"
dat += "<br>Major Crimes:"
dat +={"<table style="text-align:center;" border="1" cellspacing="0" width="100%">
<tr>
<th>Crime</th>
<th>Details</th>
<th>Author</th>
<th>Time Added</th>
</tr>"}
for(var/datum/data/crime/c in current.fields["ma_crim"])
dat += {"<tr><td>[c.crimeName]</td>
<td>[c.crimeDetails]</td>
<td>[c.author]</td>
<td>[c.time]</td>
</tr>"}
dat += "</table>"
else
dat += {"<span>** No security record found for this ID **</span>"}
else
dat += {"<a href='?src=[REF(src)];choice=Login'>------------</a><hr>"}
var/datum/browser/popup = new(user, "warrant", "Security Warrant Console", 600, 400)
popup.set_content(dat.Join())
popup.open()
/obj/machinery/computer/warrant/Topic(href, href_list)
if(..())
return
var/mob/M = usr
switch(href_list["choice"])
if("Login")
var/obj/item/card/id/scan = M.get_idcard(TRUE)
authenticated = scan.registered_name
if(authenticated)
for(var/datum/data/record/R in GLOB.data_core.security)
if(R.fields["name"] == authenticated)
current = R
playsound(src, 'sound/machines/terminal_on.ogg', 50, 0)
if("Logout")
current = null
authenticated = null
playsound(src, 'sound/machines/terminal_off.ogg', 50, 0)
if("Pay")
for(var/datum/data/crime/p in current.fields["citation"])
if(p.dataId == text2num(href_list["cdataid"]))
var/obj/item/holochip/C = M.is_holding_item_of_type(/obj/item/holochip)
if(C && istype(C))
var/pay = C.get_item_credit_value()
if(!pay)
to_chat(M, "<span class='warning'>[C] doesn't seem to be worth anything!</span>")
else
var/diff = p.fine - p.paid
GLOB.data_core.payCitation(current.fields["id"], text2num(href_list["cdataid"]), pay)
to_chat(M, "<span class='notice'>You have paid [pay] credit\s towards your fine</span>")
if (pay == diff || pay > diff || pay >= diff)
investigate_log("Citation Paid off: <strong>[p.crimeName]</strong> Fine: [p.fine] | Paid off by [key_name(usr)]", INVESTIGATE_RECORDS)
to_chat(M, "<span class='notice'>The fine has been paid in full</span>")
qdel(C)
playsound(src, "terminal_type", 25, 0)
else
to_chat(M, "<span class='warning'>Fines can only be paid with holochips</span>")
updateUsrDialog()
add_fingerprint(M)