# HG changeset patch # User Wuzzy # Date 1518263953 -3600 # Node ID 08f91e9e3d2cfc033c4a82f56428d057d2e779c0 # Parent 89930daecaab23baedf44ea3b0700ba3ac315309 Construction Mode: Hide power tag when it's nobody's turn diff -r 89930daecaab -r 08f91e9e3d2c share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua Sat Feb 10 12:44:40 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua Sat Feb 10 12:59:13 2018 +0100 @@ -300,6 +300,11 @@ end +function DeleteClanPowerTag() + DeleteVisualGear(clanPowerTag) + clanPowerTag = nil +end + function XYisInRect(px, py, psx, psy, pex, pey) if (px > psx) and (px < pex) and (py > psy) and (py < pey) then @@ -1013,7 +1018,9 @@ end if placed then + -- Pay the price clanPower[GetHogClan(CurrentHedgehog)] = clanPower[GetHogClan(CurrentHedgehog)] - placedExpense + DrawClanPowerTag() else AddCaption(loc("Invalid Placement"), colorMessageError, capgrpVolume) PlaySound(sndDenied) @@ -1176,15 +1183,15 @@ if GameTime % 100 == 0 then - DrawClanPowerTag() - -- Force-update the construction mode tools every 100ms. -- This makes sure the announcer messages don't disappear -- while the tool is selected. if (band(GetState(CurrentHedgehog), gstHHDriven) ~= 0) then + DrawClanPowerTag() curWep = GetCurAmmoType() HandleConstructionModeTools() else + DeleteClanPowerTag() curWep = amNothing end @@ -1629,11 +1636,14 @@ end clanUsedExtraTime[clan] = false clanCratesSpawned[clan] = 0 + + DrawClanPowerTag() end function onEndTurn() curWep = amNothing HandleConstructionModeTools() + DeleteClanPowerTag() end function onGameTick()