Skip to content

Commit

Permalink
Breaking up the screen icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jun 13, 2023
1 parent 12fc3f4 commit 786406b
Show file tree
Hide file tree
Showing 95 changed files with 303 additions and 234 deletions.
4 changes: 2 additions & 2 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ var/global/list/click_catchers
return global.click_catchers

/obj/screen/click_catcher
icon = 'icons/mob/screen_gen.dmi'
icon_state = "click_catcher"
icon = 'icons/mob/screen/fill.dmi'
icon_state = "blank"
plane = CLICKCATCHER_PLANE
mouse_opacity = 2
screen_loc = "CENTER-7,CENTER-7"
Expand Down
41 changes: 15 additions & 26 deletions code/_onclick/hud/_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
including inventories and item quick actions.
*/
/mob
var/hud_type = null
var/datum/hud/hud_used = null
var/datum/hud/hud_used

/mob/proc/InitializeHud()
if(hud_used)
qdel(hud_used)
if(hud_type)
hud_used = new hud_type(src)
else
hud_used = new /datum/hud(src)
if(ispath(hud_used))
hud_used = new hud_used(src)
else if(istype(hud_used))
hud_used.mymob = src // Probably unnecessary.
hud_used.refresh_client_hud()
refresh_lighting_master()

/datum/hud
Expand All @@ -29,16 +27,16 @@
/// A linear list of types to populate the HUD with
var/list/hud_elements = list(
/decl/hud_element/health,
/decl/hud_element/bodytemp,
/decl/hud_element/condition/bodytemp,
/decl/hud_element/zone_selector,
/decl/hud_element/move_intent,
/decl/hud_element/action_intent,
/decl/hud_element/pressure,
/decl/hud_element/fire,
/decl/hud_element/toxins,
/decl/hud_element/oxygen,
/decl/hud_element/nutrition,
/decl/hud_element/hydration,
/decl/hud_element/condition/pressure,
/decl/hud_element/condition/fire,
/decl/hud_element/condition/toxins,
/decl/hud_element/condition/oxygen,
/decl/hud_element/condition/nutrition,
/decl/hud_element/condition/hydration,
/decl/hud_element/stamina_bar,
/decl/hud_element/drop,
/decl/hud_element/resist,
Expand Down Expand Up @@ -197,10 +195,10 @@
elem_data.refresh_screen_object(src, elem)

/datum/hud/proc/refresh_client_hud()
if(mymob?.client)
mymob.client.screen.Cut()
populate_client_hud()
hide_inventory()
hidden_inventory_update()
persistant_inventory_update()

/datum/hud/proc/get_ui_style()
return ui_style2icon(mymob?.client?.prefs?.UI_style) || 'icons/mob/screen/white.dmi'
Expand Down Expand Up @@ -447,18 +445,9 @@
/mob/new_player/reset_click_catchers()
return

/obj/screen/stamina
name = "stamina"
icon = 'icons/effects/progressbar.dmi'
icon_state = "prog_bar_100"
invisibility = INVISIBILITY_MAXIMUM
screen_loc = ui_stamina

/datum/hud/proc/update_icons()
world << "fart 1"
if(!length(updating_hud_elements) || QDELETED(mymob))
return
world << "fart 2"
var/datum/gas_mixture/environment = mymob.loc?.return_air()
for(var/elem_type in updating_hud_elements)
var/decl/hud_element/hud_elem_data = GET_DECL(elem_type)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/ability_screen_objects.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/obj/screen/ability_master
name = "Abilities"
icon = 'icons/mob/screen_spells.dmi'
icon = 'icons/mob/screen/spells.dmi'
icon_state = "grey_spell_ready"
var/list/obj/screen/ability/ability_objects = list()
var/list/obj/screen/ability/spell_objects = list()
Expand Down Expand Up @@ -160,7 +160,7 @@
//This is what you click to do things//
///////////////////////////////////////
/obj/screen/ability
icon = 'icons/mob/screen_spells.dmi'
icon = 'icons/mob/screen/spells.dmi'
icon_state = "grey_spell_base"
maptext_x = 3
var/background_base_state = "grey"
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/ai.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/mob/living/silicon/ai
hud_type = /datum/hud/ai
hud_used = /datum/hud/ai

/datum/hud/ai/FinalizeInstantiation()
var/list/ai_hud_data = decls_repository.get_decls_of_subtype(/decl/ai_hud)
for(var/hud_type in ai_hud_data)
var/decl/ai_hud/ai_hud = ai_hud_data[hud_type]
for(var/elem_type in ai_hud_data)
var/decl/ai_hud/ai_hud = ai_hud_data[elem_type]
misc_hud_elements += new /obj/screen/ai_button(null,
ai_hud.screen_loc,
ai_hud.name,
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/ai_screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var/mob/living/silicon/ai/ai_verb
var/list/input_procs
var/list/input_args
icon = 'icons/mob/screen_ai.dmi'
icon = 'icons/mob/screen/ai.dmi'
var/list/template_icon = list(null, "template")
var/image/template_undelay

Expand Down
75 changes: 58 additions & 17 deletions code/_onclick/hud/constructs.dm
Original file line number Diff line number Diff line change
@@ -1,31 +1,72 @@
/mob/living/simple_animal/construct
hud_type = /datum/hud/construct
hud_used = /datum/hud/construct/wraith

/decl/hud_element/fire/construct
/mob/living/simple_animal/construct/armoured
hud_used = /datum/hud/construct/juggernaut

/mob/living/simple_animal/construct/behemoth
hud_used = /datum/hud/construct/juggernaut

/mob/living/simple_animal/construct/builder
hud_used = /datum/hud/construct/artificer

/mob/living/simple_animal/construct/harvester
hud_used = /datum/hud/construct/harvester

/decl/hud_element/condition/fire/construct
screen_loc = ui_construct_fire

/decl/hud_element/health/construct
screen_loc = ui_construct_health
abstract_type = /decl/hud_element/health/construct

/decl/hud_element/health/construct/artificer
screen_icon = 'icons/mob/screen/health_construct_artificer.dmi'

/decl/hud_element/health/construct/wraith
screen_icon = 'icons/mob/screen/health_construct_wraith.dmi'

/decl/hud_element/purged
screen_name = "purged"
screen_icon_state = "purge0"
screen_loc = ui_construct_purge
hud_element_category = /decl/hud_element/purged
update_in_life = TRUE
/decl/hud_element/health/construct/juggernaut
screen_icon = 'icons/mob/screen/health_construct_juggernaut.dmi'

/decl/hud_element/purged/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
elem.icon_state = "purge[hud?.alerts ? (hud.alerts[hud_element_category] || 0) : 0]"
/decl/hud_element/health/construct/harvester
screen_icon = 'icons/mob/screen/health_construct_harvester.dmi'

/datum/hud/construct
health_hud_type = /decl/hud_element/health/construct
/datum/hud/construct/get_ui_style()
return 'icons/mob/screen/construct.dmi'

/datum/hud/construct/artificer
health_hud_type = /decl/hud_element/health/construct/artificer
hud_elements = list(
/decl/hud_element/health/construct,
/decl/hud_element/health/construct/artificer,
/decl/hud_element/zone_selector,
/decl/hud_element/action_intent,
/decl/hud_element/fire/construct,
/decl/hud_element/purged
/decl/hud_element/condition/fire/construct
)

/datum/hud/construct/get_ui_style()
return 'icons/mob/screen1_construct.dmi'
/datum/hud/construct/wraith
health_hud_type = /decl/hud_element/health/construct/wraith
hud_elements = list(
/decl/hud_element/health/construct/wraith,
/decl/hud_element/zone_selector,
/decl/hud_element/action_intent,
/decl/hud_element/condition/fire/construct
)

/datum/hud/construct/juggernaut
health_hud_type = /decl/hud_element/health/construct/juggernaut
hud_elements = list(
/decl/hud_element/health/construct/juggernaut,
/decl/hud_element/zone_selector,
/decl/hud_element/action_intent,
/decl/hud_element/condition/fire/construct
)

/datum/hud/construct/harvester
health_hud_type = /decl/hud_element/health/construct/harvester
hud_elements = list(
/decl/hud_element/health/construct/harvester,
/decl/hud_element/zone_selector,
/decl/hud_element/action_intent,
/decl/hud_element/condition/fire/construct
)
4 changes: 2 additions & 2 deletions code/_onclick/hud/deity.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/mob/living/deity
hud_type = /datum/hud/deity
hud_used = /datum/hud/deity

/datum/hud/deity
hud_elements = list(
Expand All @@ -21,7 +21,7 @@

/obj/screen/intent/deity/Initialize()
. = ..()
overlays += image('icons/mob/screen_phenomena.dmi', icon_state = "hud", pixel_x = -138, pixel_y = -1)
overlays += image('icons/mob/screen/phenomena.dmi', icon_state = "hud", pixel_x = -138, pixel_y = -1)

/obj/screen/intent/deity/proc/sync_to_mob(var/mob)
var/mob/living/deity/D = mob
Expand Down
12 changes: 6 additions & 6 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
client.screen |= screen

/obj/screen/fullscreen
icon = 'icons/mob/screen_full.dmi'
icon = 'icons/mob/screen/full.dmi'
icon_state = "default"
screen_loc = ui_center_fullscreen
plane = FULLSCREEN_PLANE
Expand Down Expand Up @@ -100,7 +100,7 @@
layer = BLIND_LAYER

/obj/screen/fullscreen/blackout
icon = 'icons/mob/screen1.dmi'
icon = 'icons/mob/screen/fill.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
layer = BLIND_LAYER
Expand All @@ -110,21 +110,21 @@
layer = IMPAIRED_LAYER

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

/obj/screen/fullscreen/flash
icon = 'icons/mob/screen1.dmi'
icon = 'icons/mob/screen/fill.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'
icon = 'icons/mob/screen/fill.dmi'
screen_loc = ui_entire_screen
icon_state = "druggy"
alpha = 127
Expand All @@ -138,7 +138,7 @@
alpha = 127

/obj/screen/fullscreen/fadeout
icon = 'icons/mob/screen1.dmi'
icon = 'icons/mob/screen/fill.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
layer = FULLSCREEN_LAYER
Expand Down
10 changes: 10 additions & 0 deletions code/_onclick/hud/hud_elements/_hud_element.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/decl/hud_element
abstract_type = /decl/hud_element
var/screen_name
var/screen_icon
var/screen_icon_state
var/screen_loc
var/screen_object_type = /obj/screen
Expand Down Expand Up @@ -28,6 +29,8 @@
elem.alpha = hud.get_ui_alpha()
if(apply_hud_icon)
elem.icon = hud.get_ui_style()
else if(screen_icon)
elem.icon = screen_icon
if(screen_icon_state)
elem.icon_state = screen_icon_state
if(screen_loc)
Expand All @@ -37,3 +40,10 @@

/decl/hud_element/proc/register_screen_object(var/obj/screen/elem, var/datum/hud/hud)
hud.misc_hud_elements |= elem

/decl/hud_element/condition
screen_icon = 'icons/mob/screen/condition.dmi'
apply_hud_icon = FALSE
apply_hud_alpha = FALSE
apply_hud_color = FALSE
update_in_life = TRUE
1 change: 1 addition & 0 deletions code/_onclick/hud/hud_elements/action_intent.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/decl/hud_element/action_intent
screen_object_type = /obj/screen/intent
screen_icon = 'icons/mobs/screen/intent.dmi'
hud_element_category = /decl/hud_element/action_intent

/obj/screen/intent
Expand Down
7 changes: 3 additions & 4 deletions code/_onclick/hud/hud_elements/bodytemp.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/decl/hud_element/bodytemp
/decl/hud_element/condition/bodytemp
screen_name = "body temperature"
screen_object_type = /obj/screen/bodytemp
hud_element_category = /decl/hud_element/bodytemp
hud_element_category = /decl/hud_element/condition/bodytemp
screen_icon_state = "temp1"
screen_loc = ui_temp
update_in_life = TRUE

/decl/hud_element/bodytemp/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
/decl/hud_element/condition/bodytemp/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
//TODO: precalculate all of this stuff when the species datum is created
var/bodytemp = hud.mymob.bodytemperature
var/base_temperature = hud.mymob.get_ideal_bodytemp()
Expand Down
1 change: 1 addition & 0 deletions code/_onclick/hud/hud_elements/cells.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/decl/hud_element/cells
screen_name = "cell"
screen_icon_state = "charge-empty"
screen_icon = 'icons/mob/screen/robot_charge.dmi'
screen_loc = ui_nutrition
update_in_life = TRUE

Expand Down
7 changes: 3 additions & 4 deletions code/_onclick/hud/hud_elements/fire.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/decl/hud_element/fire
/decl/hud_element/condition/fire
screen_name = "fire"
screen_icon_state = "fire0"
screen_loc = ui_fire
hud_element_category = /decl/hud_element/fire
update_in_life = TRUE
hud_element_category = /decl/hud_element/condition/fire

/decl/hud_element/fire/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
/decl/hud_element/condition/fire/refresh_screen_object(var/datum/hud/hud, var/obj/screen/elem, var/datum/gas_mixture/environment)
screen_icon_state = "fire[hud?.alerts ? (hud.alerts[hud_element_category] || 0) : 0]"
2 changes: 0 additions & 2 deletions code/_onclick/hud/hud_elements/gun_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var/global/list/gun_hud_flag_decl_types = list(
/// Root type for flag toggling in gun mode.
/obj/screen/gun_flag
name = "gun"
icon = 'icons/mob/screen1.dmi'
master = null
dir = SOUTH

Expand Down Expand Up @@ -39,7 +38,6 @@ var/global/list/gun_hud_flag_decl_types = list(
/obj/screen/gun_mode
name = "Toggle Gun Mode"
icon_state = "gun0"
icon = 'icons/mob/screen1.dmi'
screen_loc = ui_gun_select
master = null
dir = SOUTH
Expand Down
Loading

0 comments on commit 786406b

Please sign in to comment.