protected static Dictionary<int, string> ColorStrings = new Dictionary<int, string>();
public static List<int> lighterColors = new List<int>(){ 3, 4, 5, 7, 10, 11, 13, 14, 17 };
public static uint pickableColors = (uint)Palette.ColorNames.Length;
-
- private static readonly List<int> ORDER = new List<int>() { 7, 14, 5, 33, 4,
- 30, 0, 19, 27, 3,
- 17, 25, 18, 13, 23,
- 8, 32, 1, 21, 31,
- 10, 34, 15, 28, 22,
- 29, 11, 2, 26, 16,
- 20, 24, 9, 12, 6 };
+ private static readonly List<int> ORDER = new List<int>() { 7, 37, 14, 5, 33, 41, 25,
+ 4, 30, 0, 35, 3, 27, 17,
+ 13, 23, 8, 32, 38, 1, 21,
+ 40, 31, 10, 34, 22, 28, 36,
+ 2, 11, 26, 29, 20, 19, 18,
+ 12, 9, 24, 16, 15, 6, 39,
+ };
public static void Load() {
List<StringNames> longlist = Enumerable.ToList<StringNames>(Palette.ColorNames);
List<Color32> colorlist = Enumerable.ToList<Color32>(Palette.PlayerColors);
List<CustomColor> colors = new List<CustomColor>();
- /* Custom Colors */
- colors.Add(new CustomColor { longname = "Salmon",
- color = new Color32(239, 191, 192, byte.MaxValue), // color = new Color32(0xD8, 0x82, 0x83, byte.MaxValue),
- shadow = new Color32(182, 119, 114, byte.MaxValue), // shadow = new Color32(0xA5, 0x63, 0x65, byte.MaxValue),
- isLighterColor = true });
- colors.Add(new CustomColor { longname = "Bordeaux",
- color = new Color32(109, 7, 26, byte.MaxValue),
- shadow = new Color32(54, 2, 11, byte.MaxValue),
- isLighterColor = false });
+ /* Custom Colors, starting with id (for ORDER) 18 */
+ colors.Add(new CustomColor {
+ longname = "Tamarind", //18
+ color = new Color32(48, 28, 34, byte.MaxValue),
+ shadow = new Color32(30, 11, 16, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor {
+ longname = "Army", // 19
+ color = new Color32(39, 45, 31, byte.MaxValue),
+ shadow = new Color32(11, 30, 24, byte.MaxValue),
+ isLighterColor = false });
+ // 20
colors.Add(new CustomColor { longname = "Olive",
color = new Color32(154, 140, 61, byte.MaxValue),
shadow = new Color32(104, 95, 40, byte.MaxValue),
- isLighterColor = false });
- colors.Add(new CustomColor { longname = "Turqoise",
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Turquoise",
color = new Color32(22, 132, 176, byte.MaxValue),
shadow = new Color32(15, 89, 117, byte.MaxValue),
isLighterColor = false });
color = new Color32(160, 101, 56, byte.MaxValue),
shadow = new Color32(115, 15, 78, byte.MaxValue),
isLighterColor = false });
+ // 25
colors.Add(new CustomColor { longname = "Peach",
color = new Color32(255, 164, 119, byte.MaxValue),
shadow = new Color32(238, 128, 100, byte.MaxValue),
color = new Color32(0xDB, 0xFD, 0x2F, byte.MaxValue),
shadow = new Color32(0x74, 0xE5, 0x10, byte.MaxValue),
isLighterColor = true });
+ // 30
colors.Add(new CustomColor { longname = "Signal\nOrange",
color = new Color32(0xF7, 0x44, 0x17, byte.MaxValue),
shadow = new Color32(0x9B, 0x2E, 0x0F, byte.MaxValue),
isLighterColor = true });
-
colors.Add(new CustomColor { longname = "Teal",
color = new Color32(0x25, 0xB8, 0xBF, byte.MaxValue),
shadow = new Color32(0x12, 0x89, 0x86, byte.MaxValue),
- isLighterColor = false });
+ isLighterColor = true });
colors.Add(new CustomColor { longname = "Blurple",
- color = new Color32(0x59, 0x3C, 0xD6, byte.MaxValue),
- shadow = new Color32(0x29, 0x17, 0x96, byte.MaxValue),
+ color = new Color32(61, 44, 142, byte.MaxValue),
+ shadow = new Color32(25, 14, 90, byte.MaxValue),
isLighterColor = false });
colors.Add(new CustomColor { longname = "Sunrise",
color = new Color32(0xFF, 0xCA, 0x19, byte.MaxValue),
shadow = new Color32(0xDB, 0x44, 0x42, byte.MaxValue),
isLighterColor = true });
-
colors.Add(new CustomColor { longname = "Ice",
color = new Color32(0xA8, 0xDF, 0xFF, byte.MaxValue),
shadow = new Color32(0x59, 0x9F, 0xC8, byte.MaxValue),
- isLighterColor = true });
-
+ isLighterColor = true });
+ // 35
+ colors.Add(new CustomColor { longname = "Fuchsia", //35 Color Credit: LaikosVK
+ color = new Color32(164, 17, 129, byte.MaxValue),
+ shadow = new Color32(104, 3, 79, byte.MaxValue),
+ isLighterColor = false
+ });
+ colors.Add(new CustomColor { longname = "Royal\nGreen", //36
+ color = new Color32(9, 82, 33, byte.MaxValue),
+ shadow = new Color32(0, 46, 8, byte.MaxValue),
+ isLighterColor = false
+ });
+ colors.Add(new CustomColor { longname = "Slime",
+ color = new Color32(244, 255, 188, byte.MaxValue),
+ shadow = new Color32(167, 239, 112, byte.MaxValue),
+ isLighterColor = false
+ });
+ colors.Add(new CustomColor { longname = "Navy", //38
+ color = new Color32(9, 43, 119, byte.MaxValue),
+ shadow = new Color32(0, 13, 56, byte.MaxValue),
+ isLighterColor = false
+ });
+ colors.Add(new CustomColor { longname = "Darkness", //39
+ color = new Color32(36, 39, 40, byte.MaxValue),
+ shadow = new Color32(10, 10, 10, byte.MaxValue),
+ isLighterColor = false
+ });
+ colors.Add(new CustomColor {
+ longname = "Ocean", //40
+ color = new Color32(55, 159, 218, byte.MaxValue),
+ shadow = new Color32(62, 92, 158, byte.MaxValue),
+ isLighterColor = false
+ });
+ colors.Add(new CustomColor {
+ longname = "Sundown", // 41
+ color = new Color32(252, 194, 100, byte.MaxValue),
+ shadow = new Color32(197, 98, 54, byte.MaxValue),
+ isLighterColor = false
+ });
pickableColors += (uint)colors.Count; // Colors to show in Tab
/** Hidden Colors **/
/** Add Colors **/
int id = 50000;
+ foreach (var c in Palette.PlayerColors) {
+ TheOtherRolesPlugin.Logger.LogMessage(c);
+ }
foreach (CustomColor cc in colors) {
longlist.Add((StringNames)id);
CustomColors.ColorStrings[id++] = cc.longname;
colorlist.Add(cc.color);
+ TheOtherRolesPlugin.Logger.LogMessage(cc.color);
shadowlist.Add(cc.shadow);
if (cc.isLighterColor)
lighterColors.Add(colorlist.Count - 1);
}
+
Palette.ColorNames = longlist.ToArray();
Palette.PlayerColors = colorlist.ToArray();
public static void Postfix(PlayerTab __instance) { // Replace instead
Il2CppArrayBase<ColorChip> chips = __instance.ColorChips.ToArray();
- int cols = 5; // TODO: Design an algorithm to dynamically position chips to optimally fill space
+ int cols = 7; // TODO: Design an algorithm to dynamically position chips to optimally fill space
for (int i = 0; i < ORDER.Count; i++) {
int pos = ORDER[i];
if (pos < 0 || pos > chips.Length)
continue;
ColorChip chip = chips[pos];
int row = i / cols, col = i % cols; // Dynamically do the positioning
- chip.transform.localPosition = new Vector3(-0.975f + (col * 0.485f), 1.475f - (row * 0.49f), chip.transform.localPosition.z);
- chip.transform.localScale *= 0.78f;
+ chip.transform.localPosition = new Vector3(-0.975f + (col * 0.5f), 1.475f - (row * 0.5f), chip.transform.localPosition.z);
+ chip.transform.localScale *= 0.76f;
}
for (int j = ORDER.Count; j < chips.Length; j++) { // If number isn't in order, hide it
ColorChip chip = chips[j];
using HarmonyLib;
using System;
+using System.Collections.Generic;
+using System.Net.Http;
+using System.Threading.Tasks;
using TheOtherRoles;
using TheOtherRoles.CustomGameModes;
using TheOtherRoles.Players;
public static Sprite horseBannerSprite;
public static Sprite banner2Sprite;
private static PingTracker instance;
+
+ public static GameObject motdObject;
+ public static TextMeshPro motdText;
+
static void Postfix(PingTracker __instance) {
var torLogo = new GameObject("bannerLogo_TOR");
torLogo.transform.SetParent(GameObject.Find("RightPanel").transform, false);
credentials.fontSize *= 0.05f;
credentials.transform.SetParent(torLogo.transform);
- credentials.transform.localPosition = Vector3.down * 2;
+ credentials.transform.localPosition = Vector3.down * 1.25f;
+ motdObject = new GameObject("torMOTD");
+ motdText = motdObject.AddComponent<TextMeshPro>();
+ motdText.alignment = TMPro.TextAlignmentOptions.Center;
+ motdText.fontSize *= 0.04f;
+
+ motdText.transform.SetParent(torLogo.transform);
+ motdText.enableWordWrapping = true;
+ var rect = motdText.gameObject.GetComponent<RectTransform>();
+ rect.sizeDelta = new Vector2(5.2f, 0.25f);
+
+ motdText.transform.localPosition = Vector3.down * 2.25f;
+ motdText.color = new Color(1, 53f / 255, 31f / 255);
+ Material mat = motdText.fontSharedMaterial;
+ mat.shaderKeywords = new string[] { "OUTLINE_ON" };
+ motdText.SetOutlineColor(Color.white);
+ motdText.SetOutlineThickness(0.025f);
}
public static void loadSprites() {
}
}
}
+
+ [HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.LateUpdate))]
+ public static class MOTD {
+ public static List<string> motds = new List<string>();
+ private static float timer = 0f;
+ private static float maxTimer = 5f;
+ private static int currentIndex = 0;
+
+ public static void Postfix() {
+ if (motds.Count == 0) {
+ timer = maxTimer;
+ return;
+ }
+ if (motds.Count > currentIndex && LogoPatch.motdText != null)
+ LogoPatch.motdText.SetText(motds[currentIndex]);
+ else return;
+
+ // fade in and out:
+ float alpha = Mathf.Clamp01(Mathf.Min(new float[] { timer, maxTimer - timer }));
+ if (motds.Count == 1) alpha = 1;
+ LogoPatch.motdText.color = LogoPatch.motdText.color.SetAlpha(alpha);
+ timer -= Time.deltaTime;
+ if (timer <= 0) {
+ timer = maxTimer;
+ currentIndex = (currentIndex + 1) % motds.Count;
+ }
+ }
+
+ public static async Task loadMOTDs() {
+ HttpClient client = new HttpClient();
+ HttpResponseMessage response = await client.GetAsync("https://raw.githubusercontent.com/TheOtherRolesAU/MOTD/main/motd.txt");
+ response.EnsureSuccessStatusCode();
+ string motds = await response.Content.ReadAsStringAsync();
+ foreach(string line in motds.Split("\n", StringSplitOptions.RemoveEmptyEntries)) {
+ MOTD.motds.Add(line);
+ }
+ }
+ }
}
}