From df579602e1b9a84d5f39d82722b9aa33f73d789a Mon Sep 17 00:00:00 2001 From: SyndiCat <134767881+syndicatecat@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:55:27 +0500 Subject: [PATCH 1/3] 11 --- code/__HELPERS/time.dm | 19 +++- code/game/machinery/computer/brigcells.dm | 4 +- code/game/machinery/doors/brigdoors.dm | 104 ++++++++++++--------- tgui/packages/tgui/interfaces/BrigCells.js | 14 +-- tgui/packages/tgui/interfaces/BrigTimer.js | 38 ++++---- 5 files changed, 102 insertions(+), 77 deletions(-) diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 391aeb34464..c81363d8233 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -125,7 +125,21 @@ /proc/seconds_to_time(var/seconds as num) var/numSeconds = seconds % 60 var/numMinutes = (seconds - numSeconds) / 60 - return "[numMinutes] [numMinutes > 1 ? "minutes" : "minute"] and [numSeconds] seconds" + + var/sufM = . + + var/list/nums1 = list(1, 21, 31, 41, 51) + var/list/nums2 = list(2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54) + var/list/nums3 = list(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60) + + if(numMinutes in nums1) + sufM = "минуту" + if (numMinutes in nums2) + sufM = "минуты" + if (numMinutes in nums3) + sufM = "минут" + + return "[numMinutes] [sufM]" //Take a value in seconds and makes it display like a clock /proc/seconds_to_clock(var/seconds as num) @@ -141,8 +155,7 @@ var/hour = null var/day = null - if(!second) - return "0 seconds" + if(second >= 60) minute = round_down(second / 60) second = round(second - (minute * 60), 0.1) diff --git a/code/game/machinery/computer/brigcells.dm b/code/game/machinery/computer/brigcells.dm index ace3d9f823e..1e1f7fe59d5 100644 --- a/code/game/machinery/computer/brigcells.dm +++ b/code/game/machinery/computer/brigcells.dm @@ -1,6 +1,6 @@ /obj/machinery/computer/brigcells name = "cell management computer" - desc = "Используется для управления тюремными камерами." + desc = "Используется для дистанционного управления камерами заключённых." icon_keyboard = "security_key" icon_screen = "cell_monitor" use_power = IDLE_POWER_USE @@ -64,7 +64,7 @@ var/obj/machinery/door_timer/T = locate(ref) if (T) T.timer_end() - T.Radio.autosay("Timer stopped manually from a cell management console.", T.name, "Security", list(z)) + T.Radio.autosay("Таймер был вручную остановлен через консоль.", T.name, "Security", list(z)) return TRUE return FALSE diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 89747e01965..ce83f52c5eb 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -97,15 +97,15 @@ for(var/obj/machinery/computer/prisoner/C in GLOB.prisoncomputer_list) var/obj/item/paper/P = new /obj/item/paper(C.loc) P.name = "[id] log - [occupant] [station_time_timestamp()]" - P.info = "
[id] - Brig record



" - P.info += {"
[station_name()] - Security Department

-
Admission data:

- Log generated at: [station_time_timestamp()]
- Detainee: [occupant]
- Duration: [seconds_to_time(timetoset / 10)]
- Charge(s): [crimes]
- Arresting Officer: [usr.name]


- This log file was generated automatically upon activation of a cell timer."} + P.info = "
[id] - Записи Службы Безопасности



" + P.info += {"
[station_name()] - Служба Безопасности

+
Данные:

+ Запись создана в: [station_time_timestamp()]
+ Заключён: [occupant]
+ На: [seconds_to_time(timetoset / 10)]
+ За: [crimes]
+ Сотрудник: [usr.name]


+ Записи были созданы автоматически путём активации таймера камеры."} playsound(C.loc, "sound/goonstation/machines/printer_dotmatrix.ogg", 50, 1) GLOB.cell_logs += P @@ -122,13 +122,13 @@ var/datum/data/record/R = find_security_record("name", occupant) var/timetext = seconds_to_time(timetoset / 10) - var/announcetext = "Detainee [occupant] ([prisoner_drank]) has been incarcerated for [timetext] for the crime of: '[crimes]'. \ - Arresting Officer: [usr.name].[R ? "" : " Detainee record not found, manual record update required."]" + var/announcetext = "Заключён [occupant] ([prisoner_drank]) на [timetext] за: [crimes]. \ + Сотрудник: [usr.name].[R ? "" : " Отсутствуют записи о заключённом, требуется обновление вручную."]" Radio.autosay(announcetext, name, "Security") // Notify the actual criminal being brigged. This is a QOL thing to ensure they always know the charges against them. // Announcing it on radio isn't enough, as they're unlikely to have sec radio. - notify_prisoner("You have been incarcerated for [timetext] for the crime of: '[crimes]'.") + notify_prisoner("Вы были заключены на [timetext] за: [crimes]") if(prisoner_trank != "unknown" && prisoner_trank != "Civilian") SSjobs.notify_dept_head(prisoner_trank, announcetext) @@ -144,16 +144,16 @@ rank = I.assignment if(!R.fields["comments"] || !islist(R.fields["comments"])) //copied from security computer code because apparently these need to be initialized R.fields["comments"] = list() - R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]
Sentenced to [timetoset/10] seconds for the charges of \"[crimes]\" by [rank] [usr.name]." + R.fields["comments"] += "Автоматически сгенерировано [name] в [GLOB.current_date_string] [station_time_timestamp()]
Заключён на [timetoset/10] за \"[crimes]\" [rank] [usr.name]." update_all_mob_security_hud() return 1 /obj/machinery/door_timer/proc/notify_prisoner(notifytext) for(var/mob/living/carbon/human/H in range(4, get_turf(src))) if(occupant == H.name) - to_chat(H, "[src] beeps, \"[notifytext]\"") + to_chat(H, "[src] проигрывает, \"[notifytext]\"") return - atom_say("[src] beeps, \"[occupant]: [notifytext]\"") + atom_say("[src] проигрывает, \"[occupant]: [notifytext]\"") //Main door timer loop, if it's timing and time is >0 reduce time by 1. @@ -168,7 +168,7 @@ timer_end() return PROCESS_KILL if(timeleft() <= 0) - Radio.autosay("Timer has expired. Releasing prisoner.", name, "Security", list(z)) + Radio.autosay("Время истекло. Вы свободны.", name, "Security", list(z)) occupant = CELL_NONE timer_end() // open doors, reset timer, clear status screen return PROCESS_KILL @@ -387,7 +387,7 @@ if(params["prisoner_name"]) prisoner_name = params["prisoner_name"] else - var/new_name = tgui_input_text(usr, "Prisoner Name:", name, prisoner_name, MAX_NAME_LEN, encode = FALSE) + var/new_name = tgui_input_text(usr, "Имя заключённого:", name, prisoner_name, MAX_NAME_LEN, encode = FALSE) if(isnull(new_name)) return prisoner_name = new_name @@ -398,12 +398,12 @@ else prisoner_hasrecord = FALSE if("prisoner_charge") - var/new_charge = tgui_input_text(usr, "Prisoner Charge:", name, prisoner_charge, encode = FALSE) + var/new_charge = tgui_input_text(usr, "Обвинения:", name, prisoner_charge, encode = FALSE) if(isnull(new_charge)) return prisoner_charge = new_charge if("prisoner_time") - var/new_time = tgui_input_number(usr, "Prisoner Time (in minutes):", name, prisoner_time, PERMABRIG_TIME) + var/new_time = tgui_input_number(usr, "Время заключения (в минутах):", name, prisoner_time, PERMABRIG_TIME) if(isnull(new_time)) return prisoner_time = new_time @@ -419,56 +419,70 @@ timer_start() if("add_timer") if(timing) - var/add_reason = sanitize(copytext(input(usr, "Reason:", name, "") as text|null, 1, MAX_MESSAGE_LEN)) + var/add_reason = sanitize(copytext(input(usr, ". Причина:", name, "") as text|null, 1, MAX_MESSAGE_LEN)) if(!add_reason) - to_chat(usr, span_warning("Must specify the reason!")) + to_chat(usr, span_warning("Должна быть причина!")) return FALSE - prisoner_time_add = input(usr, "Minutes to add:", name, prisoner_time_add) as num|null + prisoner_time_add = input(usr, "Время, которое будет добавлено (в минутах):", name, prisoner_time_add) as num|null prisoner_time_add = min(max(round(prisoner_time_add), 0), PERMABRIG_TIME) + + var/sufM = . + + var/list/nums1 = list(1, 21, 31, 41, 51) + var/list/nums2 = list(2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54) + var/list/nums3 = list(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60) + + if(prisoner_time_add in nums1) + sufM = "минуту" + if(prisoner_time_add in nums2) + sufM = "минуты" + if(prisoner_time_add in nums3) + sufM = "минут" + if(!prisoner_time_add) - to_chat(usr, span_warning("Must specify the number!")) + to_chat(usr, span_warning("Время указывается числом!")) return FALSE prisoner_time_add = prisoner_time_add MINUTES if(timetoset + prisoner_time_add >= PERMABRIG_TIME MINUTES) - notify_prisoner("Timer is exceeding 60 minutes. Please, transfer the prisoner to the Permabrig!") + notify_prisoner("Таймер превышает 60 минут. Переместите заключенного в пермабриг!") return FALSE timetoset = timetoset + prisoner_time_add releasetime = releasetime + prisoner_time_add - var/addtext = isobserver(usr) ? "for: [add_reason]." : "by [usr.name] for: [add_reason]" - Radio.autosay("Prisoner [occupant] had their timer increased by [prisoner_time_add / 600] minutes [addtext]", name, "Security", list(z)) - notify_prisoner("Your brig timer has been increased by [prisoner_time_add / 600] minutes for: '[add_reason]'.") + var/addtext = isobserver(usr) ? "за: [add_reason]." : "сотрудником [usr.name]" + Radio.autosay("Время заключения [occupant] было увеличен на [prisoner_time_add / 600] [sufM] [addtext]", name, "Security", list(z)) + notify_prisoner("Ваше время заключения было увеличено на [prisoner_time_add / 600] [sufM] [add_reason]") var/datum/data/record/R = find_security_record("name", occupant) if(istype(R)) - R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]Timer increased by [prisoner_time_add / 600] minutes [addtext]" + R.fields["comments"] += "Автоматически сгенерировано [name] в [GLOB.current_date_string] [station_time_timestamp()]Таймер увеличен на [prisoner_time_add / 600] [sufM] [addtext]" else . = FALSE if("restart_timer") if(timing) - var/reset_reason = tgui_input_text(usr, "Reason for resetting timer:", name) + var/reset_reason = tgui_input_text(usr, "Причина перезапуска таймера:", name) if(!reset_reason) - to_chat(usr, span_warning("Cancelled reset: reason field is required.")) + to_chat(usr, span_warning("Перезапуск отменён. Отсутствует причина.")) return FALSE releasetime = world.timeofday + timetoset - var/resettext = isobserver(usr) ? "for: [reset_reason]." : "by [usr.name] for: [reset_reason]." - Radio.autosay("Prisoner [occupant] had their timer reset [resettext]", name, "Security", list(z)) - notify_prisoner("Your brig timer has been reset for: '[reset_reason]'.") + var/resettext = isobserver(usr) ? "по причине: [reset_reason]." : "сотрудником [usr.name]" + Radio.autosay("Таймер заключённого [occupant] был перезапущен [resettext]", name, "Security", list(z)) + notify_prisoner("Ваш таймер был перезапущен по причине: '[reset_reason]'") var/datum/data/record/R = find_security_record("name", occupant) if(istype(R)) - R.fields["comments"] += "Autogenerated by [name] on [GLOB.current_date_string] [station_time_timestamp()]Timer reset [resettext]" + R.fields["comments"] += "Автоматически сгенерировано [name] в [GLOB.current_date_string] [station_time_timestamp()]Таймер перезапущен [resettext]" else . = FALSE if("stop") if(timing) timer_end() - var/stoptext = isobserver(usr) ? "from cell control." : "by [usr.name]." - Radio.autosay("Timer stopped manually [stoptext]", name, "Security", list(z)) + var/stoptext = isobserver(usr) ? "from cell control." : "сотрудником [usr.name]." + Radio.autosay("Таймер принудительно остановлен [stoptext]", name, "Security", list(z)) else . = FALSE if("flash") for(var/obj/machinery/flasher/flasher in targets) if(flasher.last_flash && (flasher.last_flash + 15 SECONDS) > world.time) - to_chat(usr, span_warning("Flash is still recharging.")) + to_chat(usr, span_warning("Флешер перезаряжается.")) else flasher.flash() else @@ -482,33 +496,33 @@ /obj/machinery/door_timer/cell_1 - name = "Cell 1" + name = "Камера 1" id = "Cell 1" /obj/machinery/door_timer/cell_2 - name = "Cell 2" + name = "Камера 2" id = "Cell 2" /obj/machinery/door_timer/cell_3 - name = "Cell 3" + name = "Камера 3" id = "Cell 3" /obj/machinery/door_timer/cell_4 - name = "Cell 4" + name = "Камера 4" id = "Cell 4" /obj/machinery/door_timer/cell_5 - name = "Cell 5" + name = "Камера 5" id = "Cell 5" /obj/machinery/door_timer/cell_6 - name = "Cell 6" + name = "Камера 6" id = "Cell 6" /obj/machinery/door_timer/cell_7 - name = "Cell 7" + name = "Камера 7" id = "Cell 7" /obj/machinery/door_timer/cell_8 - name = "Cell 8" + name = "Камера 8" id = "Cell 8" diff --git a/tgui/packages/tgui/interfaces/BrigCells.js b/tgui/packages/tgui/interfaces/BrigCells.js index d135f8f42d5..458200bd839 100644 --- a/tgui/packages/tgui/interfaces/BrigCells.js +++ b/tgui/packages/tgui/interfaces/BrigCells.js @@ -48,13 +48,13 @@ const BrigCellsTableRow = (properties, context) => { const BrigCellsTable = ({ cells }) => ( - Cell - Occupant - Crimes - Brigged By - Time Brigged For - Time Left - Release + Камера + Заключённый + Обвинения + Сотрудник + Срок + Осталось + Выпустить {cells.map((cell) => ( diff --git a/tgui/packages/tgui/interfaces/BrigTimer.js b/tgui/packages/tgui/interfaces/BrigTimer.js index fe9519ccb63..1832d5afeb1 100644 --- a/tgui/packages/tgui/interfaces/BrigTimer.js +++ b/tgui/packages/tgui/interfaces/BrigTimer.js @@ -26,45 +26,43 @@ export const BrigTimer = (props, context) => { return ( -
+
- {data.cell_id} - + {data.cell_id} + {data.nameText} - {data.crimes} - + {data.crimes} + {data.brigged_by} - - {data.time_set} - - + {data.time_set} + {data.time_left} - + <>
{!data.timing && ( -
+
- +