Skip to content

Commit 76d7eb4

Browse files
committed
Small fixes and wording.
1 parent a847146 commit 76d7eb4

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

LuaMenu/widgets/gui_planetwars_list_window.lua

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,10 @@ 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-
Spring.Echo("MODEMODEMODE", activePlanet, activePlanetAttacker, currentMode, lobby.PW_ATTACK)
159158
if currentMode == lobby.PW_ATTACK and activePlanet then
160159
local myPlanet = FindMatchingPlanet(activePlanet, activePlanetAttacker, planets)
161-
Spring.Echo("myPlanetmyPlanetmyPlanet", myPlanet)
162160
if myPlanet then
163-
return myPlanet, true, true, false
161+
return myPlanet, true, true, true
164162
end
165163
return false
166164
end
@@ -1344,12 +1342,12 @@ local function InitializeControls(window)
13441342
if rechargeTime then
13451343
local difference, inTheFuture, isNow = Spring.Utilities.GetTimeDifference(rechargeTime, false, true)
13461344
if inTheFuture then
1347-
text = text.. " - Gain more by defending or waiting for " .. difference
1345+
text = text.. " - Gain more by defending or wait for " .. difference
13481346
else
1349-
text = text .. " - Gain more by defending or waiting for 0 seconds"
1347+
text = text .. " - Gain more by defending or wait for 0 seconds"
13501348
end
13511349
elseif charges < pwData.maxCharges then
1352-
text = text .. " - Gain more by defending"
1350+
text = text .. " - Gain more by defending"
13531351
end
13541352
chargesText:SetText(text)
13551353
end
@@ -1376,7 +1374,7 @@ local function InitializeControls(window)
13761374
if planet.DefenderFaction == myFaction then
13771375
planetStatusData.myDefend = planetStatusData.myDefend + planet.Count
13781376
planetStatusData.myDefendMax = planetStatusData.myDefendMax + planet.Needed
1379-
elseif not planet.OwnerFaction then
1377+
elseif not planet.OwnerFaction and planet.AttackerFaction ~= myFaction then
13801378
planetStatusData.neutralDefend = planetStatusData.neutralDefend + planet.Count
13811379
planetStatusData.neutralDefendMax = planetStatusData.neutralDefendMax + planet.Needed
13821380
end
@@ -1392,7 +1390,7 @@ local function InitializeControls(window)
13921390
if charges == 0 then
13931391
statusText:SetText("You are out of attack charges. Regain charges by defending or waiting for the recharge timer.")
13941392
else
1395-
statusText:SetText("Select a planet to attack, it will launch when the timer runs out if enough allies join.")
1393+
statusText:SetText("Select a planet to attack and wait for allies to join you. Attacks lock at the end of the phase and request defenders.")
13961394
end
13971395
if planets then
13981396
UpdatePlanetStatusData(attackPhase, planets)
@@ -1408,13 +1406,21 @@ local function InitializeControls(window)
14081406
if myAttack then
14091407
statusText:SetText("You are attacking " .. myAttack .. ", the battle will start at the end of the phase.")
14101408
else
1411-
statusText:SetText("Join planets that need defenders. Participating in defense generates an attack charge charge.")
1409+
statusText:SetText("Join planets that need defending. Doing so gives you an attack charge.")
14121410
end
14131411

14141412
if planets then
14151413
UpdatePlanetStatusData(attackPhase, planets)
1416-
planetStatusText.attackers:SetText("Defenders: " .. planetStatusData.myDefend .. " / " .. planetStatusData.myDefendMax)
1417-
planetStatusText.incoming:SetText("Neutral Defenders: " .. planetStatusData.neutralDefend .. " / " .. planetStatusData.neutralDefendMax)
1414+
if planetStatusData.myDefendMax and planetStatusData.myDefendMax > 0 then
1415+
planetStatusText.attackers:SetText("Defenders: " .. planetStatusData.myDefend .. " / " .. planetStatusData.myDefendMax)
1416+
else
1417+
planetStatusText.attackers:SetText("Defenders: -")
1418+
end
1419+
if planetStatusData.neutralDefendMax and planetStatusData.neutralDefendMax > 0 then
1420+
planetStatusText.incoming:SetText("Neutral Defenders: " .. planetStatusData.neutralDefend .. " / " .. planetStatusData.neutralDefendMax)
1421+
else
1422+
planetStatusText.incoming:SetText("Neutral Defenders: -")
1423+
end
14181424
planetStatusText.attackers:SetVisibility(true)
14191425
planetStatusText.incoming:SetVisibility(true)
14201426
planetStatusText.neutral:SetVisibility(false)

0 commit comments

Comments
 (0)