Removed references to GameMain from GUIListBox & GUITextBlock (-> launcher works again)
This commit is contained in:
+12
-15
@@ -4,7 +4,6 @@ using Microsoft.Xna.Framework.Input;
|
|||||||
using Barotrauma;
|
using Barotrauma;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -25,7 +24,7 @@ namespace Launcher2
|
|||||||
string version = AssemblyName.GetAssemblyName("Barotrauma.exe").Version.ToString();
|
string version = AssemblyName.GetAssemblyName("Barotrauma.exe").Version.ToString();
|
||||||
|
|
||||||
private const string configPath = "config.xml";
|
private const string configPath = "config.xml";
|
||||||
private Barotrauma.GameSettings settings;
|
private GameSettings settings;
|
||||||
|
|
||||||
private string latestVersionFileList, latestVersionFolder;
|
private string latestVersionFileList, latestVersionFolder;
|
||||||
|
|
||||||
@@ -38,13 +37,7 @@ namespace Launcher2
|
|||||||
private GUIProgressBar progressBar;
|
private GUIProgressBar progressBar;
|
||||||
private GUIButton downloadButton;
|
private GUIButton downloadButton;
|
||||||
|
|
||||||
GUIButton launchButton;
|
private GUIButton launchButton;
|
||||||
|
|
||||||
//public bool FullScreenEnabled
|
|
||||||
//{
|
|
||||||
// get { return settings.FullScreenEnabled; }
|
|
||||||
// set { settings.FullScreenEnabled = value; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
public bool AutoCheckUpdates
|
public bool AutoCheckUpdates
|
||||||
{
|
{
|
||||||
@@ -52,14 +45,16 @@ namespace Launcher2
|
|||||||
set { settings.AutoCheckUpdates = value; }
|
set { settings.AutoCheckUpdates = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture2D backgroundTexture, titleTexture;
|
private Texture2D backgroundTexture, titleTexture;
|
||||||
|
|
||||||
GraphicsDeviceManager graphics;
|
private GraphicsDeviceManager graphics;
|
||||||
SpriteBatch spriteBatch;
|
private SpriteBatch spriteBatch;
|
||||||
|
|
||||||
int graphicsWidth, graphicsHeight;
|
private RasterizerState scissorTestEnable;
|
||||||
|
|
||||||
GUIFrame guiRoot;
|
private int graphicsWidth, graphicsHeight;
|
||||||
|
|
||||||
|
private GUIFrame guiRoot;
|
||||||
|
|
||||||
public LauncherMain()
|
public LauncherMain()
|
||||||
: base()
|
: base()
|
||||||
@@ -68,6 +63,8 @@ namespace Launcher2
|
|||||||
graphics.PreferredBackBufferWidth = 640;
|
graphics.PreferredBackBufferWidth = 640;
|
||||||
graphics.PreferredBackBufferHeight = 400;
|
graphics.PreferredBackBufferHeight = 400;
|
||||||
|
|
||||||
|
scissorTestEnable = new RasterizerState() { ScissorTestEnable = true };
|
||||||
|
|
||||||
IsMouseVisible = true;
|
IsMouseVisible = true;
|
||||||
|
|
||||||
supportedModes = new List<DisplayMode>();
|
supportedModes = new List<DisplayMode>();
|
||||||
@@ -214,7 +211,7 @@ namespace Launcher2
|
|||||||
{
|
{
|
||||||
GraphicsDevice.Clear(Color.Black);
|
GraphicsDevice.Clear(Color.Black);
|
||||||
|
|
||||||
spriteBatch.Begin();
|
spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, scissorTestEnable);
|
||||||
|
|
||||||
spriteBatch.Draw(backgroundTexture,
|
spriteBatch.Draw(backgroundTexture,
|
||||||
new Rectangle(0, 0, graphicsWidth, graphicsHeight),
|
new Rectangle(0, 0, graphicsWidth, graphicsHeight),
|
||||||
|
|||||||
@@ -391,7 +391,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (!scrollBarHidden) scrollBar.Draw(spriteBatch);
|
if (!scrollBarHidden) scrollBar.Draw(spriteBatch);
|
||||||
|
|
||||||
GameMain.CurrGraphicsDevice.ScissorRectangle = frame.Rect;
|
Rectangle prevScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
|
||||||
|
spriteBatch.GraphicsDevice.ScissorRectangle = frame.Rect;
|
||||||
|
|
||||||
int lastVisible = 0;
|
int lastVisible = 0;
|
||||||
for (int i = 0; i < children.Count; i++)
|
for (int i = 0; i < children.Count; i++)
|
||||||
@@ -409,7 +410,7 @@ namespace Barotrauma
|
|||||||
child.Draw(spriteBatch);
|
child.Draw(spriteBatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameMain.CurrGraphicsDevice.ScissorRectangle = new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
|
spriteBatch.GraphicsDevice.ScissorRectangle = prevScissorRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsChildVisible(GUIComponent child)
|
private bool IsChildVisible(GUIComponent child)
|
||||||
|
|||||||
@@ -279,7 +279,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (TextGetter != null) text = TextGetter();
|
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))
|
if (!string.IsNullOrEmpty(text))
|
||||||
{
|
{
|
||||||
@@ -291,7 +295,10 @@ namespace Barotrauma
|
|||||||
SpriteEffects.None, textDepth);
|
SpriteEffects.None, textDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overflowClipActive) GameMain.CurrGraphicsDevice.ScissorRectangle = new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
|
if (overflowClipActive)
|
||||||
|
{
|
||||||
|
spriteBatch.GraphicsDevice.ScissorRectangle = prevScissorRect;
|
||||||
|
}
|
||||||
|
|
||||||
DrawChildren(spriteBatch);
|
DrawChildren(spriteBatch);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user