Ejemplo n.º 1
0
        public override void Load()
        {
            Harmony.PatchAll();

#if !S20210615 && !S20210630
            PluginSingleton <EssentialsPlugin> .Instance = this;

            RegisterInIl2CppAttribute.Register();
            RegisterCustomRpcAttribute.Register(this);
#endif

            ReactorVersionShower.TextUpdated += (text) =>
            {
#if S20201209 || S20210305 || S202103313
                string txt = text.Text;
#else
                string txt = text.text;
#endif

                int index = txt.IndexOf('\n');
                txt = txt.Insert(index == -1 ? txt.Length - 1 : index, "\nEssentials " + typeof(EssentialsPlugin).Assembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion);

#if S20201209 || S20210305 || S202103313
                text.Text = txt;
#else
                text.text = txt;
#endif
            };

            HudPosition.Load();
        }
Ejemplo n.º 2
0
        public ResolutionChangedEventArgs(int oldPixelWidth, int oldPixelHeight, float oldWidth, float oldHeight)
        {
            OldPixelWidth  = oldPixelWidth;
            OldPixelHeight = oldPixelHeight;

            OldWidth  = oldWidth;
            OldHeight = oldHeight;

            OldBottomLeft  = new Vector2(-OldWidth / 2, -OldHeight / 2);
            OldBottomRight = HudPosition.GetAlignedOffset(OldBottomLeft, HudAlignment.BottomRight);
            OldTopLeft     = HudPosition.GetAlignedOffset(OldBottomLeft, HudAlignment.TopLeft);
            OldTopRight    = HudPosition.GetAlignedOffset(OldBottomLeft, HudAlignment.TopRight);
            OldTop         = new Vector2(0, -OldBottomLeft.y);
            OldBottom      = new Vector2(0, OldBottomLeft.y);
            OldLeft        = new Vector2(OldBottomLeft.x, 0);
            OldRight       = new Vector2(-OldBottomLeft.x, 0);
        }
Ejemplo n.º 3
0
        public override void Load()
        {
            PluginSingleton <EssentialsPlugin> .Instance = this;

            Harmony.PatchAll();

            RegisterInIl2CppAttribute.Register();
            RegisterCustomRpcAttribute.Register(this);

            ReactorVersionShower.TextUpdated += (text) =>
            {
                int index = text.Text.IndexOf('\n');
                text.Text = text.Text.Insert(index == -1 ? text.Text.Length - 1 : index, "\nEssentials " + typeof(EssentialsPlugin).Assembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion);
            };

            HudPosition.Load();
        }