mirror of
https://github.com/4sval/FModel.git
synced 2026-04-07 09:36:29 -05:00
frozen events workaround
This commit is contained in:
parent
fb330e33da
commit
bb7eaf3e15
|
|
@ -69,6 +69,9 @@ public class CUE4ParseViewModel : ViewModel
|
|||
set => SetProperty(ref _modelIsOverwritingMaterial, value);
|
||||
}
|
||||
|
||||
public Snooper SnooperViewer => _snooper ??= new Snooper();
|
||||
private Snooper _snooper;
|
||||
|
||||
public AbstractVfsFileProvider Provider { get; }
|
||||
public GameDirectoryViewModel GameDirectory { get; }
|
||||
public AssetsFolderViewModel AssetsFolder { get; }
|
||||
|
|
@ -753,8 +756,7 @@ public class CUE4ParseViewModel : ViewModel
|
|||
export.Owner.Name.EndsWith($"/RenderSwitch_Materials/{export.Name}", StringComparison.OrdinalIgnoreCase) ||
|
||||
export.Owner.Name.EndsWith($"/MI_BPTile/{export.Name}", StringComparison.OrdinalIgnoreCase))):
|
||||
{
|
||||
var snooper = new Snooper();
|
||||
snooper.Run(export);
|
||||
SnooperViewer.Run(export);
|
||||
return true;
|
||||
}
|
||||
case UMaterialInstance m when ModelIsOverwritingMaterial:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace FModel.Views.Snooper;
|
|||
|
||||
public class Snooper
|
||||
{
|
||||
private IWindow _window;
|
||||
private readonly IWindow _window;
|
||||
private ImGuiController _controller;
|
||||
private GL _gl;
|
||||
private Camera _camera;
|
||||
|
|
@ -122,7 +122,6 @@ public class Snooper
|
|||
|
||||
var input = _window.CreateInput();
|
||||
_keyboard = input.Keyboards[0];
|
||||
_keyboard.KeyDown += KeyDown;
|
||||
_mouse = input.Mice[0];
|
||||
|
||||
_gl = GL.GetApi(_window);
|
||||
|
|
@ -209,29 +208,19 @@ public class Snooper
|
|||
var multiplier = _keyboard.IsKeyPressed(Key.ShiftLeft) ? 2f : 1f;
|
||||
var moveSpeed = _camera.Speed * multiplier * (float) deltaTime;
|
||||
if (_keyboard.IsKeyPressed(Key.W))
|
||||
{
|
||||
_camera.Position += moveSpeed * _camera.Direction;
|
||||
}
|
||||
if (_keyboard.IsKeyPressed(Key.S))
|
||||
{
|
||||
_camera.Position -= moveSpeed * _camera.Direction;
|
||||
}
|
||||
if (_keyboard.IsKeyPressed(Key.A))
|
||||
{
|
||||
_camera.Position -= Vector3.Normalize(Vector3.Cross(_camera.Direction, _camera.Up)) * moveSpeed;
|
||||
}
|
||||
if (_keyboard.IsKeyPressed(Key.D))
|
||||
{
|
||||
_camera.Position += Vector3.Normalize(Vector3.Cross(_camera.Direction, _camera.Up)) * moveSpeed;
|
||||
}
|
||||
if (_keyboard.IsKeyPressed(Key.E))
|
||||
{
|
||||
_camera.Position += moveSpeed * _camera.Up;
|
||||
}
|
||||
if (_keyboard.IsKeyPressed(Key.Q))
|
||||
{
|
||||
_camera.Position -= moveSpeed * _camera.Up;
|
||||
}
|
||||
if (_keyboard.IsKeyPressed(Key.Escape))
|
||||
_window.Close();
|
||||
}
|
||||
|
||||
private void OnClose()
|
||||
|
|
@ -249,14 +238,4 @@ public class Snooper
|
|||
_window.Dispose();
|
||||
_gl.Dispose();
|
||||
}
|
||||
|
||||
private void KeyDown(IKeyboard keyboard, Key key, int arg3)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case Key.Escape:
|
||||
_window.Close();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user