using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NameAndPronounsForWeapons")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Weapon Pronouns")]
[assembly: AssemblyTitle("NameAndPronounsForWeapons")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace NameAndPronounsForWeapons
{
public static class NPWConfig
{
[CompilerGenerated]
private static class <>O
{
public static OnClick <0>__UpdatePools;
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static OnClick <>9__13_0;
internal void <Init>b__13_0()
{
Application.OpenURL(imgFolder);
}
}
private static PluginConfigurator config;
public static BoolField wrappingEnabled;
public static ColorField textCol;
public static ColorField outCol;
public static FloatSliderField outWidth;
public static FloatSliderField imageAlpha;
public static ButtonField refreshImages;
public static Dictionary<string, StringField[]> weaponPairs = new Dictionary<string, StringField[]>();
private static string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
private static string gameDirectory = Path.GetDirectoryName(new DirectoryInfo(directory).Parent.Parent.FullName);
public static string imgFolder;
private static ConfigPanel currentPanel;
private static void AddWeaponField(string imgName, string varName, string fieldName, string defName, string defPronoun = "", string defGender = "", string defSexuality = "")
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Expected O, but got Unknown
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Expected O, but got Unknown
StringField val = new StringField(currentPanel, varName + " Name", fieldName + "N", defName, false);
StringField val2 = new StringField(currentPanel, "- Pronouns", fieldName + "P", defPronoun, true);
StringField val3 = new StringField(currentPanel, "- Gender", fieldName + "G", defGender, true);
StringField val4 = new StringField(currentPanel, "- Sexuality", fieldName + "S", defSexuality, true);
weaponPairs.Add(imgName, (StringField[])(object)new StringField[4] { val, val2, val3, val4 });
}
public static void Init()
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Expected O, but got Unknown
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Expected O, but got Unknown
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Expected O, but got Unknown
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Expected O, but got Unknown
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Expected O, but got Unknown
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01a9: Expected O, but got Unknown
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Expected O, but got Unknown
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Expected O, but got Unknown
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Expected O, but got Unknown
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_0286: Expected O, but got Unknown
//IL_0309: Unknown result type (might be due to invalid IL or missing references)
//IL_0310: Expected O, but got Unknown
//IL_0393: Unknown result type (might be due to invalid IL or missing references)
//IL_039a: Expected O, but got Unknown
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_0424: Expected O, but got Unknown
//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
//IL_04ae: Expected O, but got Unknown
//IL_0531: Unknown result type (might be due to invalid IL or missing references)
//IL_0538: Expected O, but got Unknown
//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
//IL_05c2: Expected O, but got Unknown
//IL_0645: Unknown result type (might be due to invalid IL or missing references)
//IL_064c: Expected O, but got Unknown
//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
//IL_06ff: Expected O, but got Unknown
//IL_0739: Unknown result type (might be due to invalid IL or missing references)
//IL_0740: Expected O, but got Unknown
//IL_0754: Unknown result type (might be due to invalid IL or missing references)
//IL_075b: Expected O, but got Unknown
//IL_076b: Unknown result type (might be due to invalid IL or missing references)
//IL_0772: Expected O, but got Unknown
//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
//IL_07d4: Expected O, but got Unknown
//IL_082f: Unknown result type (might be due to invalid IL or missing references)
//IL_0836: Expected O, but got Unknown
//IL_0891: Unknown result type (might be due to invalid IL or missing references)
//IL_0898: Expected O, but got Unknown
//IL_08f3: Unknown result type (might be due to invalid IL or missing references)
//IL_08fa: Expected O, but got Unknown
//IL_0960: Unknown result type (might be due to invalid IL or missing references)
//IL_0967: Expected O, but got Unknown
//IL_0977: Unknown result type (might be due to invalid IL or missing references)
//IL_097e: Expected O, but got Unknown
//IL_0a02: Unknown result type (might be due to invalid IL or missing references)
//IL_0a09: Expected O, but got Unknown
//IL_0a64: Unknown result type (might be due to invalid IL or missing references)
//IL_0a6b: Expected O, but got Unknown
//IL_0ac6: Unknown result type (might be due to invalid IL or missing references)
//IL_0acd: Expected O, but got Unknown
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Expected O, but got Unknown
config = PluginConfigurator.Create("Weapon Pronouns", "NameAndPronounsForWeapons");
config.SetIconWithURL("file://" + Path.Combine(directory, "icon.png"));
Directory.CreateDirectory(Path.Combine(gameDirectory, "NPWBackgrounds"));
imgFolder = Path.Combine(gameDirectory, "NPWBackgrounds");
wrappingEnabled = new BoolField(config.rootPanel, "Weapon Name Wrapping", "wrapping", false);
textCol = new ColorField(config.rootPanel, "Text Color", "col", new Color(1f, 1f, 1f));
outCol = new ColorField(config.rootPanel, "Text Outline Color", "outCol", new Color(0f, 0f, 0f));
outWidth = new FloatSliderField(config.rootPanel, "Text Outline Width", "outWidth", new Tuple<float, float>(0f, 1f), 0.12f, 2);
imageAlpha = new FloatSliderField(config.rootPanel, "Background Alpha", "alpha", new Tuple<float, float>(0f, 1f), 0.5f, 1);
ButtonField val = new ButtonField(config.rootPanel, "Open Backgrounds Folder", "bkfolder");
object obj = <>c.<>9__13_0;
if (obj == null)
{
OnClick val2 = delegate
{
Application.OpenURL(imgFolder);
};
<>c.<>9__13_0 = val2;
obj = (object)val2;
}
val.onClick += (OnClick)obj;
refreshImages = new ButtonField(config.rootPanel, "Refresh Background Images", "rfimages");
ButtonField obj2 = refreshImages;
object obj3 = <>O.<0>__UpdatePools;
if (obj3 == null)
{
OnClick val3 = Plugin.UpdatePools;
<>O.<0>__UpdatePools = val3;
obj3 = (object)val3;
}
obj2.onClick += (OnClick)obj3;
ConfigPanel val4 = (currentPanel = new ConfigPanel(config.rootPanel, "Base Game", "baseGame"));
ConfigHeader val5 = new ConfigHeader(val4, "Revolvers", 24);
AddWeaponField("SingleRevolver", "Piercer", "Rev1", "Steve", "He/Him");
AddWeaponField("RevolverSpecial", "Marksman", "Rev2", "Hazel", "She/They");
AddWeaponField("RevolverSharp", "Sharpshooter", "Rev3", "Serene", "She/Any", "Transfem", "Pretty Gay");
ConfigHeader val6 = new ConfigHeader(val4, "Shotguns", 24);
AddWeaponField("Shotgun", "Core Eject", "Sht1", "Gerald", "Male", "Man", "Straight");
AddWeaponField("Shotgun1", "Pump Charge", "Sht2", "Jade", "They/Them");
AddWeaponField("ShotgunSaw", "Sawed-On", "Sht3", "Noelle", "She/Her");
ConfigHeader val7 = new ConfigHeader(val4, "Nailguns", 24);
AddWeaponField("Nailgun2", "Attractor", "Nil1", "Hakita", "He/Him", "Masc", "Bisexual");
AddWeaponField("NailgunOverheat", "Overheat", "Nil2", "June", "She/They");
AddWeaponField("NailgunZapper", "Jumpstart", "Nil3", "Nova", "It/Its");
ConfigHeader val8 = new ConfigHeader(val4, "Railcannons", 24);
AddWeaponField("Railcannon", "Electric", "Rlc1", "PHthonOS", "They/Them");
AddWeaponField("railcannonscrew", "Screwdriver", "Rlc2", "Charm", "Any/All");
AddWeaponField("railcannonmalicious", "Malicious", "Rlc3", "Maurice", "It/He");
ConfigHeader val9 = new ConfigHeader(val4, "Rocket Launchers", 24);
AddWeaponField("rocketlauncher", "Freezeframe", "Rkt1", "Avi", "S/He");
AddWeaponField("rocketlaunchercannon", "S.R.S.", "Rkt2", "Sirius", "She/Fae");
AddWeaponField("rocketlaunchergasoline", "Firestarter", "Rkt3", "Ash", "Xey/Xem");
ConfigHeader val10 = new ConfigHeader(val4, "Slab Revolvers", 24);
AddWeaponField("RevolverAltSingle", "Piercer", "Slb1", "Alli", "She/Her", "Fem", "Ace Lesbian");
AddWeaponField("RevolverAltSpecial", "Marksman", "Slb2", "Saturday", "She/It", "Transfem", "Bisexual");
AddWeaponField("RevolverAltSharp", "Sharpshooter", "Slb3", "Dawn", "They/She", "Fem", "Sapphic");
ConfigHeader val11 = new ConfigHeader(val4, "Impact Hammers", 24);
AddWeaponField("Hammer", "Core Eject", "Hmr1", "Hailey", "It/She", "Transfem Catgender", "Sapphic");
AddWeaponField("HammerPump", "Pump Charge", "Hmr2", "Broccolite", "He/Him");
AddWeaponField("HammerSaw", "Sawed-On", "Hmr3", "Impact Hammer; Sawed-On");
ConfigHeader val12 = new ConfigHeader(val4, "Sawblade Launchers", 24);
AddWeaponField("SawbladeLauncher", "Attractor", "Saw1", "Yuri", "Mirror");
AddWeaponField("SawbladeLauncherOverheat", "Overheat", "Saw2", "Iota", "She/They/He");
AddWeaponField("SawbladeLauncherZapper", "Jumpstart", "Saw3", "Z.", "None");
ConfigHeader val13 = new ConfigHeader(val4, "Spawner Arms", 24);
AddWeaponField("SpawnerArm0", "Move", "Spw1", "Axis", "Xe/Ze");
AddWeaponField("SpawnerArm1", "Alter", "Spw2", "Obsidian", "Any Neopronouns");
AddWeaponField("SpawnerArm2", "Destroy", "Spw3", "[DELETED]", "oops");
AddWeaponField("SpawnerArm3", "Prop", "Spw4", "Laef", "She/None");
ConfigHeader val14 = new ConfigHeader(val4, "Other", 24);
AddWeaponField("questionMark", "Cut Weapon", "Cut", "Quasar/Cass", "He/Her/Any");
ConfigHeader val15 = new ConfigHeader(config.rootPanel, "-- Other Mods --", 24);
ConfigPanel val16 = (currentPanel = new ConfigPanel(config.rootPanel, "Straymode", "stray"));
ConfigHeader val17 = new ConfigHeader(val16, "Stray Arms", 24);
AddWeaponField("weapon_2", "Piercing", "Srm1", "Tsuki", "She/Her");
AddWeaponField("weapon_2_shock", "Reflector", "Srm2", "Chiyo", "She/They");
ConfigHeader val18 = new ConfigHeader(val16, "Machine Shotguns", 24);
AddWeaponField("weapon1_alt", "Energy Grenade", "Mch1", "Mazuat", "He/They");
AddWeaponField("weapon1_alt shock", "Overcharge", "Mch2", "W.D. Gaster", "He/Him");
ConfigHeader val19 = new ConfigHeader(val16, "Swords", 24);
AddWeaponField("weapon_3", "Chainsword", "Swd1", "Sage", "She/They/Any");
AddWeaponField("weapon_3_tele", "Telefrag", "Swd2", "Xaydden", "They/Them");
ConfigHeader val20 = new ConfigHeader(val16, "Displacement Cannons", 24);
AddWeaponField("big_gun_thing_icon", "V.D.C Config", "Big1", "NinDragon471", "She/They");
AddWeaponField("big_gun_thing_icon_v2", "M.D.C Config", "Big2", "woooowoooo", "He/They/Any");
ConfigHeader val21 = new ConfigHeader(val16, "Anchors", 24);
AddWeaponField("anchor_icon_2", "Freezeframe", "Anc1", "Foss", "He/They/Moon");
AddWeaponField("anchor_icon_2_v2", "S.C.S Anchor", "Anc2", "bromii", "Mirror");
ConfigPanel val22 = (currentPanel = new ConfigPanel(config.rootPanel, "Masquerade Divinity", "masq"));
ConfigHeader val23 = new ConfigHeader(val22, "Swords", 24);
AddWeaponField("Justice", "Justice", "SwdM1", "Justice", "She|Boat-wise");
AddWeaponField("Splendor", "Splendor", "SwdM2", "Splendor", "She|Car-wise");
AddWeaponField("Silence", "Silence", "SwdM3", "Silence", "She|Country-wise");
ConfigHeader val24 = new ConfigHeader(val22, "Crossbows", 24);
AddWeaponField("CrossbowIcon", "Magic Red", "Crs1", "Torch vs. Crossbow", "Dmg: 3", "Who Will Win?", "Flame Lifetime: 12");
AddWeaponField("CrossbowGreenIcon", "Glitterfreeze", "Crs2", "justatoadbb", "She|No They");
ConfigHeader val25 = new ConfigHeader(val22, "Daggers", 24);
AddWeaponField("DaggersIcon", "Orbit", "Dag1", "Mindcap", "And More");
AddWeaponField("DaggerBeamIcon", "Catchlight", "Dag2", "KP", "He/Him");
ConfigHeader val26 = new ConfigHeader(val22, "Greatswords", 24);
AddWeaponField("JusticeAlt", "Justice", "Grt1", "Storyteller", "She/They/It");
AddWeaponField("SplendorAlt", "Splendor", "Grt2", "Eri", "She/Her");
AddWeaponField("SilenceAlt", "Silence", "Grt3", "Tori", "She/Any");
}
}
[BepInPlugin("NameAndPronounsForWeapons", "Weapon Pronouns", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static class MethodPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(WeaponHUD), "UpdateImage")]
private static void UpdateImage(Sprite icon, Sprite glowIcon, int variation)
{
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)pronounText))
{
(pronounText, pronounBk, gsText) = InitText();
pronounBk.SetActive(false);
}
string key = ((Object)icon).name;
if (((Object)icon).name == "SpawnerArm")
{
int num = variation;
string text = num.ToString();
key = ((Object)icon).name + text;
}
if (!NPWConfig.weaponPairs.ContainsKey(key))
{
pronounText.GetComponent<TMP_Text>().text = "";
Logger.LogInfo((object)(((Object)icon).name + " / " + variation));
return;
}
if (imagePool.ContainsKey(NPWConfig.weaponPairs[key][0].value))
{
Image component = pronounBk.GetComponent<Image>();
component.sprite = imagePool[NPWConfig.weaponPairs[key][0].value];
Color color = ((Graphic)component).color;
color.a = NPWConfig.imageAlpha.value;
((Graphic)component).color = color;
pronounBk.SetActive(true);
}
else
{
pronounBk.SetActive(false);
}
if (NPWConfig.weaponPairs[key][1].value != "")
{
pronounText.GetComponent<TMP_Text>().text = NPWConfig.weaponPairs[key][0].value + " (" + NPWConfig.weaponPairs[key][1].value + ")";
}
else
{
pronounText.GetComponent<TMP_Text>().text = NPWConfig.weaponPairs[key][0].value ?? "";
}
if (NPWConfig.weaponPairs[key][3].value != "")
{
if (NPWConfig.weaponPairs[key][2].value != "")
{
gsText.GetComponent<TMP_Text>().text = NPWConfig.weaponPairs[key][2].value + ", " + NPWConfig.weaponPairs[key][3].value;
}
else
{
gsText.GetComponent<TMP_Text>().text = NPWConfig.weaponPairs[key][3].value ?? "";
}
}
else
{
gsText.GetComponent<TMP_Text>().text = NPWConfig.weaponPairs[key][2].value ?? "";
}
}
}
private static GameObject pronounText;
private static GameObject pronounBk;
private static GameObject gsText;
internal static ManualLogSource Logger;
public Harmony harm;
public static List<string> imageTypes = new List<string> { ".jpeg", ".jpg", ".png", ".bmp" };
public static Dictionary<string, Sprite> imagePool = new Dictionary<string, Sprite>();
public static string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
Logger.LogInfo((object)"Plugin NameAndPronounsForWeapons is loaded!");
Logger.LogInfo((object)"Ultrakill is woke now.");
}
private void Start()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
harm = new Harmony("NameAndPronounsForWeapons");
harm.PatchAll(typeof(MethodPatches));
NPWConfig.Init();
UpdatePools();
}
private static (GameObject text, GameObject img, GameObject gsText) InitText()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Expected O, but got Unknown
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Expected O, but got Unknown
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Expected O, but got Unknown
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_0233: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Expected O, but got Unknown
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02af: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_0310: Unknown result type (might be due to invalid IL or missing references)
//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
//IL_040f: Unknown result type (might be due to invalid IL or missing references)
//IL_0419: Expected O, but got Unknown
//IL_0426: Unknown result type (might be due to invalid IL or missing references)
//IL_0430: Expected O, but got Unknown
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_0447: Expected O, but got Unknown
//IL_0454: Unknown result type (might be due to invalid IL or missing references)
//IL_045e: Expected O, but got Unknown
//IL_0493: Unknown result type (might be due to invalid IL or missing references)
//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
GameObject gameObject = ((Component)HudController.Instance.weaponIcon.transform.parent).gameObject;
GameObject val = new GameObject("NameAndPronouns", new Type[2]
{
typeof(CanvasRenderer),
typeof(TextMeshProUGUI)
});
GameObject val2 = new GameObject("QuiteFondOfWomen", new Type[2]
{
typeof(CanvasRenderer),
typeof(TextMeshProUGUI)
});
GameObject val3 = new GameObject("PlusBackgroundToo", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
RectTransform component = val.GetComponent<RectTransform>();
RectTransform component2 = val2.GetComponent<RectTransform>();
TextMeshProUGUI textbox = val.GetComponent<TextMeshProUGUI>();
((TMP_Text)textbox).alignment = (TextAlignmentOptions)1028;
((Graphic)textbox).color = NPWConfig.textCol.value;
((TMP_Text)textbox).text = "Test!";
((TMP_Text)textbox).fontSize = 50f;
((TMP_Text)textbox).overflowMode = (TextOverflowModes)0;
((TMP_Text)textbox).enableWordWrapping = NPWConfig.wrappingEnabled.value;
((TMP_Text)textbox).font = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().First((TMP_FontAsset f) => ((Object)f).name == "VCR_OSD_MONO_1");
((TMP_Text)textbox).fontMaterial = HudController.Instance.overlayTextMaterial;
Material mat = ((TMP_Text)textbox).fontMaterial;
mat.EnableKeyword("OUTLINE_ON");
mat.SetFloat("_OutlineWidth", NPWConfig.outWidth.value);
mat.SetColor("_OutlineColor", NPWConfig.outCol.value);
((TMP_Text)textbox).UpdateMeshPadding();
val.transform.SetParent(gameObject.transform, false);
val.transform.localPosition = HudController.Instance.weaponIcon.transform.localPosition;
((Transform)component).localScale = Vector3.one;
component.anchoredPosition = Vector2.zero;
component.sizeDelta = new Vector2(500f, 100f);
RectTransform component3 = val3.GetComponent<RectTransform>();
Image img = val3.GetComponent<Image>();
img.sprite = null;
NPWConfig.imageAlpha.onValueChange += (OnValueChangeEventDelegate)delegate(FloatSliderValueChangeEvent e)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
Color color = ((Graphic)img).color;
color.a = e.newValue;
((Graphic)img).color = color;
};
val3.transform.SetParent(gameObject.transform, false);
val3.transform.localPosition = HudController.Instance.weaponIcon.transform.localPosition;
((Transform)component3).localScale = Vector3.one;
component3.anchoredPosition = new Vector2(-120f, 140f);
component3.sizeDelta = new Vector2(800f, 400f);
TextMeshProUGUI textbox2 = val2.GetComponent<TextMeshProUGUI>();
((TMP_Text)textbox2).alignment = (TextAlignmentOptions)257;
((Graphic)textbox2).color = NPWConfig.textCol.value;
((TMP_Text)textbox2).text = "Test!";
((TMP_Text)textbox2).fontSize = 50f;
((TMP_Text)textbox2).overflowMode = (TextOverflowModes)0;
((TMP_Text)textbox2).enableWordWrapping = NPWConfig.wrappingEnabled.value;
((TMP_Text)textbox2).font = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().First((TMP_FontAsset f) => ((Object)f).name == "VCR_OSD_MONO_1");
((TMP_Text)textbox2).fontMaterial = HudController.Instance.overlayTextMaterial;
Material mat2 = ((TMP_Text)textbox2).fontMaterial;
mat2.EnableKeyword("OUTLINE_ON");
mat2.SetFloat("_OutlineWidth", NPWConfig.outWidth.value);
mat2.SetColor("_OutlineColor", NPWConfig.outCol.value);
NPWConfig.textCol.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
((Graphic)textbox).color = e.value;
((Graphic)textbox2).color = e.value;
};
NPWConfig.wrappingEnabled.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
{
((TMP_Text)textbox).enableWordWrapping = e.value;
((TMP_Text)textbox2).enableWordWrapping = e.value;
};
NPWConfig.outCol.onValueChange += (ColorValueChangeEventDelegate)delegate(ColorValueChangeEvent e)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
mat.SetColor("_OutlineColor", e.value);
mat2.SetColor("_OutlineColor", e.value);
};
NPWConfig.outWidth.onValueChange += (OnValueChangeEventDelegate)delegate(FloatSliderValueChangeEvent e)
{
mat.SetFloat("_OutlineWidth", e.newValue);
mat2.SetFloat("_OutlineWidth", e.newValue);
};
((TMP_Text)textbox2).UpdateMeshPadding();
val2.transform.SetParent(gameObject.transform, false);
val2.transform.localPosition = HudController.Instance.weaponIcon.transform.localPosition;
((Transform)component2).localScale = Vector3.one;
component2.anchoredPosition = new Vector2(-120f, 140f);
component2.sizeDelta = new Vector2(750f, 385f);
return (val, val3, val2);
}
private static void OnSceneLoaded(Scene scene, Scene mode)
{
pronounText = null;
pronounBk.SetActive(false);
}
public static void UpdatePools()
{
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
Logger.LogInfo((object)"Loading images...");
imagePool = new Dictionary<string, Sprite>();
foreach (string item in Directory.EnumerateFiles(Path.Combine(NPWConfig.imgFolder)))
{
for (int i = 0; i < imageTypes.Count; i++)
{
if (string.Equals(imageTypes[i], Path.GetExtension(item), StringComparison.OrdinalIgnoreCase))
{
byte[] array = File.ReadAllBytes(item);
Texture2D val = new Texture2D(0, 0, (TextureFormat)4, false);
((Texture)val).filterMode = (FilterMode)0;
ImageConversion.LoadImage(val, array);
Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f));
((Object)val2).name = Path.GetFileNameWithoutExtension(item);
imagePool.Add(((Object)val2).name, val2);
Logger.LogInfo((object)("Loaded image " + ((Object)val2).name + " ^_^"));
break;
}
}
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "NameAndPronounsForWeapons";
public const string PLUGIN_NAME = "Weapon Pronouns";
public const string PLUGIN_VERSION = "1.0.0";
}
}