diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index b4b2acd411e..0480bd43814 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -24,6 +24,8 @@ #define ui_lingchemdisplay "WEST:6,CENTER-1:15" #define ui_lingstingdisplay "WEST:6,CENTER-3:11" #define ui_crafting "12:-10,1:5" +#define ui_building "12:-10,1:21" + #define ui_devilsouldisplay "WEST:6,CENTER-1:15" //Lower center, persistant menu diff --git a/code/_onclick/hud/generic_dextrous.dm b/code/_onclick/hud/generic_dextrous.dm index 2d9ae17bc0b..8ecfed99627 100644 --- a/code/_onclick/hud/generic_dextrous.dm +++ b/code/_onclick/hud/generic_dextrous.dm @@ -51,6 +51,10 @@ using.icon = ui_style static_inventory += using + using = new /obj/screen/inventory/area_creator + using.icon = ui_style + static_inventory += using + mymob.client.screen = list() for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory)) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 0b157d405e1..33cac0a4d28 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -95,6 +95,10 @@ using.icon = ui_style static_inventory += using + using = new /obj/screen/inventory/area_creator + using.icon = ui_style + static_inventory += using + using = new /obj/screen/act_intent() using.icon_state = mymob.a_intent static_inventory += using diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index bbdd63947cf..529a5c11ad1 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -58,6 +58,21 @@ return M.OpenCraftingMenu() +/obj/screen/inventory/area_creator + name = "create new area" + icon = 'icons/mob/screen_midnight.dmi' + icon_state = "area_edit" + screen_loc = ui_building + +/obj/screen/inventory/area_creator/Click() + if(usr.incapacitated()) + return 1 + var/area/A = get_area(usr) + if(!A.outdoors) + usr << "There is already a defined structure here." + return 1 + create_area(usr) + /obj/screen/inventory var/slot_id // The indentifier for the slot. It has nothing to do with ID cards. var/icon_empty // Icon when empty. For now used only by humans. diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 56e99c069fd..509f41dabea 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -1,3 +1,18 @@ +#define AREA_ERRNONE 0 +#define AREA_STATION 1 +#define AREA_SPACE 2 +#define AREA_SPECIAL 3 + +#define BORDER_ERROR 0 +#define BORDER_NONE 1 +#define BORDER_BETWEEN 2 +#define BORDER_2NDTILE 3 +#define BORDER_SPACE 4 + +#define ROOM_ERR_LOLWAT 0 +#define ROOM_ERR_SPACE 1 +#define ROOM_ERR_TOOLARGE 2 + /obj/item/areaeditor name = "area modification item" icon = 'icons/obj/items.dmi' @@ -5,22 +20,6 @@ attack_verb = list("attacked", "bapped", "hit") var/fluffnotice = "Nobody's gonna read this stuff!" - var/const/AREA_ERRNONE = 0 - var/const/AREA_STATION = 1 - var/const/AREA_SPACE = 2 - var/const/AREA_SPECIAL = 3 - - var/const/BORDER_ERROR = 0 - var/const/BORDER_NONE = 1 - var/const/BORDER_BETWEEN = 2 - var/const/BORDER_2NDTILE = 3 - var/const/BORDER_SPACE = 4 - - var/const/ROOM_ERR_LOLWAT = 0 - var/const/ROOM_ERR_SPACE = -1 - var/const/ROOM_ERR_TOOLARGE = -2 - - /obj/item/areaeditor/attack_self(mob/user) add_fingerprint(user) var/text = "[src] \ @@ -43,37 +42,9 @@ return if(href_list["create_area"]) if(get_area_type()==AREA_SPACE) - create_area() + create_area(usr) updateUsrDialog() - -//One-use area creation permits. -/obj/item/areaeditor/permit - name = "construction permit" - icon_state = "permit" - desc = "This is a one-use permit that allows the user to offically declare a built room as new addition to the station." - fluffnotice = "Nanotrasen Engineering requires all on-station construction projects to be approved by a head of staff, as detailed in Nanotrasen Company Regulation 512-C (Mid-Shift Modifications to Company Property). \ - By submitting this form, you accept any fines, fees, or personal injury/death that may occur during construction." - w_class = 1 - - -/obj/item/areaeditor/permit/attack_self(mob/user) - . = ..() - var/area/A = get_area() - if(get_area_type() == AREA_STATION) - . += "

According to \the [src], you are now in \"[html_encode(A.name)]\".

" - var/datum/browser/popup = new(user, "blueprints", "[src]", 700, 500) - popup.set_content(.) - popup.open() - onclose(usr, "blueprints") - - -/obj/item/areaeditor/permit/create_area() - var/success = ..() - if(success) - qdel(src) - - //Station blueprints!!! /obj/item/areaeditor/blueprints name = "station blueprints" @@ -87,7 +58,6 @@ /obj/item/areaeditor/blueprints/Destroy() clear_viewer() - return ..() @@ -179,29 +149,28 @@ return AREA_SPECIAL return AREA_STATION - -/obj/item/areaeditor/proc/create_area() - var/res = detect_room(get_turf(usr)) +/proc/create_area(mob/living/creator) + var/res = detect_room(get_turf(creator)) if(!istype(res,/list)) switch(res) if(ROOM_ERR_SPACE) - usr << "The new area must be completely airtight." + creator << "The new area must be completely airtight." return if(ROOM_ERR_TOOLARGE) - usr << "The new area is too large." + creator << "The new area is too large." return else - usr << "Error! Please notify administration." + creator << "Error! Please notify administration." return var/list/turfs = res - var/str = trim(stripped_input(usr,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN)) + var/str = trim(stripped_input(creator,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN)) if(!str || !length(str)) //cancel return if(length(str) > 50) - usr << "The given name is too long. The area remains undefined." + creator << "The given name is too long. The area remains undefined." return - var/area/old = get_area(get_turf(src)) + var/area/old = get_area(get_turf(creator)) var/old_gravity = old.has_gravity var/area/A @@ -220,14 +189,14 @@ A.contents += turfs A.SetDynamicLighting() A.has_gravity = old_gravity - interact() + creator << "You have created a new area, named [str]. It is now weather proof, and constructing an APC will allow it to be powered." return 1 /obj/item/areaeditor/proc/edit_area() var/area/A = get_area() var/prevname = "[A.name]" - var/str = trim(stripped_input(usr,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN)) + var/str = trim(stripped_input(usr,"New area name:", "Area Creation", "", MAX_NAME_LEN)) if(!str || !length(str) || str==prevname) //cancel return if(length(str) > 50) @@ -258,33 +227,26 @@ //TODO: much much more. Unnamed airlocks, cameras, etc. -/obj/item/areaeditor/proc/check_tile_is_border(turf/T2,dir) - if (istype(T2, /turf/open/space)) - return BORDER_SPACE //omg hull breach we all going to die here - if (get_area_type(T2.loc)!=AREA_SPACE) - return BORDER_BETWEEN - if (istype(T2, /turf/closed/wall)) - return BORDER_2NDTILE - if (!istype(T2, /turf)) - return BORDER_BETWEEN +/turf/proc/check_tile_is_border() + return BORDER_NONE - for (var/obj/structure/window/W in T2) - if(turn(dir,180) == W.dir) - return BORDER_BETWEEN - if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)) +/turf/open/space/check_tile_is_border() + return BORDER_SPACE + +/turf/closed/check_tile_is_border() + return BORDER_2NDTILE + +/turf/open/check_tile_is_border() + for(var/atom/movable/AM in src) + if(!AM.CanAtmosPass(src)) return BORDER_2NDTILE - for(var/obj/machinery/door/window/D in T2) - if(turn(dir,180) == D.dir) - return BORDER_BETWEEN - if (locate(/obj/machinery/door) in T2) - return BORDER_2NDTILE - if (locate(/obj/structure/falsewall) in T2) - return BORDER_2NDTILE return BORDER_NONE +/turf/closed/mineral/check_tile_is_border() + return BORDER_NONE -/obj/item/areaeditor/proc/detect_room(turf/first) +/proc/detect_room(turf/first) var/list/turf/found = new var/list/turf/pending = list(first) var/list/border = list() @@ -312,7 +274,7 @@ if (!isturf(NT) || (NT in found) || (NT in pending)) continue - switch(check_tile_is_border(NT,dir)) + switch(NT.check_tile_is_border()) if(BORDER_NONE) pending+=NT if(BORDER_BETWEEN) @@ -333,7 +295,7 @@ var/turf/U = get_step(F, direction) if((U in border) || (U in found)) continue - if(check_tile_is_border(U, direction) == BORDER_2NDTILE) + if(U.check_tile_is_border() == BORDER_2NDTILE) found += U found |= F return found @@ -347,4 +309,4 @@ desc = "A digital copy of the station blueprints stored in your memory." icon = 'icons/obj/items.dmi' icon_state = "blueprints" - fluffnotice = "Intellectual Property of Nanotrasen. For use in engineering cyborgs only. Wipe from memory upon departure from the station." \ No newline at end of file + fluffnotice = "Intellectual Property of Nanotrasen. For use in engineering cyborgs only. Wipe from memory upon departure from the station." diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index d757dbe0abe..09690214746 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -343,18 +343,6 @@ for(var/i = 1; i <= 5; i++) new /obj/item/weapon/reagent_containers/food/snacks/monkeycube(src) - -/obj/item/weapon/storage/box/permits - name = "box of construction permits" - desc = "A box for containing construction permits, used to officially declare built rooms as additions to the station." - icon_state = "id" - -/obj/item/weapon/storage/box/permits/New() //There's only a few, so blueprints are still useful beyond setting every room's name to PRIMARY FART STORAGE - ..() - for(var/i in 1 to 3) - new /obj/item/areaeditor/permit(src) - - /obj/item/weapon/storage/box/ids name = "box of spare IDs" desc = "Has so many empty IDs." diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm index cdc875701cb..d351b44af88 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm @@ -17,7 +17,6 @@ new /obj/item/weapon/storage/toolbox/mechanical(src) new /obj/item/clothing/suit/hazardvest(src) new /obj/item/device/megaphone/command(src) - new /obj/item/weapon/storage/box/permits(src) new /obj/item/areaeditor/blueprints(src) new /obj/item/weapon/airlock_painter(src) new /obj/item/weapon/holosign_creator/engineering(src) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 681c33553ae..936e2907d99 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1086,4 +1086,4 @@ Sorry Giacom. Please don't be mad :( return /mob/living/proc/fakefire() - return \ No newline at end of file + return diff --git a/icons/mob/screen_midnight.dmi b/icons/mob/screen_midnight.dmi index 64fd70f2d23..38d081e712c 100644 Binary files a/icons/mob/screen_midnight.dmi and b/icons/mob/screen_midnight.dmi differ diff --git a/icons/mob/screen_operative.dmi b/icons/mob/screen_operative.dmi index d6f99ea8574..c6fe98edb4f 100644 Binary files a/icons/mob/screen_operative.dmi and b/icons/mob/screen_operative.dmi differ diff --git a/icons/mob/screen_plasmafire.dmi b/icons/mob/screen_plasmafire.dmi index a3334dc8b51..68f86526149 100644 Binary files a/icons/mob/screen_plasmafire.dmi and b/icons/mob/screen_plasmafire.dmi differ diff --git a/icons/mob/screen_retro.dmi b/icons/mob/screen_retro.dmi index 088b44f2396..fd2cf2f611b 100644 Binary files a/icons/mob/screen_retro.dmi and b/icons/mob/screen_retro.dmi differ diff --git a/icons/mob/screen_slimecore.dmi b/icons/mob/screen_slimecore.dmi index 69787bb2299..f0bfece60eb 100644 Binary files a/icons/mob/screen_slimecore.dmi and b/icons/mob/screen_slimecore.dmi differ