Exemplo n.º 1
0
 public void RegisterClick(UINetworkButton btn)
 {
     m_NetworkButtonsClicked.Add(btn);
 }
Exemplo n.º 2
0
        public UINetworkButton CreateNetworkButtonWithCaption(uint id_0, uint id_1, int X, int Y, int Alpha, bool Disabled,
            string Caption, string StrID)
        {
            ulong ID = (ulong)(((ulong)id_0) << 32 | ((ulong)(id_1 >> 32)));
            MemoryStream TextureStream;
            Texture2D Texture;

            try
            {
                TextureStream = new MemoryStream(ContentManager.GetResourceFromLongID(ID));
                Texture = Texture2D.FromFile(m_ScreenMgr.GraphicsDevice, TextureStream/*, TCP*/);
            }
            catch (FAR3Exception)
            {
                TextureStream = new MemoryStream(ContentManager.GetResourceFromLongID(ID));
                Texture = Texture2D.FromFile(m_ScreenMgr.GraphicsDevice, TextureStream);
                TextureStream.Close();
            }

            //Why did some genius at Maxis decide it was 'ok' to operate with three masking colors?!!
            if (Alpha == 1)
                ManualTextureMask(ref Texture, new Color(255, 0, 255));
            else if (Alpha == 2)
                ManualTextureMask(ref Texture, new Color(254, 2, 254));
            else if (Alpha == 3)
                ManualTextureMask(ref Texture, new Color(255, 1, 255));

            UINetworkButton Btn = new UINetworkButton(X, Y, Texture, Caption, PlayerAccount.Client, this, StrID);

            m_NetUIElements.Add(Btn);

            return Btn;
        }