Skip to content

Commit 5c4459b

Browse files
committed
New UI and Fix
1 parent 04a3cc1 commit 5c4459b

15 files changed

Lines changed: 85 additions & 4201 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Thanks to miniduikboot & GD for hosting modded servers (and so much more)
180180
[Ninja](#ninja), [Thief](#thief), [Lawyer](#lawyer) / [Pursuer](#pursuer), [Deputy](#deputy), [Portalmaker](#portalmaker), [Guesser Modifier](#guesser-modifier) - Idea: [K3ndo](https://github.com/K3ndoo) ; Developed by [Gendelo](https://github.com/gendelo3) & [Mallöris](https://github.com/Mallaris) \
181181
[ugackMiner53](https://github.com/ugackMiner53/PropHunt) - Idea and core code for the Prop Hunt game mode
182182
Role Draft Music: [Unreal Superhero 3 by Kenët & Rez](https://www.youtube.com/watch?v=9STiQ8cCIo0)
183-
[TheOtherRolesGMIA](https://github.com/dabao40/TheOtherRolesGMIA) - Meta Context from **Imp11**.\
183+
[TheOtherRolesGMIA](https://github.com/dabao40/TheOtherRolesGMIA) - Some code from **Imp11**.\
184184

185185
# Settings
186186
The mod adds a few new settings to Among Us (in addition to the role settings):

TheOtherRoles/Helpers.cs

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -903,39 +903,6 @@ public static Vector3 WorldToScreenPoint(Vector3 worldPos, int cameraLayer)
903903
{
904904
return FindCamera(cameraLayer)?.WorldToScreenPoint(worldPos) ?? Vector3.zero;
905905
}
906-
907-
public static Vector3 ScreenToWorldPoint(Vector3 screenPos, int cameraLayer)
908-
{
909-
return FindCamera(cameraLayer)?.ScreenToWorldPoint(screenPos) ?? Vector3.zero;
910-
}
911-
912-
public static PassiveButton SetUpButton(this GameObject gameObject, bool withSound = false,
913-
SpriteRenderer buttonRenderer = null, Color? defaultColor = null, Color? selectedColor = null)
914-
{
915-
var button = gameObject.AddComponent<PassiveButton>();
916-
button.OnClick = new Button.ButtonClickedEvent();
917-
button.OnMouseOut = new UnityEvent();
918-
button.OnMouseOver = new UnityEvent();
919-
920-
if (withSound)
921-
{
922-
button.OnClick.AddListener((Action)(() =>
923-
SoundManager.Instance.PlaySound(VanillaAsset.SelectClip, false, 0.8f)));
924-
button.OnMouseOver.AddListener((Action)(() =>
925-
SoundManager.Instance.PlaySound(VanillaAsset.HoverClip, false, 0.8f)));
926-
}
927-
928-
if (buttonRenderer != null)
929-
{
930-
button.OnMouseOut.AddListener((Action)(() => buttonRenderer!.color = defaultColor ?? Color.white));
931-
button.OnMouseOver.AddListener((Action)(() => buttonRenderer!.color = selectedColor ?? Color.green));
932-
}
933-
934-
if (buttonRenderer != null) buttonRenderer.color = defaultColor ?? Color.white;
935-
936-
return button;
937-
}
938-
939906
public static SpriteRenderer CreateSharpBackground(Vector2 size, Color color, Transform transform)
940907
{
941908
var renderer = CreateObject<SpriteRenderer>("Background", transform, new Vector3(0, 0, 0.25f));
@@ -1032,4 +999,22 @@ public static bool isChinese()
1032999
return false;
10331000
}
10341001
}
1002+
public interface Image
1003+
{
1004+
internal Sprite GetSprite();
1005+
}
1006+
public interface ISpriteLoader : Image
1007+
{
1008+
}
1009+
public class WrapSpriteLoader : ISpriteLoader
1010+
{
1011+
Func<Sprite> supplier;
1012+
1013+
public WrapSpriteLoader(Func<Sprite> supplier)
1014+
{
1015+
this.supplier = supplier;
1016+
}
1017+
1018+
public Sprite GetSprite() => supplier.Invoke();
1019+
}
10351020
}

TheOtherRoles/Main.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using InnerNet;
2020
using Reactor.Networking;
2121
using Reactor.Networking.Attributes;
22-
using TheOtherRoles.MetaContext;
2322
using TheOtherRoles.Modules;
2423
using TheOtherRoles.Modules.CustomHats;
2524
using TheOtherRoles.Patches;
@@ -155,10 +154,6 @@ public override void Load()
155154
MainMenuPatch.addSceneChangeCallbacks();
156155
_ = RoleInfo.loadReadme();
157156
AddToKillDistanceSetting.addKillDistance();
158-
SceneManager.sceneLoaded += (UnityAction<Scene, LoadSceneMode>)((scene, loadMode) =>
159-
{
160-
new GameObject("TORManager").AddComponent<TORGUIManager>();
161-
});
162157
Logger.LogInfo("Loading TOR completed!");
163158
}
164159
}

0 commit comments

Comments
 (0)