Exemplo n.º 1
0
    public void Populate()
    {
        this.Clear();
        List <RPOSWindow> rPOSWindows = new List <RPOSWindow>(RPOS.GetBumperWindowList());
        int count = rPOSWindows.Count;

        for (int i = 0; i < count; i++)
        {
            if (!rPOSWindows[i] || string.IsNullOrEmpty(rPOSWindows[i].title))
            {
                int num = i;
                i = num - 1;
                rPOSWindows.RemoveAt(num);
                count--;
            }
            else
            {
                rPOSWindows[i].EnsureAwake <RPOSWindow>();
            }
        }
        Vector3 vector3 = this.buttonPrefab.gameObject.transform.localScale;
        float   single  = 75f * vector3.x;
        float   single1 = 5f;
        float   single2 = (float)count * single * -0.5f;
        int     num1    = 0;

        if (this.instances == null)
        {
            this.instances = new HashSet <RPOSBumper.Instance>();
        }
        foreach (RPOSWindow rPOSWindow in rPOSWindows)
        {
            RPOSBumper.Instance instance = new RPOSBumper.Instance()
            {
                window = rPOSWindow
            };
            Vector3    vector31   = this.buttonPrefab.gameObject.transform.localScale;
            GameObject gameObject = NGUITools.AddChild(base.gameObject, this.buttonPrefab.gameObject);
            instance.label      = gameObject.gameObject.GetComponentInChildren <UILabel>();
            instance.label.name = string.Concat(rPOSWindow.title, "BumperButton");
            Vector3 vector32 = gameObject.transform.localPosition;
            vector32.x = single2 + (single + single1) * (float)num1;
            gameObject.transform.localPosition = vector32;
            gameObject.transform.localScale    = vector31;
            instance.button = gameObject.GetComponentInChildren <UIButton>();
            instance.bumper = this;
            rPOSWindow.AddBumper(instance);
            this.instances.Add(instance);
            num1++;
        }
        Vector3 vector33 = this.background.transform.localScale;

        vector33.x = (float)count * single + ((float)count - 1f * single1);
        this.background.gameObject.transform.localScale = vector33;
        Transform transforms = this.background.gameObject.transform;
        Vector3   vector34   = base.transform.localPosition;

        transforms.localPosition = new Vector3(vector33.x * -0.5f, vector34.y, 0f);
    }
Exemplo n.º 2
0
 public void Populate()
 {
     this.Clear();
     List<RPOSWindow> rPOSWindows = new List<RPOSWindow>(RPOS.GetBumperWindowList());
     int count = rPOSWindows.Count;
     for (int i = 0; i < count; i++)
     {
         if (!rPOSWindows[i] || string.IsNullOrEmpty(rPOSWindows[i].title))
         {
             int num = i;
             i = num - 1;
             rPOSWindows.RemoveAt(num);
             count--;
         }
         else
         {
             rPOSWindows[i].EnsureAwake<RPOSWindow>();
         }
     }
     Vector3 vector3 = this.buttonPrefab.gameObject.transform.localScale;
     float single = 75f * vector3.x;
     float single1 = 5f;
     float single2 = (float)count * single * -0.5f;
     int num1 = 0;
     if (this.instances == null)
     {
         this.instances = new HashSet<RPOSBumper.Instance>();
     }
     foreach (RPOSWindow rPOSWindow in rPOSWindows)
     {
         RPOSBumper.Instance instance = new RPOSBumper.Instance()
         {
             window = rPOSWindow
         };
         Vector3 vector31 = this.buttonPrefab.gameObject.transform.localScale;
         GameObject gameObject = NGUITools.AddChild(base.gameObject, this.buttonPrefab.gameObject);
         instance.label = gameObject.gameObject.GetComponentInChildren<UILabel>();
         instance.label.name = string.Concat(rPOSWindow.title, "BumperButton");
         Vector3 vector32 = gameObject.transform.localPosition;
         vector32.x = single2 + (single + single1) * (float)num1;
         gameObject.transform.localPosition = vector32;
         gameObject.transform.localScale = vector31;
         instance.button = gameObject.GetComponentInChildren<UIButton>();
         instance.bumper = this;
         rPOSWindow.AddBumper(instance);
         this.instances.Add(instance);
         num1++;
     }
     Vector3 vector33 = this.background.transform.localScale;
     vector33.x = (float)count * single + ((float)count - 1f * single1);
     this.background.gameObject.transform.localScale = vector33;
     Transform transforms = this.background.gameObject.transform;
     Vector3 vector34 = base.transform.localPosition;
     transforms.localPosition = new Vector3(vector33.x * -0.5f, vector34.y, 0f);
 }
Exemplo n.º 3
0
 internal void RemoveBumper(RPOSBumper.Instance inst)
 {
     if ((this.bumpers != null) && this.bumpers.Remove(inst))
     {
         UIEventListener listener = inst.listener;
         if (listener != null)
         {
             listener.onClick = (UIEventListener.VoidDelegate)Delegate.Remove(listener.onClick, this.buttonCallback);
         }
     }
 }
Exemplo n.º 4
0
 protected virtual void OnBumperClick(RPOSBumper.Instance bumper)
 {
     if (!this.bumpersDisabled)
     {
         this.showWithRPOS = !this.showWithRPOS;
         if (this._showWithRPOS)
         {
             this.BringToFront();
         }
     }
 }
Exemplo n.º 5
0
 internal void RemoveBumper(RPOSBumper.Instance inst)
 {
     if (this.bumpers != null && this.bumpers.Remove(inst))
     {
         UIEventListener uIEventListener = inst.listener;
         if (uIEventListener)
         {
             uIEventListener.onClick -= this.buttonCallback;
         }
     }
 }
Exemplo n.º 6
0
    internal void AddBumper(RPOSBumper.Instance inst)
    {
        inst.label.text = this.title;
        UIEventListener listener = inst.listener;

        if (listener != null)
        {
            listener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(listener.onClick, this.buttonCallback);
            if (this.bumpers == null)
            {
                this.bumpers = new System.Collections.Generic.List <RPOSBumper.Instance>();
            }
            this.bumpers.Add(inst);
        }
    }
Exemplo n.º 7
0
    internal void AddBumper(RPOSBumper.Instance inst)
    {
        inst.label.text = this.title;
        UIEventListener uIEventListener = inst.listener;

        if (uIEventListener)
        {
            uIEventListener.onClick += this.buttonCallback;
            if (this.bumpers == null)
            {
                this.bumpers = new List <RPOSBumper.Instance>();
            }
            this.bumpers.Add(inst);
        }
    }