Skip to content

Commit

Permalink
handle no round id
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Jul 28, 2023
1 parent fbe612c commit 284aca4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion code/datums/entities/player_note.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#define NOTE_ROUND_ID(note_entity) note_entity.round_id ? "(ID: [note_entity.round_id])" : ""

/datum/entity/player_note
var/player_id
var/admin_id
var/text
var/date
var/round_id = "N/A"
var/round_id
var/is_ban = FALSE
var/ban_time
var/is_confidential = FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/game/verbs/records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
if(NOTE_YAUTJA)
color = "#114e11"

dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i> on <i><font color=blue>[N.date] (ID: [N.round_id])</i></font> "
dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i> on <i><font color=blue>[N.date] [NOTE_ROUND_ID(N)]</i></font> "
dat += "<br><br>"

dat += "<br>"
Expand Down Expand Up @@ -168,7 +168,7 @@
continue
var/admin_ckey = N.admin_ckey

dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i> on <i><font color=blue>[N.date] (ID: [N.round_id])</i></font> "
dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i> on <i><font color=blue>[N.date] [NOTE_ROUND_ID(N)]</i></font> "
///Can remove notes from anyone other than yourself, unless you're the host. So long as you have deletion access anyway.
if((can_del && target != get_player_from_key(key)) || ishost(usr))
dat += "<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];remove_wl_info=[key];remove_index=[N.id]'>Remove</A>"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
if(N.is_ban)
var/time_d = N.ban_time ? "Banned for [N.ban_time] minutes | " : ""
color = "#880000" //Removed confidential check because we can't make confidential bans
dat += "<font color=[color]>[time_d][N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] (ID: [N.round_id])</i></font> "
dat += "<font color=[color]>[time_d][N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] [NOTE_ROUND_ID(N)]</i></font> "
else
if(N.is_confidential)
color = "#AA0055"
Expand All @@ -102,7 +102,7 @@
else if(N.note_category == NOTE_YAUTJA)
color = "#114e11"

dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] (ID: [N.round_id])</i></font> "
dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] [NOTE_ROUND_ID(N)]</i></font> "
if(admin_ckey == usr.ckey || admin_ckey == "Adminbot" || ishost(usr))
dat += "<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];remove_player_info=[key];remove_index=[N.id]'>Remove</A>"

Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/tabs/admin_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@
if(N.is_ban)
var/ban_text = N.ban_time ? "Banned for [N.ban_time] | " : ""
color = "#880000"
dat += "<font color=[color]>[ban_text][N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] (ID: [N.round_id])</i></font> "
dat += "<font color=[color]>[ban_text][N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] [NOTE_ROUND_ID(N)]</i></font> "
else
if(N.is_confidential)
color = "#AA0055"

dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] (ID: [N.round_id])</i></font> "
dat += "<font color=[color]>[N.text]</font> <i>by [admin_ckey] ([N.admin_rank])</i>[confidential_text] on <i><font color=blue>[N.date] [NOTE_ROUND_ID(N)]</i></font> "
dat += "<br><br>"

dat += "<br>"
Expand Down

0 comments on commit 284aca4

Please sign in to comment.