Skip to content
Permalink
Browse files

disables DrawWorldPreUnit() when lobby shows

  • Loading branch information...
Ruwetuin committed Oct 3, 2019
1 parent 747d4a5 commit fe00a9ca83bd93459d084e253c7c796ea6a6e3d8
@@ -709,6 +709,7 @@ local function DoLine(x1, y1, z1, x2, y2, z2)
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if Spring.IsGUIHidden() then return end

-- Check command is to build a mex
@@ -164,7 +164,14 @@ end


-- Drawing:
function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if not drawWithHiddenGUI then
if spIsGUIHidden() then return end
end
@@ -443,8 +443,8 @@ local function createGuiList()
end)
end


function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if spIsGUIHidden() then return end
gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA) -- disable layer blending
DrawSelectedUnits()
@@ -578,17 +578,17 @@ function widget:SetConfigData(data)
end




if showGui then
function widget:RecvLuaMsg(msg, playerID)
function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawScreen()
if chobbyInterface then return end

if showGui then

function widget:DrawScreen()
if chobbyInterface then return end
if lockPlayerID ~= nil then
if not guiList then
createGuiList()
@@ -416,7 +416,14 @@ local function DrawCursor(playerID,wx,wz,camX,camY,camZ,opacity)
end
end

function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if spIsGUIHidden() then return end
gl.DepthTest(GL.ALWAYS)
gl.Blending(GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA)
@@ -95,6 +95,7 @@ end
local lastGameUpdate = Spring.GetGameSeconds()

function widget:Update(dt)
if chobbyInterface then return end

local userSpeed,_,pause = Spring.GetGameSpeed()
if (pause) then
@@ -649,8 +649,8 @@ local prevTexOffset = 0
local texOffset = 0
local prevOsClock = os.clock()


function widget:DrawWorldPreUnit()
if chobbyInterface then return end
drawFrame = drawFrame + 1

if spIsGUIHidden() then return end
@@ -800,7 +800,6 @@ function widget:DrawWorldPreUnit()
end



function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
@@ -420,7 +420,14 @@ function rewindAnimation()
end


function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end


if not miniMapOnly and areConditionsMet() then
@@ -710,7 +710,14 @@ do
end --// end do


function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if spIsGUIHidden() then return end

local clockDifference = (os.clock() - previousOsClock)
@@ -469,6 +469,7 @@ end
local sec = 0
local doUpdate = true
function widget:Update(dt)
if chobbyInterface then return end

if not enabled then return end

@@ -189,7 +189,14 @@ function Round(num, idp)
end


function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if Spring.IsGUIHidden() then return end

local osClock = os.clock()
@@ -165,7 +165,14 @@ function widget:Update()
end
end

function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if Spring.IsGUIHidden() then return end

local osClock = os.clock()
@@ -52,7 +52,14 @@ local function DrawTexturedGroundQuadFromU(u)
DrawTexturedGroundQuadFromUdXZ(Spring.GetUnitDefID(u),x,z)
end

function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end

-- Units being placed
local _,cmd=Spring.GetActiveCommand()
@@ -929,6 +929,7 @@ end
local sec = 0
local uiOpacitySec = 0
function widget:Update(dt)
if chobbyInterface then return end
uiOpacitySec = uiOpacitySec + dt
if uiOpacitySec>0.5 then
uiOpacitySec = 0
@@ -419,6 +419,7 @@ end
local sec = 0
local flushDistsTime = 20
function widget:Update(dt)
if chobbyInterface then return end
if (sIsGUIHidden()) then
for i=1,#Todo do
Todo[i] = nil
@@ -126,7 +126,14 @@ function widget:UnitCreated(uId, uDefId)
end
end

function widget:RecvLuaMsg(msg, playerID)
if msg:sub(1,18) == 'LobbyOverlayActive' then
chobbyInterface = (msg:sub(1,19) == 'LobbyOverlayActive1')
end
end

function widget:DrawWorldPreUnit()
if chobbyInterface then return end
if Spring.IsGUIHidden() then return end
for uId, rings in pairs(ringedUnits) do
if (Spring.IsUnitAllied(uId)and Spring.IsUnitSelected(uId)) then

0 comments on commit fe00a9c

Please sign in to comment.
You can’t perform that action at this time.