Removed references to GameMain from GUIListBox & GUITextBlock (-> launcher works again)

This commit is contained in:
Regalis
2017-05-02 23:39:09 +03:00
parent f92c2df9f7
commit 39ddd63e0c
3 changed files with 27 additions and 22 deletions

View File

@@ -391,7 +391,8 @@ namespace Barotrauma
if (!scrollBarHidden) scrollBar.Draw(spriteBatch);
GameMain.CurrGraphicsDevice.ScissorRectangle = frame.Rect;
Rectangle prevScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
spriteBatch.GraphicsDevice.ScissorRectangle = frame.Rect;
int lastVisible = 0;
for (int i = 0; i < children.Count; i++)
@@ -408,8 +409,8 @@ namespace Barotrauma
lastVisible = i;
child.Draw(spriteBatch);
}
GameMain.CurrGraphicsDevice.ScissorRectangle = new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
spriteBatch.GraphicsDevice.ScissorRectangle = prevScissorRect;
}
private bool IsChildVisible(GUIComponent child)

View File

@@ -278,8 +278,12 @@ namespace Barotrauma
base.Draw(spriteBatch);
if (TextGetter != null) text = TextGetter();
if (overflowClipActive) GameMain.CurrGraphicsDevice.ScissorRectangle = rect;
Rectangle prevScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
if (overflowClipActive)
{
spriteBatch.GraphicsDevice.ScissorRectangle = rect;
}
if (!string.IsNullOrEmpty(text))
{
@@ -291,7 +295,10 @@ namespace Barotrauma
SpriteEffects.None, textDepth);
}
if (overflowClipActive) GameMain.CurrGraphicsDevice.ScissorRectangle = new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
if (overflowClipActive)
{
spriteBatch.GraphicsDevice.ScissorRectangle = prevScissorRect;
}
DrawChildren(spriteBatch);