public UIFilteredConstructorList( int width, int height, Vector2 position, UIActionListener listener )
            : base(width, height, position)
        {
            player = Main.MainObject.GameManager.GameState.Player;
            inventarList = new UIList(260, height-40, new Vector2(0, 40), listener);

            Dictionary<int, int> tempDict = new Dictionary<int, int>();
            foreach (KeyValuePair<int, int> keyValuePair in player.Inventar)
            {
                if (Item.Get(keyValuePair.Key).GetType() != typeof(Munition) && Item.Get(keyValuePair.Key).GetType() != typeof(Powerup))
                {
                    tempDict[keyValuePair.Key] = keyValuePair.Value;
                }
            }

            var inventarTitel = new UIButton(250, 40, new Vector2(0,0), "Inventar");
            var filterTitel = new UIButton(120, 40, new Vector2(280, 0), "Filter") { BackgroundColor = Color.LightGray };

            Add(inventarTitel);
            Add(inventarList);
            Add(filterTitel);

            inventarList.SetItems(tempDict);
            CreateCheckBoxPanel();
        }
Esempio n. 2
0
        public UIList( int width, int height, Vector2 position, UIActionListener listener )
            : base(width, height, position)
        {
            itemList = new Dictionary<int, int>();
            buttonList = new List<UIElement>();
            countItemsDict = new Dictionary<int, int>();

            unscaledWidth = width;
            unscaledHeight = height;
            unscaledPos = position;

            var imgPreviousButton = Main.ContentManager.Load<Texture2D>( "images/gui/inventar/list_previous" );
            var imgPreviousButtonHover = Main.ContentManager.Load<Texture2D>( "images/gui/inventar/list_previous_h" );

            var imgNextButton = Main.ContentManager.Load<Texture2D>( "images/gui/inventar/list_next" );
            var imgNextButtonHover = Main.ContentManager.Load<Texture2D>( "images/gui/inventar/list_next_h" );

            btnPrevious = new UIButton(unscaledWidth, imgPreviousButton.Height, new Vector2(0, 0), imgPreviousButton, imgPreviousButtonHover, "");
            btnNext = new UIButton(unscaledWidth, imgNextButton.Height, new Vector2(0, height - imgNextButton.Height), imgNextButton, imgNextButtonHover, "");

            this.listener = listener;

            int listHeight = height - imgNextButton.Height*2;
            MAX_VISIBLE_BUTTON_COUNT = (listHeight - listHeight % DEFAULT_HEIGHT) / DEFAULT_HEIGHT;

            player = Main.MainObject.GameManager.GameState.Player;

            btnPrevious.AddActionListener( this );
            btnNext.AddActionListener( this );
        }
Esempio n. 3
0
    void Awake()
    {
        UIActionListener listener = GetComponentInParent <UIActionListener>();

        if (listener.gameObject != gameObject)
        {
            m_listener = listener;
        }
    }
Esempio n. 4
0
        public UIFilteredInventarList( int width, int height, Vector2 position, UIActionListener listener )
            : base(width, height, position)
        {
            unscaledWidth = width;
            unscaledHeight = height;
            unscaledPos = position;

            player = Main.MainObject.GameManager.GameState.Player;
            inventarList = new UIList( 260, 236, new Vector2( 0, 0 ), listener );
            inventarList.AddItemList( player.Inventar );

            Add( inventarList );
            CreateCheckBoxPanel();
            GenerateFilteredLists( player.Inventar );
        }
Esempio n. 5
0
        public UIConstructionPanel(int width, int height, Vector2 position, UIActionListener listener)
            : base(width, height, position)
        {
            this.listener = listener;
            initWidth = width;
            initHeigth = height;

            player = Main.MainObject.GameManager.GameState.Player;

            InitComponents();
            NameIsActive = false;

            rateOfFire = "Feuerate : ";
            demage = "Schaden : ";
            accuracy = "Genauigkeit : ";
        }
Esempio n. 6
0
 public void RemoveActionListener( UIActionListener al )
 {
     actionListener.Remove( al );
 }
Esempio n. 7
0
 public void AddActionListener( UIActionListener l )
 {
     actionListener.Add( l );
 }
Esempio n. 8
0
 public void SetEventListener(UIActionListener listener)
 {
     m_listener = listener;
 }
Esempio n. 9
0
 public void AddActioinListener( UIActionListener l )
 {
     foreach ( UIListButton button in buttonList )
     {
         button.AddActionListener( l );
     }
 }