Skip to content

Commit a847146

Browse files
committed
Popup logic fix.
Sort own planets to the top of the unattackable queue.
1 parent f2de7b0 commit a847146

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

LuaMenu/widgets/gui_planetwars_list_window.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ local function GetActivityToPrompt(lobby, attackerFactions, defenderFactions, cu
168168
if currentMode == lobby.PW_DEFEND and activePlanet then
169169
local myPlanet = FindMatchingPlanet(activePlanet, activePlanetAttacker, planets)
170170
if myPlanet then
171-
return myPlanet, attackPhase, true, true
171+
return myPlanet, attackPhase, true, not attackPhase
172172
end
173173
end
174174

@@ -582,6 +582,7 @@ local function MakePlanetControl(planetData, DeselectOtherFunc, attackPhase, def
582582
local planetID = planetData.PlanetID
583583
local planetAttacker = planetData.AttackerFaction
584584
local canSelectPlanet = planetData.CanSelectForBattle
585+
local owner = (planetData.OwnerFaction == lobby:GetMyFaction())
585586
local myAttacking = planetData.PlayerIsAttacker
586587
local myDefending = planetData.PlayerIsDefender
587588

@@ -818,6 +819,7 @@ local function MakePlanetControl(planetData, DeselectOtherFunc, attackPhase, def
818819

819820
planetAttacker = newPlanetData.AttackerFaction
820821
canSelectPlanet = newPlanetData.CanSelectForBattle
822+
owner = (newPlanetData.OwnerFaction == lobby:GetMyFaction())
821823
attackPhase, defendPhase = newAttackPhase, newDefendPhase
822824
myAttacking = newPlanetData.PlayerIsAttacker
823825
myDefending = newPlanetData.PlayerIsDefender
@@ -866,7 +868,11 @@ local function MakePlanetControl(planetData, DeselectOtherFunc, attackPhase, def
866868
if canSelectPlanet then
867869
return {string.format("%03d", defaultOrder), planetName}
868870
end
869-
return {"a" .. planetName, planetName}
871+
if owner then
872+
return {"a" .. planetName, planetName}
873+
end
874+
875+
return {"b" .. planetName, planetName}
870876
end
871877

872878
function externalFunctions.SetPlanetJoinedIfIDMatches(checkPlanetID, checkPlanetAttacker)
@@ -1400,7 +1406,7 @@ local function InitializeControls(window)
14001406
elseif defendPhase then
14011407
local myAttack, myFactionAttack = GetAttackingPlanet()
14021408
if myAttack then
1403-
statusText:SetText("You are attacking " .. myAttack .. ", the battle will start if there are any defenders at the end of the phase (or they forfeit).")
1409+
statusText:SetText("You are attacking " .. myAttack .. ", the battle will start at the end of the phase.")
14041410
else
14051411
statusText:SetText("Join planets that need defenders. Participating in defense generates an attack charge charge.")
14061412
end

LuaMenu/widgets/gui_queue_status_panel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ local function InitializeInstantQueueHandler()
358358
end
359359

360360
function externalFunctions.ProcessInstantStartQueue(instantStartQueues)
361-
if lobby.planetwarsData.attackingPlanet then
361+
if lobby.planetwarsData.attackingPlanet or lobby.planetwarsData.defendingPlanet then
362362
-- Don't show instant start when player is actively invading a planet and waiting for defenders.
363363
return false
364364
end

0 commit comments

Comments
 (0)