Skip to content

Commit 00c1896

Browse files
committed
feat(version): 1.8.7
1 parent 9a03e31 commit 00c1896

8 files changed

Lines changed: 22 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
[#] Bug Fixes<br>
88
[.] Others
99

10+
### V 1.8.7 - 16/04/2024
11+
[#] Widgets : Fix update when not displayed
12+
1013
### V 1.8.6 - 15/04/2024
1114
[#] Fix all 1.8.5
1215

SharpEngine.Core/SharpEngine.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Copyright>Copyright (c) LavaPower 2021-2023</Copyright>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111
<PackageProjectUrl>https://github.com/SharpEngine/SharpEngine.Core</PackageProjectUrl>
12-
<PackageVersion>1.8.6</PackageVersion>
12+
<PackageVersion>1.8.7</PackageVersion>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<EnablePackageValisation>true</EnablePackageValisation>

SharpEngine.Core/Widget/Button.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public override void Update(float delta)
9696
{
9797
base.Update(delta);
9898

99-
if (!Displayed || !Active)
99+
if (!RealDisplayed || !Active)
100100
return;
101101

102102
if (InputManager.IsMouseInRectangle(new Rect(RealPosition - Size / 2, Size)))

SharpEngine.Core/Widget/Checkbox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public override void Update(float delta)
3838
{
3939
base.Update(delta);
4040

41-
if (!Displayed || !Active)
41+
if (!RealDisplayed || !Active)
4242
return;
4343

4444
if (

SharpEngine.Core/Widget/LineInput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class LineInput(
6767
/// <inheritdoc />
6868
public override void Update(float delta)
6969
{
70-
if (!Displayed || !Active)
70+
if (!RealDisplayed || !Active)
7171
{
7272
Focused = false;
7373
return;

SharpEngine.Core/Widget/ScrollFrame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override void Update(float delta)
5555
{
5656
base.Update(delta);
5757

58-
if(!Displayed)
58+
if(!RealDisplayed)
5959
return;
6060

6161
var move = InputManager.GetMouseWheelMove();

SharpEngine.Core/Widget/Slider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public override void Update(float delta)
3434
{
3535
base.Update(delta);
3636

37-
if (!Displayed)
37+
if (!RealDisplayed)
3838
return;
3939

4040
if (InputManager.IsMouseButtonDown(MouseButton.Left))

SharpEngine.Core/Widget/Widget.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public abstract class Widget
2121
public int ZLayer { get; set; } = 0;
2222

2323
/// <summary>
24-
/// If Widget is Display
24+
/// If Widget is Displayed
2525
/// </summary>
2626
public bool Displayed { get; set; } = true;
2727

@@ -41,15 +41,20 @@ public abstract class Widget
4141
public PauseState PauseState { get; set; } = PauseState.Normal;
4242

4343
/// <summary>
44-
/// Name of Widgets
44+
/// Name of Widget
4545
/// </summary>
4646
public string Name { get; set; } = "";
4747

4848
/// <summary>
49-
/// Get Real Position (Position + Parent RealPostion if widget has Parent)
49+
/// Get Real Position (Position + Parent RealPosition if widget has Parent)
5050
/// </summary>
5151
public Vec2 RealPosition => Parent != null ? Position + Parent.RealPosition : Position;
5252

53+
/// <summary>
54+
/// If Widget is really displayed (considering parent's display state)
55+
/// </summary>
56+
public bool RealDisplayed => Displayed && (Parent == null || Parent.RealDisplayed);
57+
5358
/// <summary>
5459
/// Get All Direct Children of Widget
5560
/// </summary>
@@ -72,10 +77,10 @@ public Scene? Scene
7277
private Scene? _scene;
7378

7479
/// <summary>
75-
/// Widget
80+
/// Initializes a new instance of the <see cref="Widget"/> class.
7681
/// </summary>
77-
/// <param name="position">Position Widget</param>
78-
/// <param name="zLayer">ZLayer</param>
82+
/// <param name="position">The position of the widget.</param>
83+
/// <param name="zLayer">The Z layer of the widget.</param>
7984
protected Widget(Vec2 position, int zLayer = 0)
8085
{
8186
Position = position;
@@ -113,7 +118,7 @@ public List<Widget> GetAllChildren()
113118
/// <summary>
114119
/// Add Child and return it
115120
/// </summary>
116-
/// <param name="widget">Widget which be added</param>
121+
/// <param name="widget">Widget which will be added</param>
117122
/// <typeparam name="T">Type of Widget</typeparam>
118123
/// <returns>Child</returns>
119124
public T AddChild<T>(T widget)
@@ -129,7 +134,7 @@ public T AddChild<T>(T widget)
129134
/// <summary>
130135
/// Remove Child
131136
/// </summary>
132-
/// <param name="widget">Child will be removed</param>
137+
/// <param name="widget">Child that will be removed</param>
133138
public void RemoveChild(Widget widget)
134139
{
135140
widget.Scene = null;

0 commit comments

Comments
 (0)