Project
This commit is contained in:
parent
5c0ea7cc90
commit
a1e3d4cf12
@ -381,6 +381,9 @@ public class FPSWindow : GameWindow , IWindow
|
||||
}
|
||||
|
||||
private int frame = 0;
|
||||
|
||||
public bool UseLiveView { get; set; } = false;
|
||||
public bool CollectUpperFiles { get; set; }
|
||||
|
||||
public void ReportSizeUpdate(IRenderObject Control)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
<IncludeSymbols>False</IncludeSymbols>
|
||||
<RepositoryUrl>https://git.jacobtech.com/JacobTech.com/GraphicsManager</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<Version>1.1.1-alpha29</Version>
|
||||
<Version>1.1.1-alpha35</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
|
@ -28,4 +28,6 @@ public interface IParent
|
||||
public void ResizeDraw(int x, int y, int sx, int sy, int sw, int sh);
|
||||
public int OldWidth { get; }
|
||||
public int OldHeight { get; }
|
||||
|
||||
public bool CollectUpperFiles { get; set; }
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ public interface IWindow : IParent
|
||||
|
||||
public bool LastFrameIsResize { get; }
|
||||
public bool UseSubFrames { get; set; }
|
||||
|
||||
public bool UseLiveView { get; set; }
|
||||
|
||||
public void CheckParent(IParent p, IRenderObject c, int xx, Vector2i di);
|
||||
public void CheckParent(IParent p);
|
||||
|
@ -87,7 +87,16 @@ public abstract class ParentBase : Rectangle, IParent
|
||||
{
|
||||
BaseParentResize();
|
||||
}
|
||||
|
||||
|
||||
public override void UpdateOpenGLCords(bool draw = false)
|
||||
{
|
||||
base.UpdateOpenGLCords(draw);
|
||||
for (int i = 0; i < Controls.Length; i++)
|
||||
{
|
||||
Controls[i].UpdateOpenGLCords();
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetLocation(int x, int y)
|
||||
{
|
||||
base.SetLocation(x, y);
|
||||
@ -115,8 +124,7 @@ public abstract class ParentBase : Rectangle, IParent
|
||||
{
|
||||
DrawBase();
|
||||
if (!UpdateScissorBox(ref x, ref y, ref sx, ref sy, ref sw, ref sh)) return;
|
||||
|
||||
|
||||
GL.Scissor(sx, Window!.CS.Y - sy - sh, sw, sh);
|
||||
for (int i = 0; i < Controls.Length; i++)
|
||||
{
|
||||
if (!Controls[i].Loaded)
|
||||
@ -136,9 +144,10 @@ public abstract class ParentBase : Rectangle, IParent
|
||||
}
|
||||
}
|
||||
|
||||
public bool CollectUpperFiles { get; set; }
|
||||
|
||||
public virtual bool UpdateScissorBox(ref int x, ref int y, ref int sx, ref int sy, ref int sw, ref int sh, int xx = 0, int xy = 0, int lw = 0, int lh = 0, bool UpdateBoxInfo = true)
|
||||
{
|
||||
|
||||
int nw = Size.X - xx - lw,
|
||||
nh = Size.Y - xy - lh,
|
||||
nx = Location.X + xx,
|
||||
|
@ -350,12 +350,12 @@ public class Rectangle : ITextureObject
|
||||
|
||||
public bool BlendOverride;
|
||||
|
||||
public void TryDraw(int deapth = 0)
|
||||
public virtual void TryDraw(int deapth = 0)
|
||||
{
|
||||
if (BlockDraw) return;
|
||||
if (Parent is null) return;
|
||||
if (!IsVisible) return;
|
||||
if (Window is null) return;
|
||||
if (Window.UseLiveView && !IsVisible) return;
|
||||
if (!Window.UseSubFrames)
|
||||
{
|
||||
Parent.TryDraw();
|
||||
@ -555,6 +555,7 @@ public class Rectangle : ITextureObject
|
||||
size_.Y = h;
|
||||
UpdateOpenGLCords(true);
|
||||
if (SizeChanged is not null) SizeChanged.Invoke(this);
|
||||
if (Parent is not null) Parent.ReportSizeUpdate(this);
|
||||
}
|
||||
|
||||
public virtual void SetLocation(int xy)
|
||||
|
@ -81,8 +81,51 @@ public class Window : NativeWindow , IWindow
|
||||
GL.Enable(EnableCap.Blend);
|
||||
GL.Enable(EnableCap.ScissorTest);
|
||||
}
|
||||
|
||||
protected virtual void OnFileDrop(FileDropEventArgs obj)
|
||||
{
|
||||
void CheckFileDrop(IParent p, Vector2i diff)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = p.Controls.Length - 1; i >= 0; i--)
|
||||
{
|
||||
if ((p.Controls[i].Location + diff).X <= (int)MousePosition.X &&
|
||||
(p.Controls[i].Location + diff).Y <= (int)MousePosition.Y &&
|
||||
(p.Controls[i].Location + p.Controls[i].Size + diff).X >= (int)MousePosition.X &&
|
||||
(p.Controls[i].Location + p.Controls[i].Size + diff).Y >= (int)MousePosition.Y)
|
||||
{
|
||||
if (p.Controls[i] is IParent pp)
|
||||
{
|
||||
if (pp.CollectUpperFiles)
|
||||
{
|
||||
found = true;
|
||||
p.Controls[i].SendFilesEvent(obj.FileNames);
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckFileDrop(pp, pp.Controls[i].Location + diff);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
found = true;
|
||||
p.Controls[i].SendFilesEvent(obj.FileNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && p is IRenderObject renderObject)
|
||||
{
|
||||
renderObject.SendFilesEvent(obj.FileNames);
|
||||
}
|
||||
}
|
||||
CheckFileDrop(this, new(0));
|
||||
}
|
||||
|
||||
public bool CollectUpperFiles { get; set; }
|
||||
|
||||
public bool UseSubFrames { get; set; } = false;
|
||||
public bool UseLiveView { get; set; } = false;
|
||||
|
||||
private void OnTextInputEvent(TextInputEventArgs obj)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user