mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Modifier display improvement
This commit is contained in:
1 parent
e4f15f2ed9
commit
a9ded0b313
3 files changed
+12
-1
No files matched your search
@@ -3,6 +3,7 @@
|
|||||||
.vs/
|
.vs/
|
||||||
obj/
|
obj/
|
||||||
bin/
|
bin/
|
||||||
|
.qodo/
|
||||||
|
|
||||||
*.user
|
*.user
|
||||||
*.lock.json
|
*.lock.json
|
||||||
@@ -104,6 +104,16 @@ public class ModifierDisplayComponent(nint ptr) : MonoBehaviour(ptr)
|
|||||||
UpdateModifiersList([.. PlayerControl.LocalPlayer.GetModifierComponent().ActiveModifiers]);
|
UpdateModifiersList([.. PlayerControl.LocalPlayer.GetModifierComponent().ActiveModifiers]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Use this to toggle the visibility of the modifiers tab.
|
||||||
|
/// </summary>
|
||||||
|
public void ToggleTab()
|
||||||
|
{
|
||||||
|
IsOpen = !IsOpen;
|
||||||
|
_children.gameObject.SetActive(IsOpen);
|
||||||
|
RefreshModifiers();
|
||||||
|
}
|
||||||
|
|
||||||
internal void DestroyComponent(ModifierUiComponent component)
|
internal void DestroyComponent(ModifierUiComponent component)
|
||||||
{
|
{
|
||||||
_modifiers.Remove(component.Modifier!);
|
_modifiers.Remove(component.Modifier!);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public static class ColorExtensions
|
|||||||
var r = color.r <= 0.03928f ? color.r / 12.92f : Mathf.Pow((color.r + 0.055f) / 1.055f, 2.4f);
|
var r = color.r <= 0.03928f ? color.r / 12.92f : Mathf.Pow((color.r + 0.055f) / 1.055f, 2.4f);
|
||||||
var g = color.g <= 0.03928f ? color.g / 12.92f : Mathf.Pow((color.g + 0.055f) / 1.055f, 2.4f);
|
var g = color.g <= 0.03928f ? color.g / 12.92f : Mathf.Pow((color.g + 0.055f) / 1.055f, 2.4f);
|
||||||
var b = color.b <= 0.03928f ? color.b / 12.92f : Mathf.Pow((color.b + 0.055f) / 1.055f, 2.4f);
|
var b = color.b <= 0.03928f ? color.b / 12.92f : Mathf.Pow((color.b + 0.055f) / 1.055f, 2.4f);
|
||||||
return 0.2126f * r + 0.7152f * g + 0.0722f * b;
|
return (0.2126f * r) + (0.7152f * g) + (0.0722f * b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in new issue
Block a user