Skip to content

Commit 6ee8012

Browse files
committed
Merge branch 'prerelease' into main
2 parents 3d207d4 + 08370fa commit 6ee8012

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1696
-1410
lines changed

TextEditorExample/Data/Scripts/TextEditorExample/EditorTextBox.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected override void Layout()
7171

7272
protected override void HandleInput(Vector2 cursorPos)
7373
{
74-
/* TextBoard Offsets 101:
74+
/* TextBoard Offsets:
7575
7676
The TextBoard allows you to set an offset for the text being rendered starting from the
7777
center of the element. Text outside the bounds of the element will not be drawn.
@@ -85,10 +85,6 @@ the opposite direction.
8585
8686
By default, the visible range of text will start at the first line on the first character.
8787
It starts in the upper left hand corner.
88-
89-
If you wanted to move to the last line to the top of the element, you'd need to set a Y-offset
90-
of TextSize.Y - lineSize.Y. If you wanted to move the last character in a line to the right side
91-
of the element, you'd set an X-offset of -charOffset.X + charSize.X / 2f.
9288
*/
9389

9490
ITextBoard textBoard = text.TextBoard;

TextEditorExample/Data/Scripts/TextEditorExample/EditorToolBar.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public event EventHandler BuildModeChanged
3333
/// </summary>
3434
public GlyphFormat Format
3535
{
36-
get { return _format; }
37-
set
36+
get { return _format; }
37+
set
3838
{
3939
FontStyles style = value.FontStyle;
4040
boldToggle.Selected = style.HasFlag(FontStyles.Bold);
@@ -128,6 +128,13 @@ public EditorToolBar(HudParentBase parent = null) : base(parent)
128128
Text = "I",
129129
};
130130

131+
/* HudChain is useful for organizing collections of elements into straight lines with regular spacing,
132+
* either vertically horizontally. In this case, I'm organizing elements horizontally from left to right
133+
* in the same order indicated by the collection initializer below.
134+
*
135+
* HudChain and its related types, like ScrollBox and the SelectionBox types, are powerful tools for
136+
* organizing UI elements, especially when used in conjunction with oneanother.
137+
*/
131138
layout = new HudChain(false, this) // Set to alignVertical false to align the elements horizontally
132139
{
133140
// Automatically resize the height of the elements to match that of the chain and allow the chain to be

TextEditorExample/Data/Scripts/TextEditorExample/EditorWindow.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ private void ChangeBuilderMode(object sender, EventArgs args)
7272
textBox.text.BuilderMode = toolBar.BulderMode;
7373
}
7474

75-
protected override void Draw()
75+
protected override void Layout()
7676
{
77+
base.Layout();
78+
7779
// Set window minimum width to prevent it from becoming narrower than the toolbar's minimum width
7880
MinimumSize = new Vector2(Math.Max(toolBar.MinimumWidth, MinimumSize.X), MinimumSize.Y);
7981

TextEditorExample/Data/Scripts/TextEditorExample/RichHudFramework/.gitrepo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[subrepo]
77
remote = [email protected]:ZachHembree/RichHudFramework.Client.git
88
branch = master
9-
commit = 1677b2dddf275fd2e5b2ab647bc3cc05cd7c7e75
10-
parent = dfddf712bcdb7c7a01e4f0d83445f00f8afe0311
9+
commit = ab19e8a09796e3369eb3e8c017a737c0bd87f9ec
10+
parent = a7f048cd796ec1fac1384442966f5dad314a81b0
1111
method = merge
1212
cmdver = 0.4.3

TextEditorExample/Data/Scripts/TextEditorExample/RichHudFramework/Client/RichHudClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ namespace RichHudFramework.Client
2020
/// </summary>
2121
public sealed class RichHudClient : RichHudComponentBase
2222
{
23-
public static readonly Vector4I versionID = new Vector4I(1, 1, 1, 0); // Major, Minor, Rev, Hotfix
23+
public static readonly Vector4I versionID = new Vector4I(1, 2, 0, 0); // Major, Minor, Rev, Hotfix
2424
public const ClientSubtypes subtype = ClientSubtypes.Full;
2525

2626
private const long modID = 1965654081, queueID = 1314086443;
27-
private const int vID = 8;
27+
private const int vID = 9;
2828

2929
public static bool Registered => Instance != null ? Instance.registered : false;
3030
private static RichHudClient Instance { get; set; }

TextEditorExample/Data/Scripts/TextEditorExample/RichHudFramework/Client/UI/BindManager/BindManager.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ public sealed partial class BindManager : RichHudClient.ApiModule<BindClientMemb
3838
/// </summary
3939
public static IReadOnlyList<IControl> Controls => Instance.controls;
4040

41+
/// <summary>
42+
/// Specifies blacklist mode for SE controls
43+
/// </summary>
44+
public static SeBlacklistModes BlacklistMode
45+
{
46+
get
47+
{
48+
if (_instance == null) Init();
49+
return (SeBlacklistModes)_instance.GetOrSetMemberFunc(null, (int)BindClientAccessors.RequestBlacklistMode);
50+
}
51+
set
52+
{
53+
if (_instance == null)
54+
Init();
55+
56+
_instance.GetOrSetMemberFunc(value, (int)BindClientAccessors.RequestBlacklistMode);
57+
}
58+
}
59+
4160
private static BindManager Instance
4261
{
4362
get { Init(); return _instance; }

TextEditorExample/Data/Scripts/TextEditorExample/RichHudFramework/Client/UI/HUD/HudCursor.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ private class HudCursor : ICursor
3434
/// </summary>
3535
public bool IsCaptured => (bool)GetOrSetMemberFunc(null, (int)HudCursorAccessors.IsCaptured);
3636

37+
/// <summary>
38+
/// Returns true if a tooltip has been registered
39+
/// </summary>
40+
public bool IsToolTipRegistered { get; private set; }
41+
3742
/// <summary>
3843
/// The position of the cursor in pixels in screen space
3944
/// </summary>
@@ -44,6 +49,10 @@ private class HudCursor : ICursor
4449
/// </summary>
4550
public Vector3D WorldPos { get; private set; }
4651

52+
/// <summary>
53+
/// Line projected from the cursor into world space on the -Z axis
54+
/// correcting for apparent warping due to perspective projection.
55+
/// </summary>
4756
public LineD WorldLine { get; private set; }
4857

4958
private readonly Func<HudSpaceDelegate, bool> IsCapturingSpaceFunc;
@@ -69,6 +78,7 @@ public void Update()
6978
ScreenPos = (Vector2)GetOrSetMemberFunc(null, (int)HudCursorAccessors.ScreenPos);
7079
WorldPos = (Vector3D)GetOrSetMemberFunc(null, (int)HudCursorAccessors.WorldPos);
7180
WorldLine = (LineD)GetOrSetMemberFunc(null, (int)HudCursorAccessors.WorldLine);
81+
IsToolTipRegistered = (bool)GetOrSetMemberFunc(null, (int)HudCursorAccessors.IsToolTipRegistered);
7282
}
7383

7484
/// <summary>
@@ -115,6 +125,14 @@ public bool TryCapture(ApiMemberAccessor capturedElement) =>
115125
/// </summary>
116126
public bool TryRelease(ApiMemberAccessor capturedElement) =>
117127
TryReleaseFunc(capturedElement);
128+
129+
/// <summary>
130+
/// Registers a callback delegate to set the tooltip for the next frame. Tooltips are reset
131+
/// every tick and must be reregistered in HandleInput() every tick. The first tooltip registered
132+
/// takes precedence.
133+
/// </summary>
134+
public void RegisterToolTip(ToolTip toolTip) =>
135+
GetOrSetMemberFunc(toolTip.GetToolTipFunc, (int)HudCursorAccessors.RegisterToolTip);
118136
}
119137
}
120138
}

0 commit comments

Comments
 (0)