Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some admin verbs #471

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modular_bandastation/admin/_admin.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/modpack/admin
name = "Административные удобства"
desc = "Всякие вещи для удобства администрации и дебага."
author = "Aylong"
3 changes: 3 additions & 0 deletions modular_bandastation/admin/_admin.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "_admin.dm"

#include "code/admin_verbs.dm"
30 changes: 30 additions & 0 deletions modular_bandastation/admin/code/admin_verbs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ADMIN_VERB_ONLY_CONTEXT_MENU(spawn_debug_outfit, R_SPAWN, "Debug Outfit", mob/admin in world)
if(tgui_alert(admin,"Это заспавнит вас в специальном Debug прикиде, удаляя при этом ваше старое тело если оно было. Вы уверены?", "Debug Outfit", list("Да", "Нет")) != "Да")
return
var/mob/living/carbon/human/admin_body = admin.change_mob_type(/mob/living/carbon/human, delete_old_mob = TRUE)
admin_body.equipOutfit(/datum/outfit/debug)

ADMIN_VERB_ONLY_CONTEXT_MENU(download_flaticon, R_ADMIN, "Download Icon", atom/thing in world)
var/icon/image = getFlatIcon(thing, no_anim = TRUE)
var/image_width = max(image.Width(), 32)
var/image_height = max(image.Height(), 32)

var/resize_answer = tgui_alert(usr, "Хотите ли вы изменить размер иконки? Оригинальный размер: [image_width]x[image_height]", "Download Icon", list("Да", "Нет", "Удвоить"))
if(resize_answer != "Нет" && !isnull(resize_answer))
switch(resize_answer)
if("Да")
var/new_width = tgui_input_number(usr, "Оригинальная ширина: [image_width]px", "Изменение ширины", image_width, 1024, 16)
if(!isnull(new_width))
image_width = new_width

var/new_height = tgui_input_number(usr, "Оригинальная высота: [image_height]px", "Изменение высоты", image_height, 1024, 16)
if(!isnull(new_height))
image_height = new_height

if("Удвоить")
image_width *= 2
image_height *= 2

image.Scale(image_width, image_height)

usr << ftp(image, "[thing.name]_[image_width]x[image_height].png")
1 change: 1 addition & 0 deletions modular_bandastation/modular_bandastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "_helpers220/_helpers220.dme"
#include "_signals220/_signals220.dme"
#include "_singletons/_singletons.dme"
#include "admin/_admin.dme"
#include "aesthetics/_aesthetics.dme"
#include "automapper/_automapper.dme"
#include "ai_laws/_ai_laws.dme"
Expand Down
Loading