(7e0adb991) Fixed legacy items failing to load if a sub is saved with a language other than English and the language then changed to something else.
This commit is contained in:
@@ -236,6 +236,8 @@ namespace Barotrauma
|
||||
|
||||
GraphicsDeviceManager.PreferredBackBufferWidth = GraphicsWidth;
|
||||
GraphicsDeviceManager.PreferredBackBufferHeight = GraphicsHeight;
|
||||
|
||||
GraphicsDeviceManager.ApplyChanges();
|
||||
}
|
||||
|
||||
public void ResetViewPort()
|
||||
@@ -253,7 +255,7 @@ namespace Barotrauma
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
RequestGraphicsSettings();
|
||||
ApplyGraphicsSettings();
|
||||
|
||||
ScissorTestEnable = new RasterizerState() { ScissorTestEnable = true };
|
||||
|
||||
@@ -292,38 +294,6 @@ namespace Barotrauma
|
||||
#endif
|
||||
|
||||
loadingCoroutine = CoroutineManager.StartCoroutine(Load(canLoadInSeparateThread), "", canLoadInSeparateThread);
|
||||
|
||||
#if WINDOWS
|
||||
var gameForm = (System.Windows.Forms.Form)System.Windows.Forms.Form.FromHandle(Window.Handle);
|
||||
gameForm.Activated += new EventHandler(HandleFocus);
|
||||
gameForm.Deactivate += new EventHandler(HandleDefocus);
|
||||
if (WindowActive) { HandleFocus(null, null); }
|
||||
#endif
|
||||
}
|
||||
|
||||
#if WINDOWS
|
||||
private void HandleFocus(object sender, EventArgs e)
|
||||
{
|
||||
CoroutineManager.StopCoroutines("FocusCoroutine");
|
||||
CoroutineManager.StartCoroutine(FocusCoroutine(),"FocusCoroutine");
|
||||
}
|
||||
|
||||
private IEnumerable<object> FocusCoroutine()
|
||||
{
|
||||
yield return new WaitForSeconds(0.01f);
|
||||
ApplyGraphicsSettings();
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
private void HandleDefocus(object sender, EventArgs e)
|
||||
{
|
||||
CoroutineManager.StopCoroutines("FocusCoroutine");
|
||||
GraphicsDeviceManager.IsFullScreen = false;
|
||||
GraphicsDeviceManager.ApplyChanges();
|
||||
}
|
||||
#endif
|
||||
|
||||
loadingCoroutine = CoroutineManager.StartCoroutine(Load(canLoadInSeparateThread), "", canLoadInSeparateThread);
|
||||
}
|
||||
|
||||
private void InitUserStats()
|
||||
|
||||
Reference in New Issue
Block a user