/obj/screen --> /atom/movable/screen
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
var/switch_state = BM_SWITCHSTATE_NONE
|
||||
var/switch_width = 5
|
||||
// modeswitch UI
|
||||
var/obj/screen/buildmode/mode/modebutton
|
||||
var/atom/movable/screen/buildmode/mode/modebutton
|
||||
var/list/modeswitch_buttons = list()
|
||||
// dirswitch UI
|
||||
var/obj/screen/buildmode/bdir/dirbutton
|
||||
var/atom/movable/screen/buildmode/bdir/dirbutton
|
||||
var/list/dirswitch_buttons = list()
|
||||
|
||||
/datum/buildmode/New(client/c)
|
||||
@@ -34,7 +34,7 @@
|
||||
holder.screen += buttons
|
||||
holder.click_intercept = src
|
||||
mode.enter_mode(src)
|
||||
|
||||
|
||||
/datum/buildmode/proc/quit()
|
||||
mode.exit_mode(src)
|
||||
holder.screen -= buttons
|
||||
@@ -63,16 +63,16 @@
|
||||
|
||||
/datum/buildmode/proc/create_buttons()
|
||||
// keep a reference so we can update it upon mode switch
|
||||
modebutton = new /obj/screen/buildmode/mode(src)
|
||||
modebutton = new /atom/movable/screen/buildmode/mode(src)
|
||||
buttons += modebutton
|
||||
buttons += new /obj/screen/buildmode/help(src)
|
||||
buttons += new /atom/movable/screen/buildmode/help(src)
|
||||
// keep a reference so we can update it upon dir switch
|
||||
dirbutton = new /obj/screen/buildmode/bdir(src)
|
||||
dirbutton = new /atom/movable/screen/buildmode/bdir(src)
|
||||
buttons += dirbutton
|
||||
buttons += new /obj/screen/buildmode/quit(src)
|
||||
buttons += new /atom/movable/screen/buildmode/quit(src)
|
||||
// build the lists of switching buttons
|
||||
build_options_grid(subtypesof(/datum/buildmode_mode), modeswitch_buttons, /obj/screen/buildmode/modeswitch)
|
||||
build_options_grid(list(SOUTH,EAST,WEST,NORTH,NORTHWEST), dirswitch_buttons, /obj/screen/buildmode/dirswitch)
|
||||
build_options_grid(subtypesof(/datum/buildmode_mode), modeswitch_buttons, /atom/movable/screen/buildmode/modeswitch)
|
||||
build_options_grid(list(SOUTH,EAST,WEST,NORTH,NORTHWEST), dirswitch_buttons, /atom/movable/screen/buildmode/dirswitch)
|
||||
|
||||
// this creates a nice offset grid for choosing between buildmode options,
|
||||
// because going "click click click ah hell" sucks.
|
||||
@@ -81,7 +81,7 @@
|
||||
for(var/thing in elements)
|
||||
var/x = pos_idx % switch_width
|
||||
var/y = FLOOR(pos_idx / switch_width, 1)
|
||||
var/obj/screen/buildmode/B = new buttontype(src, thing)
|
||||
var/atom/movable/screen/buildmode/B = new buttontype(src, thing)
|
||||
// extra .5 for a nice offset look
|
||||
B.screen_loc = "NORTH-[(1 + 0.5 + y*1.5)],WEST+[0.5 + x*1.5]"
|
||||
buttonslist += B
|
||||
@@ -100,7 +100,7 @@
|
||||
else
|
||||
close_switchstates()
|
||||
open_modeswitch()
|
||||
|
||||
|
||||
/datum/buildmode/proc/open_modeswitch()
|
||||
switch_state = BM_SWITCHSTATE_MODE
|
||||
holder.screen += modeswitch_buttons
|
||||
@@ -115,7 +115,7 @@
|
||||
else
|
||||
close_switchstates()
|
||||
open_dirswitch()
|
||||
|
||||
|
||||
/datum/buildmode/proc/open_dirswitch()
|
||||
switch_state = BM_SWITCHSTATE_DIR
|
||||
holder.screen += dirswitch_buttons
|
||||
@@ -155,7 +155,7 @@
|
||||
new /datum/buildmode(M.client)
|
||||
message_admins("[key_name_admin(usr)] has entered build mode.")
|
||||
log_admin("[key_name(usr)] has entered build mode.")
|
||||
|
||||
|
||||
#undef BM_SWITCHSTATE_NONE
|
||||
#undef BM_SWITCHSTATE_MODE
|
||||
#undef BM_SWITCHSTATE_DIR
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/obj/screen/buildmode
|
||||
/atom/movable/screen/buildmode
|
||||
icon = 'icons/misc/buildmode.dmi'
|
||||
var/datum/buildmode/bd
|
||||
// If we don't do this, we get occluded by item action buttons
|
||||
layer = ABOVE_HUD_LAYER
|
||||
|
||||
/obj/screen/buildmode/New(bld)
|
||||
/atom/movable/screen/buildmode/New(bld)
|
||||
bd = bld
|
||||
return ..()
|
||||
|
||||
/obj/screen/buildmode/Destroy()
|
||||
/atom/movable/screen/buildmode/Destroy()
|
||||
bd = null
|
||||
return ..()
|
||||
|
||||
/obj/screen/buildmode/mode
|
||||
/atom/movable/screen/buildmode/mode
|
||||
name = "Toggle Mode"
|
||||
icon_state = "buildmode_basic"
|
||||
screen_loc = "NORTH,WEST"
|
||||
|
||||
/obj/screen/buildmode/mode/Click(location, control, params)
|
||||
/atom/movable/screen/buildmode/mode/Click(location, control, params)
|
||||
var/list/pa = params2list(params)
|
||||
|
||||
if(pa.Find("left"))
|
||||
@@ -27,63 +27,63 @@
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/screen/buildmode/mode/update_icon_state()
|
||||
/atom/movable/screen/buildmode/mode/update_icon_state()
|
||||
icon_state = bd.mode.get_button_iconstate()
|
||||
|
||||
/obj/screen/buildmode/help
|
||||
/atom/movable/screen/buildmode/help
|
||||
icon_state = "buildhelp"
|
||||
screen_loc = "NORTH,WEST+1"
|
||||
name = "Buildmode Help"
|
||||
|
||||
/obj/screen/buildmode/help/Click(location, control, params)
|
||||
/atom/movable/screen/buildmode/help/Click(location, control, params)
|
||||
bd.mode.show_help(usr.client)
|
||||
return 1
|
||||
|
||||
/obj/screen/buildmode/bdir
|
||||
/atom/movable/screen/buildmode/bdir
|
||||
icon_state = "build"
|
||||
screen_loc = "NORTH,WEST+2"
|
||||
name = "Change Dir"
|
||||
|
||||
/obj/screen/buildmode/bdir/update_icon_state()
|
||||
/atom/movable/screen/buildmode/bdir/update_icon_state()
|
||||
dir = bd.build_dir
|
||||
|
||||
/obj/screen/buildmode/bdir/Click()
|
||||
/atom/movable/screen/buildmode/bdir/Click()
|
||||
bd.toggle_dirswitch()
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
// used to switch between modes
|
||||
/obj/screen/buildmode/modeswitch
|
||||
/atom/movable/screen/buildmode/modeswitch
|
||||
var/datum/buildmode_mode/modetype
|
||||
|
||||
/obj/screen/buildmode/modeswitch/New(bld, mt)
|
||||
/atom/movable/screen/buildmode/modeswitch/New(bld, mt)
|
||||
modetype = mt
|
||||
icon_state = "buildmode_[initial(modetype.key)]"
|
||||
name = initial(modetype.key)
|
||||
return ..(bld)
|
||||
|
||||
/obj/screen/buildmode/modeswitch/Click()
|
||||
/atom/movable/screen/buildmode/modeswitch/Click()
|
||||
bd.change_mode(modetype)
|
||||
return 1
|
||||
|
||||
// used to switch between dirs
|
||||
/obj/screen/buildmode/dirswitch
|
||||
/atom/movable/screen/buildmode/dirswitch
|
||||
icon_state = "build"
|
||||
|
||||
/obj/screen/buildmode/dirswitch/New(bld, dir)
|
||||
/atom/movable/screen/buildmode/dirswitch/New(bld, dir)
|
||||
src.dir = dir
|
||||
name = dir2text(dir)
|
||||
return ..(bld)
|
||||
|
||||
/obj/screen/buildmode/dirswitch/Click()
|
||||
/atom/movable/screen/buildmode/dirswitch/Click()
|
||||
bd.change_dir(dir)
|
||||
return 1
|
||||
|
||||
/obj/screen/buildmode/quit
|
||||
/atom/movable/screen/buildmode/quit
|
||||
icon_state = "buildquit"
|
||||
screen_loc = "NORTH,WEST+3"
|
||||
name = "Quit Buildmode"
|
||||
|
||||
/obj/screen/buildmode/quit/Click()
|
||||
/atom/movable/screen/buildmode/quit/Click()
|
||||
bd.quit()
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user