diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 44037305dd..14feaf1b5f 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -103,6 +103,12 @@ #define ui_alien_fire "EAST-1:28,NORTH-3:25" #define ui_alien_oxygen "EAST-1:28,NORTH-4:25" +// Goes above HUD, mid-right +#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25" +#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27" +#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29" +#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31" + //Middle right (status indicators) #define ui_temp "EAST-1:28,CENTER-2:13" #define ui_health "EAST-1:28,CENTER-1:15" diff --git a/code/_onclick/hud/_defines_ch.dm b/code/_onclick/hud/_defines_ch.dm deleted file mode 100644 index 3fb902eba8..0000000000 --- a/code/_onclick/hud/_defines_ch.dm +++ /dev/null @@ -1,8 +0,0 @@ -/** CHOMP-Specific Defines - * Put defines specific to OUR HUDs here. - * First thing to go here is the TGMC Ammo HUD. - */ -#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25" -#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27" -#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29" -#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31" \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 8d9990024b..aef10cd979 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -470,9 +470,7 @@ var/list/global_huds = list( /* TGMC Ammo HUD Port * These procs call to screen_objects.dm's respective procs. * All these do is manage the amount of huds on screen and set the HUD. - * CHOMPEdit: Commented out, just uncomment once Polaris merges + it comes down from VORE. */ -/* ///Add an ammo hud to the user informing of the ammo count of G /datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE) @@ -500,5 +498,4 @@ var/list/global_huds = list( ///Update the ammo hud related to the gun G /datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G) var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] - ammo_hud?.update_hud(user, G) -*/ \ No newline at end of file + ammo_hud?.update_hud(user, G) \ No newline at end of file diff --git a/code/_onclick/hud/hud_ch.dm b/code/_onclick/hud/hud_ch.dm deleted file mode 100644 index 84772f4a9f..0000000000 --- a/code/_onclick/hud/hud_ch.dm +++ /dev/null @@ -1,32 +0,0 @@ -/** - * CHOMP-Specific HUD override. This will be backported to Polaris if they want it. - * Comment this out once Polaris has it! - */ -///Add an ammo hud to the user informing of the ammo count of G -/datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G) - if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE) - return - var/obj/screen/ammo/ammo_hud = new - ammo_hud_list[G] = ammo_hud - ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[length(ammo_hud_list)] - ammo_hud.add_hud(user, G) - ammo_hud.update_hud(user, G) - -///Remove the ammo hud related to the gun G from the user -/datum/hud/proc/remove_ammo_hud(mob/living/user, obj/item/weapon/gun/G) - var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] - if(isnull(ammo_hud)) - return - ammo_hud.remove_hud(user, G) - qdel(ammo_hud) - ammo_hud_list -= G - var/i = 1 - for(var/key in ammo_hud_list) - ammo_hud = ammo_hud_list[key] - ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[i] - i++ - -///Update the ammo hud related to the gun G -/datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G) - var/obj/screen/ammo/ammo_hud = ammo_hud_list[G] - ammo_hud?.update_hud(user, G) \ No newline at end of file diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 4b56821d01..4bf31a2747 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -452,7 +452,6 @@ //YAWNEDIT: Knockdown code end - // CHOMPEdit: TGMC Ammo HUD insertion: user.hud_used.update_ammo_hud(user, src) // Similar to the above proc, but does not require a user, which is ideal for things like turrets. @@ -778,9 +777,35 @@ var/datum/firemode/new_mode = firemodes[sel_mode] new_mode.apply_to(src) to_chat(user, "\The [src] is now set to [new_mode.name].") - user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD + user.hud_used.update_ammo_hud(user, src) return new_mode /obj/item/weapon/gun/attack_self(mob/user) switch_firemodes(user) + +/* TGMC Ammo HUD Port Begin */ +/obj/item/weapon/gun + var/hud_enabled = TRUE + +/obj/item/weapon/gun/proc/has_ammo_counter() + return FALSE + +/obj/item/weapon/gun/proc/get_ammo_type() + return FALSE + +/obj/item/weapon/gun/proc/get_ammo_count() + return FALSE + +/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible. + if(slot == slot_l_hand || slot == slot_r_hand) + user.hud_used.add_ammo_hud(user, src) + else + user.hud_used.remove_ammo_hud(user, src) + + return ..() + +/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. + user.hud_used.remove_ammo_hud(user, src) + + ..() \ No newline at end of file diff --git a/code/modules/projectiles/gun_ch.dm b/code/modules/projectiles/gun_ch.dm index 61e657ae58..a27d87a878 100644 --- a/code/modules/projectiles/gun_ch.dm +++ b/code/modules/projectiles/gun_ch.dm @@ -1,28 +1,3 @@ /obj/item/weapon/gun var/holy = 0 //For Divinely blessed guns - -/* TGMC Ammo HUD Port Begin */ -/obj/item/weapon/gun - var/hud_enabled = TRUE - -/obj/item/weapon/gun/proc/has_ammo_counter() - return FALSE - -/obj/item/weapon/gun/proc/get_ammo_type() - return FALSE - -/obj/item/weapon/gun/proc/get_ammo_count() - return FALSE - -/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible. - if(slot == slot_l_hand || slot == slot_r_hand) - user.hud_used.add_ammo_hud(user, src) - else - user.hud_used.remove_ammo_hud(user, src) - - return ..() - -/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti. - user.hud_used.remove_ammo_hud(user, src) - - ..() \ No newline at end of file + \ No newline at end of file diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 6ed5194bc0..bbfe861305 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -55,8 +55,8 @@ if(handle_casings != HOLD_CASINGS) ammo_magazine.stored_ammo -= chambered - var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD - if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + var/mob/living/M = loc + if(istype(M)) M?.hud_used.update_ammo_hud(M, src) if (chambered) @@ -103,8 +103,8 @@ if(handle_casings != HOLD_CASINGS) chambered = null - var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD - if(istype(M)) // CHOMPEdit: TGMC Ammo HUD + var/mob/living/M = loc + if(istype(M)) M?.hud_used.update_ammo_hud(M, src) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 5e59456251..a24acd21cd 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -139,6 +139,10 @@ var/impact_effect_type = null var/list/impacted_mobs = list() + + // TGMC Ammo HUD Port + var/hud_state = "unknown" // What HUD state we use when we have ammunition. + var/hud_state_empty = "unknown" // The empty state. DON'T USE _FLASH IN THE NAME OF THE EMPTY STATE STRING, THAT IS ADDED BY THE CODE. /obj/item/projectile/proc/Range() range-- diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index fb83c4bdcd..6931b0e4e7 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -72,33 +72,33 @@ /obj/item/projectile/bullet/pistol // 9mm pistols and most SMGs. Sacrifice power for capacity. fire_sound = 'sound/weapons/gunshot2.ogg' damage = 20 - hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting. - hud_state_empty = "pistol_empty" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol" + hud_state_empty = "pistol_empty" /obj/item/projectile/bullet/pistol/ap damage = 15 armor_penetration = 30 - hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_light_ap" /obj/item/projectile/bullet/pistol/hp damage = 25 armor_penetration = -50 - hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_ap" /obj/item/projectile/bullet/pistol/medium // .45 (and maybe .40 if it ever gets added) caliber security pistols. Balance between capacity and power. fire_sound = 'sound/weapons/gunshot3.ogg' // Snappier sound. damage = 25 - hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol" /obj/item/projectile/bullet/pistol/medium/ap damage = 20 armor_penetration = 15 - hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_light_ap" /obj/item/projectile/bullet/pistol/medium/hp damage = 30 armor_penetration = -50 - hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting. + hud_state = "pistol_ap" /obj/item/projectile/bullet/pistol/strong // .357 and .44 caliber stuff. High power pistols like the Mateba or Desert Eagle. Sacrifice capacity for power. fire_sound = 'sound/weapons/gunshot4.ogg' diff --git a/code/modules/projectiles/projectile_ch.dm b/code/modules/projectiles/projectile_ch.dm index 649673c772..a2af0b08be 100644 --- a/code/modules/projectiles/projectile_ch.dm +++ b/code/modules/projectiles/projectile_ch.dm @@ -1,8 +1,6 @@ /obj/item/projectile /// If this projectile is holy. Silver bullets, etc. Currently no effects. var/holy = 0 - var/hud_state = "unknown" // TGMC Ammo HUD Port - var/hud_state_empty = "unknown" // TGMC Ammo HUD Port /obj/item/projectile/bullet/pellet/shotgun/silver name = "shrapnel" diff --git a/vorestation.dme b/vorestation.dme index 55b0592e30..15474e7b5d 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -169,7 +169,6 @@ #include "code\_onclick\rig.dm" #include "code\_onclick\telekinesis.dm" #include "code\_onclick\hud\_defines.dm" -#include "code\_onclick\hud\_defines_ch.dm" #include "code\_onclick\hud\_defines_vr.dm" #include "code\_onclick\hud\ability_screen_objects.dm" #include "code\_onclick\hud\action.dm" @@ -181,7 +180,6 @@ #include "code\_onclick\hud\ghost.dm" #include "code\_onclick\hud\gun_mode.dm" #include "code\_onclick\hud\hud.dm" -#include "code\_onclick\hud\hud_ch.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\map_popups.dm" #include "code\_onclick\hud\minihud.dm"