Skip to content

Commit

Permalink
Further work on screen elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Dec 6, 2023
1 parent 793f1b6 commit f427753
Show file tree
Hide file tree
Showing 49 changed files with 484 additions and 475 deletions.
4 changes: 4 additions & 0 deletions code/__defines/credits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define CREDIT_ROLL_SPEED 185
#define CREDIT_SPAWN_SPEED 20
#define CREDIT_ANIMATE_HEIGHT (14 * world.icon_size)
#define CREDIT_EASE_DURATION 22
2 changes: 1 addition & 1 deletion code/_onclick/hud/animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
hud_type = /datum/hud/animal

/datum/hud/animal/FinalizeInstantiation()
action_intent = new /obj/screen/intent(null, mymob)
action_intent = new(null, mymob)
adding += action_intent
..()

7 changes: 4 additions & 3 deletions code/_onclick/hud/deity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
hud_type = /datum/hud/deity

/datum/hud/deity/FinalizeInstantiation()
var/obj/screen/intent/deity/D = new()
adding += D
action_intent = D
action_intent = new /obj/screen/intent/deity(null, mymob)
src.adding = list(action_intent)
src.other = list()
..()
var/obj/screen/intent/deity/D = action_intent
D.sync_to_mob(mymob)
97 changes: 0 additions & 97 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,100 +70,3 @@
screen.transform = M
client.screen |= screen

/obj/screen/fullscreen
icon = 'icons/mob/screen_full.dmi'
icon_state = "default"
screen_loc = ui_center_fullscreen
plane = FULLSCREEN_PLANE
layer = FULLSCREEN_LAYER
mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
var/severity = 0
var/allstate = 0 //shows if it should show up for dead people too

/obj/screen/fullscreen/Destroy()
severity = 0
return ..()

/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = DAMAGE_LAYER

/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = DAMAGE_LAYER

/obj/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER

/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER

/obj/screen/fullscreen/blackout
icon = 'icons/mob/screen1.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
layer = BLIND_LAYER

/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
layer = IMPAIRED_LAYER

/obj/screen/fullscreen/blurry
icon = 'icons/mob/screen1.dmi'
screen_loc = ui_entire_screen
icon_state = "blurry"
alpha = 100

/obj/screen/fullscreen/flash
icon = 'icons/mob/screen1.dmi'
screen_loc = ui_entire_screen
icon_state = "flash"

/obj/screen/fullscreen/flash/noise
icon_state = "noise"

/obj/screen/fullscreen/high
icon = 'icons/mob/screen1.dmi'
screen_loc = ui_entire_screen
icon_state = "druggy"
alpha = 180
blend_mode = BLEND_MULTIPLY

/obj/screen/fullscreen/noise
icon = 'icons/effects/static.dmi'
icon_state = "1 light"
screen_loc = ui_entire_screen
alpha = 127

/obj/screen/fullscreen/fadeout
icon = 'icons/mob/screen1.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
alpha = 0
allstate = 1

/obj/screen/fullscreen/fadeout/Initialize(mapload, mob/_owner, ui_style, ui_color, ui_alpha)
. = ..()
animate(src, alpha = 255, time = 10)

/obj/screen/fullscreen/scanline
icon = 'icons/effects/static.dmi'
icon_state = "scanlines"
screen_loc = ui_entire_screen
alpha = 50

/obj/screen/fullscreen/fishbed
icon_state = "fishbed"
allstate = 1

/obj/screen/fullscreen/pain
icon_state = "brutedamageoverlay6"
alpha = 0

/obj/screen/fullscreen/blueprints
icon = 'icons/effects/blueprints.dmi'
icon_state = "base"
screen_loc = ui_entire_screen
alpha = 100
34 changes: 9 additions & 25 deletions code/_onclick/hud/global_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,22 @@ var/global/datum/global_hud/hud
return global.hud

/datum/global_hud
var/obj/screen/nvg
var/obj/screen/thermal
var/obj/screen/meson
var/obj/screen/science
var/obj/screen/holomap
var/obj/screen/global_hud/nvg
var/obj/screen/global_hud/thermal
var/obj/screen/global_hud/meson
var/obj/screen/global_hud/science
var/obj/screen/global_holomap/holomap

// makes custom colored overlay, can also generate scanline
/datum/global_hud/proc/setup_overlay(icon_state, color)
var/obj/screen/screen = new /obj/screen(null)
screen.screen_loc = ui_entire_screen
screen.icon = 'icons/effects/hud_full.dmi'
var/obj/screen/global_hud/screen = new(null)
screen.icon_state = icon_state
screen.plane = FULLSCREEN_PLANE
screen.layer = FULLSCREEN_LAYER
screen.mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
screen.alpha = 125
screen.blend_mode = BLEND_MULTIPLY
screen.color = color
return screen

/datum/global_hud/New()
nvg = setup_overlay("scanline", "#06ff00")
nvg = setup_overlay("scanline", "#06ff00")
thermal = setup_overlay("scanline", "#ff0000")
meson = setup_overlay("scanline", "#9fd800")
meson = setup_overlay("scanline", "#9fd800")
science = setup_overlay("scanline", "#d600d6")

//Holomap screen object is invisible and work
//By setting it as n images location, without icon changes
//Make it part of global hud since it's inmutable
holomap = new /obj/screen(null)
holomap.name = "holomap"
holomap.icon = null
holomap.layer = HUD_BASE_LAYER
holomap.screen_loc = UI_HOLOMAP
holomap.mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
holomap = new(null)
4 changes: 2 additions & 2 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

var/list/hand_hud_objects
var/list/swaphand_hud_objects
var/obj/screen/action_intent
var/obj/screen/move_intent
var/obj/screen/intent/action_intent
var/obj/screen/movement/move_intent
var/obj/screen/stamina/stamina_bar

var/list/adding = list()
Expand Down
38 changes: 19 additions & 19 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

// Draw the attack intent dialogue.
if(hud_data.has_a_intent)
action_intent = new /obj/screen/intent(null, mymob)
action_intent = new(null, mymob)
src.adding += action_intent
hud_elements |= action_intent

if(hud_data.has_m_intent)
move_intent = new /obj/screen/movement(null, mymob, ui_style, ui_color, ui_alpha)
move_intent = new(null, mymob, ui_style, ui_color, ui_alpha)
move_intent.icon_state = mymob.move_intent.hud_icon_state
src.adding += move_intent

Expand All @@ -38,51 +38,51 @@
src.hotkeybuttons += new /obj/screen/resist(null, mymob, ui_style, ui_color, ui_alpha)

if(hud_data.has_throw)
mymob.throw_icon = new /obj/screen/throw_toggle(null, mymob, ui_style, ui_color, ui_alpha)
mymob.throw_icon = new(null, mymob, ui_style, ui_color, ui_alpha)
src.hotkeybuttons += mymob.throw_icon
hud_elements |= mymob.throw_icon

if(hud_data.has_internals)
mymob.internals = new /obj/screen/internals(null, mymob, ui_style)
mymob.internals = new(null, mymob, ui_style)
hud_elements |= mymob.internals

if(hud_data.has_warnings)
mymob.healths = new /obj/screen/health_warning(null, mymob, ui_style)
mymob.healths = new(null, mymob, ui_style)
hud_elements |= mymob.healths

mymob.oxygen = new /obj/screen/oxygen(null, mymob)
mymob.oxygen = new(null, mymob)
hud_elements |= mymob.oxygen

mymob.toxin = new /obj/screen/toxins(null, mymob)
mymob.toxin = new(null, mymob)
hud_elements |= mymob.toxin

mymob.fire = new /obj/screen/fire_warning(null, mymob, ui_style)
mymob.fire = new(null, mymob, ui_style)
hud_elements |= mymob.fire

if(hud_data.has_pressure)
mymob.pressure = new /obj/screen/pressure(null, mymob)
mymob.pressure = new(null, mymob)
hud_elements |= mymob.pressure

if(hud_data.has_bodytemp)
mymob.bodytemp = new /obj/screen/bodytemp(null, mymob)
mymob.bodytemp = new(null, mymob)
hud_elements |= mymob.bodytemp

if(target.isSynthetic())
target.cells = new /obj/screen/warning_cells(null, mymob)
target.cells = new(null, mymob)
hud_elements |= target.cells

else if(hud_data.has_nutrition)
mymob.nutrition_icon = new /obj/screen/food(null, mymob)
mymob.nutrition_icon = new(null, mymob)
hud_elements |= mymob.nutrition_icon

mymob.hydration_icon = new /obj/screen/drink(null, mymob)
mymob.hydration_icon = new(null, mymob)
hud_elements |= mymob.hydration_icon

if(hud_data.has_up_hint)
mymob.up_hint = new /obj/screen/up_hint(null, mymob, ui_style)
mymob.up_hint = new(null, mymob, ui_style)
hud_elements |= mymob.up_hint

mymob.pain = new /obj/screen/fullscreen/pain(null, mymob)
mymob.pain = new(null, mymob)
hud_elements |= mymob.pain

mymob.zone_sel = new(null, mymob, ui_style, ui_color, ui_alpha)
Expand All @@ -93,12 +93,12 @@
hud_elements |= target.attack_selector

//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null, mymob, ui_style, ui_color, ui_alpha)
mymob.gun_setting_icon = new(null, mymob, ui_style, ui_color, ui_alpha)
hud_elements |= mymob.gun_setting_icon

mymob.item_use_icon = new /obj/screen/gun/item(null, mymob, ui_style, ui_color, ui_alpha)
mymob.gun_move_icon = new /obj/screen/gun/move(null, mymob, ui_style, ui_color, ui_alpha)
mymob.radio_use_icon = new /obj/screen/gun/radio(null, mymob, ui_style, ui_color, ui_alpha)
mymob.item_use_icon = new(null, mymob, ui_style, ui_color, ui_alpha)
mymob.gun_move_icon = new(null, mymob, ui_style, ui_color, ui_alpha)
mymob.radio_use_icon = new(null, mymob, ui_style, ui_color, ui_alpha)

..()

Expand Down
53 changes: 0 additions & 53 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,6 @@

var/global/list/radial_menus = list()


/obj/screen/radial
icon = 'icons/screen/radial.dmi'
layer = HUD_ABOVE_ITEM_LAYER
plane = HUD_PLANE
requires_owner = FALSE
var/datum/radial_menu/parent

/obj/screen/radial/Destroy()
parent = null
return ..()

/obj/screen/radial/slice
icon_state = "radial_slice"
var/choice
var/next_page = FALSE
var/tooltips = FALSE

/obj/screen/radial/slice/MouseEntered(location, control, params)
. = ..()
icon_state = "radial_slice_focus"
if(tooltips)
openToolTip(usr, src, params, title = name)

/obj/screen/radial/slice/MouseExited(location, control, params)
. = ..()
icon_state = "radial_slice"
if(tooltips)
closeToolTip(usr)

/obj/screen/radial/slice/Click(location, control, params)
if(parent && usr.client == parent.current_user)
if(next_page)
parent.next_page()
else
parent.element_chosen(choice,usr)

/obj/screen/radial/center
name = "Close Menu"
icon_state = "radial_center"

/obj/screen/radial/center/MouseEntered(location, control, params)
. = ..()
icon_state = "radial_center_focus"

/obj/screen/radial/center/MouseExited(location, control, params)
. = ..()
icon_state = "radial_center"

/obj/screen/radial/center/Click(location, control, params)
if(usr.client == parent.current_user)
parent.finished = TRUE

/datum/radial_menu
var/list/choices = list() //List of choice id's
var/list/choices_icons = list() //choice_id -> icon
Expand Down
16 changes: 0 additions & 16 deletions code/_onclick/hud/radial_persistent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
A derivative of radial menu which persists onscreen until closed and invokes a callback each time an element is clicked
*/

/obj/screen/radial/persistent/center
name = "Close Menu"
icon_state = "radial_center"

/obj/screen/radial/persistent/center/Click(location, control, params)
if(usr.client == parent.current_user)
parent.element_chosen(null,usr)

/obj/screen/radial/persistent/center/MouseEntered(location, control, params)
. = ..()
icon_state = "radial_center_focus"

/obj/screen/radial/persistent/center/MouseExited(location, control, params)
. = ..()
icon_state = "radial_center"

/datum/radial_menu/persistent
var/uniqueid
var/datum/callback/select_proc_callback
Expand Down
Loading

0 comments on commit f427753

Please sign in to comment.