diff --git a/README.md b/README.md index 95261401..abccce1e 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ * Zone name displayed on bottom left of screen - `hud_zone_name` * Added proper game mode and map name to scoreboard * Added icons on scoreboard when player is downed, bled out, in Who's Who mode, or in afterlife +* Weapon name no longer fades out * Moved keyboard and mouse dpad icons to their positions from Origins on all maps * Increased waypoint offset from top of screen * Changed player waypoint location to be center of player instead of top of player @@ -904,7 +905,7 @@ * Records automatically picked up * Gramophone initially spawns at Excavation Site gramophone table * Musical parts no longer show on HUD -* Added attachment display name on HUD for upgraded attachment weapons +* Added attachment name on HUD for upgraded attachment weapons * Generators: increased capture reward points from 100 to 200 * Generators: always give back refund points if player was in the generator zone when captured * Generators: recapture round zombies only drop Max Ammo if killed before taking first generator diff --git a/ui_mp/t6/hud/weaponlabel.lua b/ui_mp/t6/hud/weaponlabel.lua new file mode 100644 index 00000000..59e2c9c4 --- /dev/null +++ b/ui_mp/t6/hud/weaponlabel.lua @@ -0,0 +1,35 @@ +CoD.WeaponLabel = {} +CoD.WeaponLabel.TextHeight = 32 +CoD.WeaponLabel.FadeTime = 2000 +CoD.WeaponLabel.new = function (f1_arg0) + local Widget = LUI.UIElement.new(f1_arg0) + local f1_local1 = CoD.WeaponLabel.TextHeight + Widget.weaponLabel = LUI.UIText.new({ + left = -1, + top = -f1_local1 / 2, + right = 0, + bottom = f1_local1 / 2, + leftAnchor = false, + topAnchor = false, + rightAnchor = true, + bottomAnchor = false, + alphaMultiplier = 1 + }) + Widget.weaponLabel:setFont(CoD.fonts.Big) + Widget.weaponLabel:registerAnimationState("fade_out", { + alphaMultiplier = 0 + }) + Widget:addElement(Widget.weaponLabel) + Widget:registerEventHandler("hud_update_weapon_select", CoD.WeaponLabel.UpdateWeapon) + return Widget +end + +CoD.WeaponLabel.UpdateWeapon = function (f2_arg0, f2_arg1) + f2_arg0.weaponLabel:animateToState("default") + if CoD.isZombie == true then + f2_arg0.weaponLabel:setText(Engine.Localize(f2_arg1.weaponDisplayName)) + else + f2_arg0.weaponLabel:setText(UIExpression.ToUpper(nil, Engine.Localize(f2_arg1.weaponDisplayName))) + end + -- f2_arg0.weaponLabel:animateToState("fade_out", CoD.WeaponLabel.FadeTime) +end \ No newline at end of file diff --git a/ui_mp/t6/zombie/ammoareazombie.lua b/ui_mp/t6/zombie/ammoareazombie.lua index d9770669..5b159b15 100644 --- a/ui_mp/t6/zombie/ammoareazombie.lua +++ b/ui_mp/t6/zombie/ammoareazombie.lua @@ -596,8 +596,8 @@ CoD.AmmoAreaZombie.UpdateWeaponSelect = function (f13_arg0, f13_arg1) if CoD.isZombie == true then f13_arg0.weaponText:setText(f13_local0) end - f13_arg0.weaponLabelContainer:beginAnimation("fade_out", CoD.WeaponLabel.FadeTime) - f13_arg0.weaponLabelContainer:setAlpha(0) + -- f13_arg0.weaponLabelContainer:beginAnimation("fade_out", CoD.WeaponLabel.FadeTime) + -- f13_arg0.weaponLabelContainer:setAlpha(0) f13_arg0:dispatchEventToChildren(f13_arg1) end