From d74d6e75c0301605ac5b7f1784afba3d73ebddbb Mon Sep 17 00:00:00 2001 From: Uristqwerty Date: Wed, 16 May 2012 02:08:34 -0400 Subject: [PATCH] Basic teleport-to-clicked-location, menu with size dropdown. --- code/WorkInProgress/AI_Visibility.dm | 22 ++++++++++++- interface/skin.dmf | 49 +++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/code/WorkInProgress/AI_Visibility.dm b/code/WorkInProgress/AI_Visibility.dm index 5f6ea0fd1b..44563c8367 100644 --- a/code/WorkInProgress/AI_Visibility.dm +++ b/code/WorkInProgress/AI_Visibility.dm @@ -43,7 +43,27 @@ var/minimap_updating = 0 var/icon/minimap_icon = new('minimap.dmi', "chunk_base") - var/obj/minimap_obj = new() + var/obj/minimap_obj/minimap_obj = new() + +/obj/minimap_obj/Click(location, control, params) + var/list/par = params2list(params) + var/screen_loc = par["screen-loc"] + + if(findtext(screen_loc, "minimap:") != 1) + return + + screen_loc = copytext(screen_loc, length("minimap:") + 1) + + var/x_text = copytext(screen_loc, 1, findtext(screen_loc, ",")) + var/y_text = copytext(screen_loc, findtext(screen_loc, ",") + 1) + + var/x = (text2num(copytext(x_text, 1, findtext(x_text, ":"))) - 1) * 16 + x += round((text2num(copytext(x_text, findtext(x_text, ":") + 1)) + 1) / 2) + + var/y = (text2num(copytext(y_text, 1, findtext(y_text, ":"))) - 1) * 16 + y += round((text2num(copytext(y_text, findtext(y_text, ":") + 1)) + 1) / 2) + + usr.loc = locate(max(1, x - 1), max(1, y - 1), usr.z) /mob/verb/minimap_test() winshow(src, "minimapwindow", 1) diff --git a/interface/skin.dmf b/interface/skin.dmf index 67bf4a6b58..22e3d79dbd 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -327,6 +327,53 @@ menu "menu" is-disabled = false saved-params = "is-checked" +menu "minimap_menu" + elem + name = "Size" + command = "" + category = "" + is-checked = false + can-check = false + group = "" + is-disabled = false + saved-params = "is-checked" + elem + name = "50%" + command = ".winset \"minimap.icon-size=16\"" + category = "Size" + is-checked = false + can-check = true + group = "minimap_size" + is-disabled = false + saved-params = "is-checked" + elem + name = "100%" + command = ".winset \"minimap.icon-size=32\"" + category = "Size" + is-checked = true + can-check = true + group = "minimap_size" + is-disabled = false + saved-params = "is-checked" + elem + name = "200%" + command = ".winset \"minimap.icon-size=64\"" + category = "Size" + is-checked = false + can-check = true + group = "minimap_size" + is-disabled = false + saved-params = "is-checked" + elem + name = "stretch" + command = ".winset \"minimap.icon-size=0\"" + category = "Size" + is-checked = false + can-check = true + group = "minimap_size" + is-disabled = false + saved-params = "is-checked" + window "Telecomms IDE" elem "Telecomms IDE" @@ -1245,7 +1292,7 @@ window "minimapwindow" transparent-color = none alpha = 255 macro = "" - menu = "" + menu = "minimap_menu" on-close = "" elem "minimap" type = MAP