Skip to content

Commit

Permalink
Кнопка установки времени заключения (TauCetiStation#13494)
Browse files Browse the repository at this point in the history
* Added button for setting brig cell time

* Checking thru clamp()

* Fix text2num

---------

Co-authored-by: vasyu <[email protected]>
  • Loading branch information
ArthurPhilipDent42 and AntonyVasyuk committed Aug 23, 2024
1 parent ef93331 commit 21003fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/game/machinery/doors/brigdoors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
dat += "Установить время: [(setminute ? text("[setminute]:") : null)][setsecond]<br/>"

// Controls
dat += "<a href='?src=\ref[src];tp=-60'>-</a> <a href='?src=\ref[src];tp=-1'>-</a> <a href='?src=\ref[src];tp=1'>+</a> <A href='?src=\ref[src];tp=60'>+</a><br/>"
dat += "<a href='?src=\ref[src];tp=-60'>-</a> <a href='?src=\ref[src];tp=-1'>-</a> <a href='?src=\ref[src];set_time=TRUE'>Ввести время</a> <a href='?src=\ref[src];tp=1'>+</a> <A href='?src=\ref[src];tp=60'>+</a><br/>"

// Mounted flash controls
for(var/obj/machinery/flasher/F in targets)
Expand Down Expand Up @@ -341,6 +341,12 @@

timeset(addtime)

if(href_list["set_time"]) // set timer (in minutes)
var/new_time = input(usr, "Введите время заключения (в минутах):", "Ввод времени") as num
new_time = clamp(new_time, 0, 60)

timeset(new_time * 60)

if(href_list["fc"])
for(var/obj/machinery/flasher/F in targets)
F.flash()
Expand Down

0 comments on commit 21003fe

Please sign in to comment.