mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Merge branch 'master' into line-by-line-profiling
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(src, "<span class='danger'>Failed to establish database connection.</span>")
|
||||
return
|
||||
var/polltype = input("Choose poll type.","Poll Type") in list("Single Option","Text Reply","Rating","Multiple Choice", "Instant Runoff Voting")|null
|
||||
var/polltype = input("Choose poll type.","Poll Type") as null|anything in list("Single Option","Text Reply","Rating","Multiple Choice", "Instant Runoff Voting")
|
||||
var/choice_amount = 0
|
||||
switch(polltype)
|
||||
if("Single Option")
|
||||
@@ -18,10 +18,14 @@
|
||||
if("Multiple Choice")
|
||||
polltype = POLLTYPE_MULTI
|
||||
choice_amount = input("How many choices should be allowed?","Select choice amount") as num|null
|
||||
if(choice_amount == 0)
|
||||
to_chat(src, "Multiple choice poll must have at least one choice allowed.")
|
||||
else if (choice_amount == null)
|
||||
return
|
||||
switch(choice_amount)
|
||||
if(0)
|
||||
to_chat(src, "Multiple choice poll must have at least one choice allowed.")
|
||||
return
|
||||
if(1)
|
||||
polltype = POLLTYPE_OPTION
|
||||
if(null)
|
||||
return
|
||||
if ("Instant Runoff Voting")
|
||||
polltype = POLLTYPE_IRV
|
||||
else
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
var/valueholder = "derp"
|
||||
var/objholder = /obj/structure/closet
|
||||
var/atom/movable/stored = null
|
||||
var/list/preview = list()
|
||||
|
||||
/datum/buildmode/New(client/c)
|
||||
create_buttons()
|
||||
@@ -94,6 +95,8 @@
|
||||
holder.screen -= buttons
|
||||
holder.click_intercept = null
|
||||
holder.show_popup_menus = 1
|
||||
usr.client.images -= preview
|
||||
preview.Cut()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -150,6 +153,7 @@
|
||||
if(AREA_BUILDMODE)
|
||||
dat += "***********************************************************"
|
||||
dat += "Left Mouse Button on turf/obj/mob = Select corner"
|
||||
dat += "Right Mouse Button on turf/obj/mob = Reset corner selection"
|
||||
dat += "Right Mouse Button on buildmode button = Select generator"
|
||||
dat += "***********************************************************"
|
||||
if(COPY_BUILDMODE)
|
||||
@@ -338,13 +342,20 @@
|
||||
throw_atom.throw_at(object, 10, 1,user)
|
||||
log_admin("Build Mode: [key_name(user)] threw [throw_atom] at [object] ([object.x],[object.y],[object.z])")
|
||||
if(AREA_BUILDMODE)
|
||||
if(!cornerA)
|
||||
cornerA = get_turf(object)
|
||||
return
|
||||
if(cornerA && !cornerB)
|
||||
cornerB = get_turf(object)
|
||||
|
||||
if(left_click) //rectangular
|
||||
if(!cornerA)
|
||||
cornerA = get_turf(object)
|
||||
preview += image('icons/turf/overlays.dmi',cornerA,"greenOverlay")
|
||||
usr.client.images -= preview
|
||||
usr.client.images += preview
|
||||
return
|
||||
if(cornerA && !cornerB)
|
||||
cornerB = get_turf(object)
|
||||
preview += image('icons/turf/overlays.dmi',cornerB,"blueOverlay")
|
||||
usr.client.images -= preview
|
||||
usr.client.images += preview
|
||||
to_chat(user, "<span class='boldwarning'>Region selected, if you're happy with your selection left click again, otherwise right click.</span>")
|
||||
return
|
||||
if(cornerA && cornerB)
|
||||
if(!generator_path)
|
||||
to_chat(user, "<span class='warning'>Select generator type first.</span>")
|
||||
@@ -354,10 +365,18 @@
|
||||
if(GLOB.reloading_map)
|
||||
to_chat(user, "<span class='boldwarning'>You are already reloading an area! Please wait for it to fully finish loading before trying to load another!</span>")
|
||||
return
|
||||
G.defineRegion(cornerA,cornerB,1)
|
||||
G.generate()
|
||||
G.defineRegion(cornerA, cornerB, 1)
|
||||
for(var/t in G.map)
|
||||
preview += image('icons/turf/overlays.dmi', t ,"redOverlay")
|
||||
usr.client.images -= preview
|
||||
usr.client.images += preview
|
||||
var/confirm = alert("Are you sure you want run the map generator?", "Run generator", "Yes", "No")
|
||||
if(confirm == "Yes")
|
||||
G.generate()
|
||||
cornerA = null
|
||||
cornerB = null
|
||||
usr.client.images -= preview
|
||||
preview.Cut()
|
||||
return
|
||||
//Something wrong - Reset
|
||||
cornerA = null
|
||||
|
||||
Reference in New Issue
Block a user