Skip to content

Commit

Permalink
Add some admin verbs (#471)
Browse files Browse the repository at this point in the history
## About The Pull Request
Добавил в контекстное меню 2 штучки:
1. Спавн сразу в дебаг аутфите, вместо поиска в огромном списке минуя
кучу ДМ аутфитов
2. Скачивание любой иконки

## Why It's Good For The Game
Удобно

---------

Co-authored-by: Gaxeer <[email protected]>
  • Loading branch information
AyIong and Gaxeer committed Jul 31, 2024
1 parent edcab0b commit ddb9352
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
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

0 comments on commit ddb9352

Please sign in to comment.