Skip to content

Commit

Permalink
Switches over to a crude version of IFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSuckerberg committed Dec 8, 2023
1 parent 5d4c411 commit 84c947c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 13 deletions.
51 changes: 43 additions & 8 deletions code/__HELPERS/time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,49 @@
else
. += " AM"

/proc/sector_year()
return GLOB.year_integer - 1519

/proc/sector_datestamp(time_format = "hh:mm:ss", world_time = world.time)
return "[sector_year()]FSC-[time2text(world_time, "MMM-DD")] [station_time_timestamp(time_format, world_time)]"

/proc/sector_date(world_time = world.time)
return "[time2text(world_time, "MMM DD")], FSC [GLOB.year_integer-1519]"
/proc/sector_datestamp(realtime = world.realtime, shortened = FALSE)
//International Fixed Calendar format (https://en.wikipedia.org/wiki/International_Fixed_Calendar)
var/days_since = round(realtime / (24 HOURS))
var/year = round(days_since / 365) + 481
var/day_of_year = days_since % 365 + 1
var/month = round(day_of_year / 28)
var/day_of_month = day_of_year % 28 + 1

if(shortened)
return "[year]-[month]-[day_of_month]FSC"

var/monthname
switch(month)
if(1)
monthname = "January"
if(2)
monthname = "February"
if(3)
monthname = "March"
if(4)
monthname = "April"
if(5)
monthname = "May"
if(6)
monthname = "June"
if(7)
monthname = "Sol"
if(8)
monthname = "July"
if(9)
monthname = "August"
if(10)
monthname = "September"
if(11)
monthname = "October"
if(12)
monthname = "November"
if(13)
monthname = "December"
if(14)
return "Year Day, [year] FSC"

return "[monthname] [day_of_month], [year] FSC"

//returns timestamp in a sql and a not-quite-compliant ISO 8601 friendly format
/proc/SQLtime(timevar)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/statpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SUBSYSTEM_DEF(statpanels)
"Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)",
"Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]",
"\n",
"Local Sector Time: [SSticker.round_start_timeofday ? "[station_time_timestamp()] [sector_date()]" : "The round hasn't started yet!"]",
"Local Sector Time: [SSticker.round_start_timeofday ? "[station_time_timestamp()] [sector_datestamp()]" : "The round hasn't started yet!"]",
"\n",
"Internal Round Timer: [SSticker.round_start_timeofday ? ROUND_TIME : "The round hasn't started yet!"]",
"Actual Round Timer: [SSticker.round_start_timeofday ? ROUND_REALTIMEOFDAY : "The round hasn't started yet!"]",
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
var/counter = 1
while(active2.fields[text("com_[]", counter)])
counter++
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], []<BR>[]", authenticated, rank, station_time_timestamp(), sector_date(), t1)
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], []<BR>[]", authenticated, rank, station_time_timestamp(), sector_datestamp(), t1)

else if(href_list["del_c"])
if((istype(active2, /datum/data/record) && active2.fields[text("com_[]", href_list["del_c"])]))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ What a mess.*/
var/counter = 1
while(active2.fields[text("com_[]", counter)])
counter++
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], []<BR>[]", src.authenticated, src.rank, station_time_timestamp(), sector_date(), t1)
active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], []<BR>[]", src.authenticated, src.rank, station_time_timestamp(), sector_datestamp(shortened = TRUE), t1)

if("Delete Record (ALL)")
if(active1)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/PDA/PDA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ GLOBAL_LIST_EMPTY(PDAs)
dat += text("ID: <A href='?src=[REF(src)];choice=Authenticate'>[id ? "[id.registered_name], [id.assignment]" : "----------"] <a href='?src=[REF(src)];choice=UpdateInfo'>[id ? "Update PDA Info" : ""]</a><br><br>")

dat += "[station_time_timestamp()]<br>"
dat += "[sector_date()]<br>"
dat += "[sector_datestamp()]<br>"
dat += "<br>"
dat += "<h4>General Functions</h4>"
dat += "<ul>"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
R.fields[text("com_[]", counter)] = text("Made by [] on [], []<BR>[]", allowed_access, station_time_timestamp(), sector_date(), t1)
R.fields[text("com_[]", counter)] = text("Made by [] on [], []<BR>[]", allowed_access, station_time_timestamp(), sector_datestamp(shortened = TRUE), t1)
to_chat(usr, "<span class='notice'>Successfully added comment.</span>")
return

Expand Down

0 comments on commit 84c947c

Please sign in to comment.