diff --git a/README.md b/README.md index a3df9b81..30fb85e8 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 +* 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 * Increased distance between revive waypoint arrow and icon diff --git a/ui_mp/t6/hud/scoreboard.lua b/ui_mp/t6/hud/scoreboard.lua index 773f64b9..f1255812 100644 --- a/ui_mp/t6/hud/scoreboard.lua +++ b/ui_mp/t6/hud/scoreboard.lua @@ -1,3 +1,15 @@ +if UIExpression.DvarString(nil, "ui_gametype_obj") == "" then + Engine.SetDvar("ui_gametype_obj", "") +end + +if UIExpression.DvarString(nil, "ui_gametype_pro") == "" then + Engine.SetDvar("ui_gametype_pro", 0) +end + +if UIExpression.DvarString(nil, "ui_round_number") == "" then + Engine.SetDvar("ui_round_number", 0) +end + local SCOREBOARD_BACKGROUND_OPACITY = 0.7 local SCOREBOARD_COLUMN_BACKGROUND_OPACITY = 0.2 local f0_local6 = 337 @@ -31,18 +43,6 @@ local f0_local41 = f0_local40 local SCOREBOARD_MAX_ROWS = CoD.MPZM(23, 18) local IsDLCMap2, IsDLCMap4, IsClassic = nil, nil, nil -if UIExpression.DvarString(nil, "ui_gametype_obj") == "" then - Engine.SetDvar("ui_gametype_obj", "") -end - -if UIExpression.DvarString(nil, "ui_gametype_pro") == "" then - Engine.SetDvar("ui_gametype_pro", 0) -end - -if UIExpression.DvarString(nil, "ui_round_number") == "" then - Engine.SetDvar("ui_round_number", 0) -end - CoD.ScoreboardRow = InheritFrom(LUI.UIElement) local ScoreboardWidgetSetOwnerFunc = function (ScoreboardWidget, LocalClientIndex) diff --git a/ui_mp/t6/zombie/ammoareazombie.lua b/ui_mp/t6/zombie/ammoareazombie.lua index 24fbc03d..bf473058 100644 --- a/ui_mp/t6/zombie/ammoareazombie.lua +++ b/ui_mp/t6/zombie/ammoareazombie.lua @@ -252,11 +252,8 @@ CoD.AmmoAreaZombie.UpdateActionSlots = function (f2_arg0, f2_arg1) f2_local10:setText(f2_local12.ammo) Widget:addElement(f2_local10) end - if CoD.isPC then - local f2_local10 = 0 - if CoD.Zombie.IsDLCMap(CoD.Zombie.DLC4Maps) then - f2_local10 = 200 - end + if CoD.isPC and UIExpression.DvarBool(nil, "hud_dpad_controller") == 0 then + local f2_local10 = 200 local f2_local11 = nil if f2_local4 == 1 then f2_local11 = { @@ -318,7 +315,7 @@ CoD.AmmoAreaZombie.UpdateActionSlots = function (f2_arg0, f2_arg1) Widget.keyPrompt:setAlignment(LUI.Alignment.Right) Widget:registerAnimationState("KeyPrompt", f2_local11) Widget:addElement(Widget.keyPrompt) - if CoD.useController and Engine.LastInput_Gamepad() then + if CoD.useController and Engine.LastInput_Gamepad() or UIExpression.DvarBool(nil, "hud_dpad_controller") == 1 then CoD.AmmoAreaZombie.ActionSlotInputSourceChanged(Widget, { source = 0 }) @@ -620,7 +617,7 @@ end CoD.AmmoAreaZombie.ActionSlotInputSourceChanged = function (f15_arg0, f15_arg1) if CoD.isPC then - if CoD.useController and f15_arg1.source == 0 then + if CoD.useController and f15_arg1.source == 0 or UIExpression.DvarBool(nil, "hud_dpad_controller") == 1 then f15_arg0:animateToState("default") if f15_arg0.keyPrompt ~= nil then f15_arg0.keyPrompt:setAlpha(0) @@ -637,20 +634,11 @@ end CoD.AmmoAreaZombie.InputSourceChanged = function (f16_arg0, f16_arg1) if CoD.isPC then - if CoD.useController and f16_arg1.source == 0 then - if f16_arg0.carouselArrows ~= nil then - f16_arg0.carouselArrows:setAlpha(1) - end - if f16_arg0.circleBackground ~= nil then - f16_arg0.circleBackground:setAlpha(1) - end - else - if f16_arg0.carouselArrows ~= nil then - f16_arg0.carouselArrows:setAlpha(0) - end - if f16_arg0.circleBackground ~= nil then - f16_arg0.circleBackground:setAlpha(0) - end + if f16_arg0.carouselArrows ~= nil then + f16_arg0.carouselArrows:setAlpha(1) + end + if f16_arg0.circleBackground ~= nil then + f16_arg0.circleBackground:setAlpha(0) end if f16_arg0.actionSlots ~= nil then for f16_local3, f16_local4 in pairs(f16_arg0.actionSlots) do diff --git a/ui_mp/t6/zombie/huddpadareazombie.lua b/ui_mp/t6/zombie/huddpadareazombie.lua index 0f75095d..6ff2a48b 100644 --- a/ui_mp/t6/zombie/huddpadareazombie.lua +++ b/ui_mp/t6/zombie/huddpadareazombie.lua @@ -250,7 +250,7 @@ LUI.createMenu.DPadArea = function (f1_arg0) Widget:registerEventHandler("hud_update_team_change", CoD.DPadArea.UpdateTeamChange) if CoD.isPC then Widget:registerEventHandler("input_source_changed", CoD.DPadArea.InputSourceChanged) - if CoD.useController and Engine.LastInput_Gamepad() then + if CoD.useController and Engine.LastInput_Gamepad() or UIExpression.DvarBool(nil, "hud_dpad_controller") == 1 then CoD.DPadArea.InputSourceChanged(Widget, { source = 0 }) @@ -369,7 +369,8 @@ CoD.DPadArea.UpdateActionSlots = function (f2_arg0, f2_arg1) f2_local8:setText(f2_local9.ammo) Widget:addElement(f2_local8) end - if CoD.isPC then + if CoD.isPC and UIExpression.DvarBool(nil, "hud_dpad_controller") == 0 then + local f2_local10 = 200 local f2_local8 = nil if f2_local4 == 1 then f2_local8 = { @@ -379,8 +380,8 @@ CoD.DPadArea.UpdateActionSlots = function (f2_arg0, f2_arg1) right = 0, topAnchor = false, bottomAnchor = false, - top = -f2_local11 / 2 - f2_local4 * f2_local11, - bottom = f2_local11 / 2 - f2_local4 * f2_local11, + top = -f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, + bottom = f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, alignment = LUI.Alignment.Right } elseif f2_local4 == 3 then @@ -391,8 +392,8 @@ CoD.DPadArea.UpdateActionSlots = function (f2_arg0, f2_arg1) right = 0, topAnchor = false, bottomAnchor = false, - top = -f2_local11 / 2 - f2_local4 * f2_local11, - bottom = f2_local11 / 2 - f2_local4 * f2_local11, + top = -f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, + bottom = f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, alignment = LUI.Alignment.Right } elseif f2_local4 == 2 then @@ -403,8 +404,8 @@ CoD.DPadArea.UpdateActionSlots = function (f2_arg0, f2_arg1) right = 0, topAnchor = false, bottomAnchor = true, - top = -f2_local11 / 2 - f2_local4 * f2_local11, - bottom = f2_local11 / 2 - f2_local4 * f2_local11, + top = -f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, + bottom = f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, alignment = LUI.Alignment.Right } elseif f2_local4 == 4 then @@ -415,8 +416,8 @@ CoD.DPadArea.UpdateActionSlots = function (f2_arg0, f2_arg1) right = 0, topAnchor = false, bottomAnchor = true, - top = -f2_local11 / 2 - f2_local4 * f2_local11, - bottom = f2_local11 / 2 - f2_local4 * f2_local11, + top = -f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, + bottom = f2_local11 / 2 - f2_local4 * f2_local11 - f2_local10, alignment = LUI.Alignment.Right } end @@ -431,7 +432,7 @@ CoD.DPadArea.UpdateActionSlots = function (f2_arg0, f2_arg1) Widget.keyPrompt:setAlignment(LUI.Alignment.Right) Widget:registerAnimationState("KeyPrompt", f2_local8) Widget:addElement(Widget.keyPrompt) - if CoD.useController and Engine.LastInput_Gamepad() then + if CoD.useController and Engine.LastInput_Gamepad() or UIExpression.DvarBool(nil, "hud_dpad_controller") == 1 then CoD.DPadArea.ActionSlotInputSourceChanged(Widget, { source = 0 }) @@ -526,7 +527,7 @@ end CoD.DPadArea.ActionSlotInputSourceChanged = function (f8_arg0, f8_arg1) if CoD.isPC then - if CoD.useController and f8_arg1.source == 0 then + if CoD.useController and f8_arg1.source == 0 or UIExpression.DvarBool(nil, "hud_dpad_controller") == 1 then f8_arg0:animateToState("default") if f8_arg0.keyPrompt ~= nil then f8_arg0.keyPrompt:setAlpha(0) @@ -543,20 +544,11 @@ end CoD.DPadArea.InputSourceChanged = function (f9_arg0, f9_arg1) if CoD.isPC then - if CoD.useController and f9_arg1.source == 0 then - if f9_arg0.carouselArrows ~= nil then - f9_arg0.carouselArrows:setAlpha(1) - end - if f9_arg0.circleBackground ~= nil then - f9_arg0.circleBackground:setAlpha(1) - end - else - if f9_arg0.carouselArrows ~= nil then - f9_arg0.carouselArrows:setAlpha(0) - end - if f9_arg0.circleBackground ~= nil then - f9_arg0.circleBackground:setAlpha(0) - end + if f9_arg0.carouselArrows ~= nil then + f9_arg0.carouselArrows:setAlpha(1) + end + if f9_arg0.circleBackground ~= nil then + f9_arg0.circleBackground:setAlpha(0) end if f9_arg0.actionSlots ~= nil then for f9_local3, f9_local4 in pairs(f9_arg0.actionSlots) do