Skip to content

Commit ffad98b

Browse files
committed
PW UI fixes.
* Fixed activity popup incorrectly saying "Defending" when attacking a planet in the defense phase. * Activity popup no longer prompts an attack when out of charges. * Fixed defence being unavailable in the main UI when out of charges. * Fixed activity popup not reacting to a change in charges.
1 parent a174013 commit ffad98b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

LuaMenu/widgets/gui_planetwars_list_window.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ local function GetActivityToPrompt(lobby, attackerFactions, defenderFactions, cu
155155
end
156156
local activePlanet = lobby.planetwarsData.attackingPlanet or lobby.planetwarsData.defendingPlanet
157157
local activePlanetAttacker = lobby.planetwarsData.attackingPlanetAttacker or lobby.planetwarsData.defendingPlanetAttacker
158-
if currentMode == lobby.PW_ATTACK and activePlanet then
158+
if currentMode == lobby.PW_DEFEND and activePlanet then
159159
local myPlanet = FindMatchingPlanet(activePlanet, activePlanetAttacker, planets)
160160
if myPlanet then
161161
return myPlanet, true, true, true
@@ -728,7 +728,7 @@ local function MakePlanetControl(planetData, DeselectOtherFunc, attackPhase, def
728728
else
729729
btnJoin:SetCaption(i18n("download_map"))
730730
end
731-
elseif HasAttackCharges() then
731+
elseif HasAttackCharges() or defendPhase then
732732
showButton = true
733733
if attackPhase then
734734
btnJoin:SetCaption(i18n("attack_planet"))
@@ -1674,6 +1674,7 @@ function DelayedInitialize()
16741674
end
16751675
lobby:AddListener("OnPwJoinPlanetSuccess", UnMatchedActivityUpdate)
16761676
lobby:AddListener("OnPwattackPhasePlanet", UnMatchedActivityUpdate)
1677+
lobby:AddListener("OnPwAttackCharges", UnMatchedActivityUpdate)
16771678
lobby:AddListener("OnLoginInfoEnd", UnMatchedActivityUpdate)
16781679

16791680
local function OnDisconnected()

0 commit comments

Comments
 (0)