Exemplo n.º 1
0
    public void SetBtnNormalState(int _slotIndex, int _heroID)
    {
        if (!Value.IsValueValid(TFrame))
        {
            return;
        }

        int LSelectBtnGroupLength = TFrame.GetMember("LHeroPortraitBtnGroupLength");
        int SlotIndex             = _slotIndex % LSelectBtnGroupLength;

        // 函数ChangeHeroBtn 暂时设置为0 之后修改

        if (PlayerLoginData.playercnt == 0)
        {
            Trace.LogWarning("SetBtnNormalState PlayerLoginData.playercnt = " + PlayerLoginData.playercnt);
            return;
        }
        int pID = (int)PlayerLoginData.players[0].pid;

        if (TFrame.Invoke("ChangeHeroBtn", _slotIndex, pID, _heroID, false, true) == null)
        {
            Trace.LogError("call ChangeHeroBtn failded");
            return;
        }
    }
Exemplo n.º 2
0
 protected byte[] Write(TFrame frame)
 {
     using (var memoryStream = new MemoryStream())
     {
         var binaryWriter = new BinaryWriter(memoryStream);
         frame.Write(binaryWriter);
         return(memoryStream.ToArray());
     }
 }
Exemplo n.º 3
0
 public void RecordHandler(object sender, TFrame frame)
 {
     if (_recording)
     {
         _writer.Write((int)frame.GetFameType());
         frame.Write(_writer);
         _writer.Flush();
     }
 }
Exemplo n.º 4
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------

    public TPAtlasTexture(string _name, IDictionary <string, System.Object> frameData, TPAtlas _atlas)
    {
        name = _name;

        if (name.Length > 4 && name.Contains("."))
        {
            nameNoExtention = name.Substring(0, name.Length - 4);
        }

        foreach (string cKey in frameData.Keys)
        {
            switch (cKey)
            {
            case "frame":
                _frame = new TFrame(frameData[cKey] as IDictionary <string, System.Object>);
                break;

            case "sourceSize":
                _sourceSize = new TSourceSize(frameData[cKey] as IDictionary <string, System.Object>);
                break;

            case "spriteSourceSize":
                _spriteSourceSize = new TFrame(frameData[cKey] as IDictionary <string, System.Object>);
                break;

            case "trimmed":
                _trimmed = System.Boolean.Parse(frameData[cKey].ToString());
                break;

            case "rotated":
                _rotated = System.Boolean.Parse(frameData[cKey].ToString());
                break;
            }
        }

        _scale = _atlas.meta.scale;;

        _width  = (float)_sourceSize.w / _scale;
        _height = (float)_sourceSize.h / _scale;

        atlas = _atlas;
        calculateVars();
    }
Exemplo n.º 5
0
    public void SetHeroHeadSlotInfo(cmd_match_room_hero_slot _data)
    {
        //int LSelectBtnGroupLength = this.TLFrame.GetMember("LHeroPortraitBtnGroupLength");
        //Value tmpTopFrame = _data.nSlotIndex / LSelectBtnGroupLength < 1 ? TLFrame : TRFrame;
        if (!Value.IsValueValid(TFrame))
        {
            return;
        }

        int LSelectBtnGroupLength = TFrame.GetMember("LHeroPortraitBtnGroupLength");

        int  SlotIndex = _data.nSlotIndex % LSelectBtnGroupLength;
        bool bIsLock   = Convert.ToBoolean(_data.bIsLock);

        if (TFrame.Invoke("ChangeHeroBtn", SlotIndex, _data.nHeroID, bIsLock, false, _data.szHeroTooltip) == null)
        {
            Trace.LogError("call ChangeHeroBtn failded");
            return;
        }

        HeroPortraitTable.Add(_data.nSlotIndex, _data.nHeroID);
    }
Exemplo n.º 6
0
    private void SetHeroHeadSlot()
    {
        //HeroPortraitTable.Clear();
        if (!Value.IsValueValid(TFrame))
        {
            return;
        }

        for (int i = 0; i < PlayerLoginData.playercnt; i++)
        {
            int pID = (int)PlayerLoginData.players[i].pid;
            if (TFrame.Invoke("ChangeHeroBtn", i, pID, PlayerLoginData.players[i].heroid, false, false, "") == null)
            {
                Trace.LogError("call ChangeHeroBtn failded");
                return;
            }

            if (!HeroPortraitTable.Contains(i))
            {
                HeroPortraitTable.Add(i, PlayerLoginData.players[i].skinid);
            }
        }
    }
 WhenViewChangedToNull <TFrame>(this TFrame source) where TFrame : Frame
Exemplo n.º 8
0
 public static IObservable <(TFrame frame, ViewChangedEventArgs args)> WhenViewChanged <TFrame>(this TFrame source) where TFrame : Frame
Exemplo n.º 9
0
        // -------------------------------------------
        // ----  Notifications
        // -------------------------------------------

        public void HandleEmailAlerts(State.Value value)
        {
            var keyName = "HKEY_CURRENT_USER\\ScreenerEmailNotificationsState";
            var subkey  = String.Format("{0}-{1}", value.GetKey(), this.TFrame);

            if (value.IsZero())
            {
                Registry.SetValue(keyName, subkey, 0);
            }
            else
            {
                var candidate = (int)Registry.GetValue(keyName, subkey, 0);

                var from = "*****@*****.**";
                var to   = "*****@*****.**";

                if ((value.Val > candidate && candidate >= 0) || (value.Val < candidate && candidate <= 0))
                {
                    Registry.SetValue(keyName, subkey, value.Val);

                    var tradeType = value.GetTradeType().ToString();
                    var subject   = String.Format("Trade oportunity: {0} {1} {2}/{3} - Punctuation: {4} ", value.Name, tradeType, value.Symbol, TFrame.AsString(), value.Val);

                    Notifications.SendEmail(from, to, subject, "");
                }
            }
        }
Exemplo n.º 10
0
this TFrame source) where TFrame : Frame
Exemplo n.º 11
0
 /// <summary>
 /// Draws the widget to the current frame of the Graphics object
 /// </summary>
 /// <param name="g">The Graphics to draw to</param>
 public virtual void Draw(CompactGraphics g)
 {
     g.Draw(rendered, Bounds.x1, Bounds.y1);
     rendered = new TFrame(Bounds.x2 - Bounds.x1, Bounds.y2 - Bounds.y1);
 }