1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-07 13:49:33 -05:00

HUD: change font to Big

Remove unused ammocounter.lua
This commit is contained in:
Jbleezy 2024-06-05 00:43:38 -07:00
parent 5dd6d318f2
commit 5113c49f79
4 changed files with 6 additions and 121 deletions

View File

@ -1,117 +0,0 @@
CoD.AmmoCounter = {}
CoD.AmmoCounter.TextHeight = 28
CoD.AmmoCounter.LowAmmoFadeTime = 500
CoD.AmmoCounter.PulseDuration = 500
CoD.AmmoCounter.new = function(f1_arg0)
local Widget = LUI.UIElement.new(f1_arg0)
Widget:registerAnimationState("hide", {
alphaMultiplier = 0,
})
Widget:registerAnimationState("show", {
alphaMultiplier = 1,
})
Widget:animateToState("hide")
local f1_local1 = 36
local Widget_1 = LUI.UIElement.new({
left = -90,
top = f1_local1,
right = 10,
bottom = f1_local1 + 40,
leftAnchor = true,
topAnchor = true,
rightAnchor = false,
bottomAnchor = false,
})
Widget:addElement(Widget_1)
local f1_local3 = CoD.AmmoCounter.TextHeight
Widget.ammoLabel = LUI.UIText.new({
left = -1,
top = -4,
right = 0,
bottom = 4,
leftAnchor = false,
topAnchor = true,
rightAnchor = true,
bottomAnchor = true,
alpha = 1,
})
Widget.ammoLabel:setFont(CoD.fonts.Big)
Widget.ammoLabel:registerAnimationState("pulse_low", {
alpha = 1,
})
Widget.ammoLabel:registerAnimationState("pulse_high", {
alpha = 0.5,
})
Widget.ammoLabel:registerEventHandler("transition_complete_pulse_high", CoD.AmmoCounter.Ammo_PulseHigh)
Widget.ammoLabel:registerEventHandler("transition_complete_pulse_low", CoD.AmmoCounter.Ammo_PulseLow)
Widget_1:addElement(Widget.ammoLabel)
Widget:registerEventHandler("hud_update_refresh", CoD.AmmoCounter.UpdateVisibility)
Widget:registerEventHandler("hud_update_weapon", CoD.AmmoCounter.UpdateVisibility)
Widget:registerEventHandler("hud_update_ammo", CoD.AmmoCounter.UpdateAmmo)
return Widget
end
CoD.AmmoCounter.UpdateAmmo = function(f2_arg0, f2_arg1)
if f2_arg1.ammoInClip == 0 and f2_arg1.ammoStock == 0 and f2_arg1.lowClip ~= true then
return
end
local f2_local0 = f2_arg1.ammoInClip .. "/" .. f2_arg1.ammoStock
if f2_arg1.ammoInDWClip then
f2_local0 = f2_arg1.ammoInDWClip .. " | " .. f2_local0
end
f2_arg0.ammoLabel:setText(f2_local0)
if f2_arg1.lowClip and f2_arg0.lowAmmo ~= true then
f2_arg0.lowAmmo = true
if true == CoD.isZombie then
f2_arg0.ammoLabel:animateToState("pulse_high", CoD.AmmoCounter.LowAmmoFadeTime)
end
elseif f2_arg1.lowClip ~= true and f2_arg0.lowAmmo == true then
f2_arg0.lowAmmo = nil
if true == CoD.isZombie then
f2_arg0.ammoLabel:animateToState("default", CoD.AmmoCounter.LowAmmoFadeTime)
end
end
end
CoD.AmmoCounter.ShouldHideAmmoCounter = function(f3_arg0, f3_arg1)
if f3_arg0.weapon ~= nil then
if Engine.IsWeaponType(f3_arg0.weapon, "melee") then
return true
elseif CoD.isZombie == true and (f3_arg1.inventorytype == 1 or f3_arg1.inventorytype == 2) then
return true
elseif CoD.isZombie == true and (Engine.IsWeaponType(f3_arg0.weapon, "gas") or Engine.IsOverheatWeapon(f3_arg0.weapon)) then
return true
end
end
return false
end
CoD.AmmoCounter.UpdateVisibility = function(f4_arg0, f4_arg1)
local f4_local0 = f4_arg1.controller
if f4_arg1.weapon ~= nil then
f4_arg0.weapon = f4_arg1.weapon
end
if CoD.AmmoCounter.ShouldHideAmmoCounter(f4_arg0, f4_arg1) then
if f4_arg0.visible == true then
f4_arg0:animateToState("hide")
f4_arg0.visible = nil
end
f4_arg0:dispatchEventToChildren(f4_arg1)
elseif f4_arg0.visible ~= true then
f4_arg0:animateToState("show")
f4_arg0.visible = true
end
end
CoD.AmmoCounter.Ammo_PulseHigh = function(f5_arg0, f5_arg1)
if f5_arg1.interrupted ~= true then
f5_arg0:animateToState("pulse_low", CoD.AmmoCounter.LowAmmoFadeTime, true, false)
end
end
CoD.AmmoCounter.Ammo_PulseLow = function(f6_arg0, f6_arg1)
if f6_arg1.interrupted ~= true then
f6_arg0:animateToState("pulse_high", CoD.AmmoCounter.LowAmmoFadeTime, false, true)
end
end

View File

@ -141,7 +141,7 @@ LUI.createMenu.AmmoAreaZombie = function(f1_arg0)
local f1_local29 = LUI.UIText.new()
f1_local29:setLeftRight(true, true, 0, 0)
f1_local29:setTopBottom(false, false, -f1_local27 / 2 - f1_local28, f1_local27 / 2 - f1_local28)
f1_local29:setFont(f1_local26)
f1_local29:setFont(CoD.fonts.Big)
f1_local29:setAlignment(LUI.Alignment.Right)
f1_local0.weaponLabelContainer:addElement(f1_local29)
f1_local0.weaponText = f1_local29

View File

@ -201,7 +201,7 @@ LUI.createMenu.CompetitiveScoreboard = function(LocalClientIndex)
PlayerScoreListWidget.characterName = LUI.UIText.new()
PlayerScoreListWidget.characterName:setLeftRight(false, true, -CoD.CompetitiveScoreboard.RowWidth * 2, -CoD.CompetitiveScoreboard.RowWidth - 10)
PlayerScoreListWidget.characterName:setTopBottom(false, false, -CharacterNameTextSize / 2, CharacterNameTextSize / 2)
PlayerScoreListWidget.characterName:setFont(CoD.fonts[CharacterNameFont])
PlayerScoreListWidget.characterName:setFont(CoD.fonts.Big)
PlayerScoreListWidget.characterName:setAlignment(LUI.Alignment.Right)
PlayerScoreListWidget.characterName:registerEventHandler("character_name_fade_out", CoD.CompetitiveScoreboard.FadeoutCharacterName)
PlayerScoreListWidget:addElement(PlayerScoreListWidget.characterName)
@ -209,12 +209,14 @@ LUI.createMenu.CompetitiveScoreboard = function(LocalClientIndex)
PlayerScoreListWidget.scoreText = LUI.UIText.new()
PlayerScoreListWidget.scoreText:setLeftRight(true, false, 10, CoD.CompetitiveScoreboard.RowWidth)
PlayerScoreListWidget.scoreText:setTopBottom(true, true, 0, 0)
PlayerScoreListWidget.scoreText:setFont(CoD.fonts.Big)
PlayerScoreListWidget:addElement(PlayerScoreListWidget.scoreText)
PlayerScoreListWidget.floatingScoreTexts = {}
for ClientIndex = 1, CoD.CompetitiveScoreboard.ClientFieldMaxValue, 1 do
local FloatingScoreText = LUI.UIText.new()
FloatingScoreText:setLeftRight(true, false, -30, -30 + CoD.CompetitiveScoreboard.RowWidth)
FloatingScoreText:setTopBottom(true, false, 0, CoD.CompetitiveScoreboard.RowHeight)
FloatingScoreText:setFont(CoD.fonts.Big)
FloatingScoreText:setAlpha(0)
FloatingScoreText.isUsed = false
FloatingScoreText:registerEventHandler("transition_complete_flying_out", CoD.CompetitiveScoreboard.FloatingTextFlyingFinish)

View File

@ -48,7 +48,7 @@ LUI.createMenu.ReimaginedArea = function(LocalClientIndex)
local healthText = LUI.UIText.new()
healthText:setLeftRight(true, false, width + bgDiff * 2, 0)
healthText:setTopBottom(true, false, 0 - bgDiff, height + bgDiff)
healthText:setFont(CoD.fonts.Condensed)
healthText:setFont(CoD.fonts.Big)
healthText:setAlignment(LUI.Alignment.Left)
healthBarWidget:addElement(healthText)
healthBarWidget.healthText = healthText
@ -87,7 +87,7 @@ LUI.createMenu.ReimaginedArea = function(LocalClientIndex)
local zoneNameText = LUI.UIText.new()
zoneNameText:setLeftRight(true, false, 0, 1000)
zoneNameText:setTopBottom(true, false, -CoD.textSize.Default, 0)
zoneNameText:setFont(CoD.fonts.Default)
zoneNameText:setFont(CoD.fonts.Big)
zoneNameText:setAlignment(LUI.Alignment.Left)
zoneNameText:registerAnimationState("fade_out", {
alpha = 0,