forgot a bunch of shit, also had to re-do parts because we don't have update_overlays()
This commit is contained in:
CygnusB
2021-01-19 06:09:55 -03:00
parent f21db73775
commit 958b01f4d0
6 changed files with 69 additions and 16 deletions
+1 -1
View File
@@ -508,4 +508,4 @@ force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.adm
updateCursor(FALSE) //Make sure our moues cursor resets to default. False means we are not in launch mode
qdel(temp_pod) //Delete the temp_pod
qdel(selector) //Delete the selector effect
. = ..()
. = ..()
@@ -27,8 +27,8 @@
var/list/modes = list()
/obj/item/ammo_box/magazine/mws_mag/update_overlays()
.=..()
/obj/item/ammo_box/magazine/mws_mag/update_icon()
cut_overlays()
if(!stored_ammo.len)
return //Why bother
@@ -37,13 +37,14 @@
for(var/B in stored_ammo)
var/obj/item/ammo_casing/mws_batt/batt = B
var/mutable_appearance/cap = mutable_appearance(icon, "[initial(icon_state)]_cap", color = batt.type_color)
cap.color = batt.type_color
cap.pixel_x = current * x_offset //Caps don't need a pixel_y offset
. += cap
add_overlay(cap)
if(batt.cell.charge > 0)
var/ratio = CEILING(clamp(batt.cell.charge / batt.cell.maxcharge, 0, 1) * 4, 1) //4 is how many lights we have a sprite for
var/mutable_appearance/charge = mutable_appearance(icon, "[initial(icon_state)]_charge-[ratio]", color = "#29EAF4") //Could use battery color but eh.
charge.pixel_x = current * x_offset
. += charge
add_overlay(charge)
current++ //Increment for offsets
@@ -74,11 +75,11 @@
cell.give(cell.maxcharge)
update_icon()
/obj/item/ammo_casing/mws_batt/update_overlays()
.=..()
/obj/item/ammo_casing/mws_batt/update_icon()
cut_overlays()
var/mutable_appearance/ends = mutable_appearance(icon, "[initial(icon_state)]_ends", color = type_color)
. += ends
ends.color = type_color
add_overlay(ends)
/obj/item/ammo_casing/mws_batt/get_cell()
return cell
+1 -1
View File
@@ -95,7 +95,7 @@
zoom(user, FALSE) //we can only stay zoomed in if it's in our hands //yeah and we only unzoom if we're actually zoomed using the gun!!
//called after the gun has successfully fired its chambered ammo.
/obj/item/gun/proc/process_chamber(mob/living/user))
/obj/item/gun/proc/process_chamber(mob/living/user)
return FALSE
//check if there's enough ammo/energy/whatever to shoot one time
@@ -445,8 +445,8 @@
chambered = null
update_icon()
/obj/item/gun/ballistic/revolver/mws/update_overlays()
.=..()
/obj/item/gun/ballistic/revolver/mws/update_icon()
cut_overlays()
if(!chambered)
return
@@ -456,16 +456,17 @@
//Mode bar
var/image/mode_bar = image(icon, icon_state = "[initial(icon_state)]_type")
mode_bar.color = batt_color
. += mode_bar
add_overlay(mode_bar)
//Barrel color
var/mutable_appearance/barrel_color = mutable_appearance(icon, "[initial(icon_state)]_barrel", color = batt_color)
barrel_color.alpha = 150
. += barrel_color
add_overlay(barrel_color)
//Charge bar
var/ratio = can_shoot() ? CEILING(clamp(batt.cell.charge / batt.cell.maxcharge, 0, 1) * charge_sections, 1) : 0
for(var/i = 0, i < ratio, i++)
var/mutable_appearance/charge_bar = mutable_appearance(icon, "[initial(icon_state)]_charge", color = batt_color)
charge_bar.pixel_x = i
. += charge_bar
charge_bar.color = batt_color
add_overlay(charge_bar)