Skip to content

Commit

Permalink
Move Tooltip classes to a namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Banane9 committed Aug 15, 2024
1 parent 0ae496b commit ae6a8d3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using System.Threading.Tasks;

namespace MonkeyLoader.Resonite.UI
namespace MonkeyLoader.Resonite.UI.Tooltips
{
/// <summary>
/// Adds tooltips to <see cref="Button"/>s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text;
using System.Threading.Tasks;

namespace MonkeyLoader.Resonite.UI
namespace MonkeyLoader.Resonite.UI.Tooltips
{
public sealed class Tooltip
{
Expand Down Expand Up @@ -36,19 +36,19 @@ public Tooltip(Slot parent, in float3 localPosition, in LocaleString label)
TextRenderer.Color.Value = TooltipConfig.Instance.TextColor;

// back panel slot
Slot backPanelOffset = Root.AddLocalSlot("bgOffset");
var backPanelOffset = Root.AddLocalSlot("bgOffset");
backPanelOffset.LocalPosition = new float3(0, 0, 1);
Slot backPanel = backPanelOffset.AddLocalSlot("Background");
QuadMesh quad = backPanel.AttachComponent<QuadMesh>();
MeshRenderer meshRenderer = backPanel.AttachComponent<MeshRenderer>();
var backPanel = backPanelOffset.AddLocalSlot("Background");
var quad = backPanel.AttachComponent<QuadMesh>();
var meshRenderer = backPanel.AttachComponent<MeshRenderer>();
meshRenderer.Mesh.Target = quad;
BoundingBoxDriver sizeDriver = Root.AttachComponent<BoundingBoxDriver>();
var sizeDriver = Root.AttachComponent<BoundingBoxDriver>();
sizeDriver.BoundedSource.Target = TextRenderer;
sizeDriver.Size.Target = backPanel.Scale_Field;
sizeDriver.Center.Target = backPanel.Position_Field;
sizeDriver.Padding.Value = new float3(8 * Scale, 8 * Scale, 0);

UI_UnlitMaterial mat = backPanel.AttachComponent<UI_UnlitMaterial>();
var mat = backPanel.AttachComponent<UI_UnlitMaterial>();
mat.Tint.Value = TooltipConfig.Instance.BackgroundColor;
meshRenderer.Material.Target = mat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using MonkeyLoader.Configuration;
using System;

namespace MonkeyLoader.Resonite.UI
namespace MonkeyLoader.Resonite.UI.Tooltips
{
public sealed class TooltipConfig : SingletonConfigSection<TooltipConfig>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Text;
using System.Threading.Tasks;

namespace MonkeyLoader.Resonite.UI
namespace MonkeyLoader.Resonite.UI.Tooltips
{
public sealed class TooltipManager : ConfiguredResoniteMonkey<TooltipManager, TooltipConfig>, ICancelableEventSource<ResolveTooltipLabelEvent>
{
Expand Down

0 comments on commit ae6a8d3

Please sign in to comment.