From 280c8229fac59f33d75dc02e23a04a612bf1a2fe Mon Sep 17 00:00:00 2001 From: Aylong Date: Wed, 31 Jul 2024 09:50:43 +0300 Subject: [PATCH 1/4] Add some admin verbs --- modular_bandastation/admin/_admin.dm | 4 ++++ modular_bandastation/admin/_admin.dme | 3 +++ modular_bandastation/admin/code/admin_verbs.dm | 11 +++++++++++ modular_bandastation/modular_bandastation.dme | 1 + 4 files changed, 19 insertions(+) create mode 100644 modular_bandastation/admin/_admin.dm create mode 100644 modular_bandastation/admin/_admin.dme create mode 100644 modular_bandastation/admin/code/admin_verbs.dm diff --git a/modular_bandastation/admin/_admin.dm b/modular_bandastation/admin/_admin.dm new file mode 100644 index 0000000000000..f9230d0005fbe --- /dev/null +++ b/modular_bandastation/admin/_admin.dm @@ -0,0 +1,4 @@ +/datum/modpack/admin + name = "Административные удобства" + desc = "Всякие вещи для удобства администрации и дебага." + author = "Aylong" diff --git a/modular_bandastation/admin/_admin.dme b/modular_bandastation/admin/_admin.dme new file mode 100644 index 0000000000000..a72aec54b1a55 --- /dev/null +++ b/modular_bandastation/admin/_admin.dme @@ -0,0 +1,3 @@ +#include "_admin.dm" + +#include "code/admin_verbs.dm" diff --git a/modular_bandastation/admin/code/admin_verbs.dm b/modular_bandastation/admin/code/admin_verbs.dm new file mode 100644 index 0000000000000..05027f03f430a --- /dev/null +++ b/modular_bandastation/admin/code/admin_verbs.dm @@ -0,0 +1,11 @@ +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 as mob|obj|turf) + var/icon/image = getFlatIcon(thing) + if(image.Width() == 32 || image.Height() == 32) + image.Scale(64, 64) + usr << ftp(image, "[thing.name].png") diff --git a/modular_bandastation/modular_bandastation.dme b/modular_bandastation/modular_bandastation.dme index bd2c8e2acee37..11b02fadf085f 100644 --- a/modular_bandastation/modular_bandastation.dme +++ b/modular_bandastation/modular_bandastation.dme @@ -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" From fdc8825aaac89990066cb607e7170748f1733d94 Mon Sep 17 00:00:00 2001 From: Aylong Date: Wed, 31 Jul 2024 12:08:40 +0300 Subject: [PATCH 2/4] Add custom download image size --- _maps/_basemap.dm | 2 +- .../admin/code/admin_verbs.dm | 34 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/_maps/_basemap.dm b/_maps/_basemap.dm index 20432bbe8dd51..39da2a62fe776 100644 --- a/_maps/_basemap.dm +++ b/_maps/_basemap.dm @@ -1,4 +1,4 @@ -//#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. +#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. #include "map_files\generic\CentCom.dmm" diff --git a/modular_bandastation/admin/code/admin_verbs.dm b/modular_bandastation/admin/code/admin_verbs.dm index 05027f03f430a..2638ed1c44934 100644 --- a/modular_bandastation/admin/code/admin_verbs.dm +++ b/modular_bandastation/admin/code/admin_verbs.dm @@ -4,8 +4,32 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(spawn_debug_outfit, R_SPAWN, "Debug Outfit", mob/ad 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 as mob|obj|turf) - var/icon/image = getFlatIcon(thing) - if(image.Width() == 32 || image.Height() == 32) - image.Scale(64, 64) - usr << ftp(image, "[thing.name].png") +ADMIN_VERB_ONLY_CONTEXT_MENU(download_flaticon, R_ADMIN, "Download Icon", atom/thing in world) + var/icon/image = getFlatIcon(thing, no_anim = TRUE) + var/original_width = max(image.Width(), 32) + var/original_height = max(image.Height(), 32) + var/image_width + var/image_height + + var/resize_answer = tgui_alert(usr, "Хотите ли вы изменить размер иконки? Оригинальный размер: [original_width]x[original_height]", "Download Icon", list("Да", "Нет", "Удвоить")) + if(resize_answer != "Нет" && !isnull(resize_answer)) + switch(resize_answer) + if("Да") + image_width = tgui_input_number(usr, "Оригинальная ширина: [original_width]px", "Изменение ширины", original_width, 1024, 16) + if(isnull(image_width)) + image_width = original_width + + image_height = tgui_input_number(usr, "Оригинальная высота: [original_height]px", "Изменение высоты", original_height, 1024, 16) + if(isnull(image_height)) + image_height = original_height + + if("Удвоить") + image_width = original_width * 2 + image_height = original_height * 2 + + image.Scale(image_width, image_height) + else + image_width = original_width + image_height = original_height + + usr << ftp(image, "[thing.name]_[image_width]x[image_height].png") From 584a164b643557f8e4f49f405ded48bb0ec8f6e1 Mon Sep 17 00:00:00 2001 From: Aylong Date: Wed, 31 Jul 2024 12:09:16 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=9A=D0=B0=D0=BA=D0=BE=D0=B9=20=D0=B6?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=B8=D0=B4=D0=BE=D1=80=20=D1=8D=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _maps/_basemap.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_maps/_basemap.dm b/_maps/_basemap.dm index 39da2a62fe776..20432bbe8dd51 100644 --- a/_maps/_basemap.dm +++ b/_maps/_basemap.dm @@ -1,4 +1,4 @@ -#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. +//#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it. #include "map_files\generic\CentCom.dmm" From 53e16714d87429dcb78091a6ff2c4a5165c5f532 Mon Sep 17 00:00:00 2001 From: Aylong Date: Wed, 31 Jul 2024 12:41:19 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D0=BE=D1=81=D1=80=D0=B0?= =?UTF-8?q?=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Gaxeer <44334376+gaxeer@users.noreply.github.com> --- .../admin/code/admin_verbs.dm | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/modular_bandastation/admin/code/admin_verbs.dm b/modular_bandastation/admin/code/admin_verbs.dm index 2638ed1c44934..bf72a51ed3825 100644 --- a/modular_bandastation/admin/code/admin_verbs.dm +++ b/modular_bandastation/admin/code/admin_verbs.dm @@ -6,30 +6,25 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(spawn_debug_outfit, R_SPAWN, "Debug Outfit", mob/ad ADMIN_VERB_ONLY_CONTEXT_MENU(download_flaticon, R_ADMIN, "Download Icon", atom/thing in world) var/icon/image = getFlatIcon(thing, no_anim = TRUE) - var/original_width = max(image.Width(), 32) - var/original_height = max(image.Height(), 32) - var/image_width - var/image_height + var/image_width = max(image.Width(), 32) + var/image_height = max(image.Height(), 32) - var/resize_answer = tgui_alert(usr, "Хотите ли вы изменить размер иконки? Оригинальный размер: [original_width]x[original_height]", "Download Icon", list("Да", "Нет", "Удвоить")) + var/resize_answer = tgui_alert(usr, "Хотите ли вы изменить размер иконки? Оригинальный размер: [image_width]x[image_height]", "Download Icon", list("Да", "Нет", "Удвоить")) if(resize_answer != "Нет" && !isnull(resize_answer)) switch(resize_answer) if("Да") - image_width = tgui_input_number(usr, "Оригинальная ширина: [original_width]px", "Изменение ширины", original_width, 1024, 16) - if(isnull(image_width)) - image_width = original_width + var/new_width = tgui_input_number(usr, "Оригинальная ширина: [image_width]px", "Изменение ширины", image_width, 1024, 16) + if(!isnull(new_width)) + image_width = new_width - image_height = tgui_input_number(usr, "Оригинальная высота: [original_height]px", "Изменение высоты", original_height, 1024, 16) - if(isnull(image_height)) - image_height = original_height + 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 = original_width * 2 - image_height = original_height * 2 + image_width *= 2 + image_height *= 2 image.Scale(image_width, image_height) - else - image_width = original_width - image_height = original_height usr << ftp(image, "[thing.name]_[image_width]x[image_height].png")