public void selectEvent(Button a_button) { foreach (Button t_button in m_events.Keys) { t_button.setState(Button.State.Normal); } a_button.setState(3); m_triggerButtons = new LinkedList<Button>(); m_effectButtons = new LinkedList<Button>(); m_selectedEvent = a_button; m_selectedEvent.setPosition(Vector2.Zero); foreach (EventTrigger t_trigger in m_events[a_button].getTriggers()) { m_triggerButtons.AddLast(new Button("btn_asset_list", new Vector2(m_btnAddTrigger.getBox().X, 40 + (m_triggerButtons.Count * 25)), t_trigger.ToString(), "VerdanaBold", Color.Yellow, new Vector2(10, 2))); m_triggerButtons.Last().m_clickEvent += new Button.clickDelegate(selectEffectTrigger); if (t_trigger is PlayerIsWithinRectangle) { m_recLines = ((PlayerIsWithinRectangle)t_trigger).getRectangle(); } } foreach (EventEffect t_effect in m_events[a_button].getEffects()) { m_effectButtons.AddLast(new Button("btn_asset_list", new Vector2(m_btnAddTrigger.getBox().X + m_btnAddEffect.getBox().Width + 40, 40 + (m_effectButtons.Count * 25)), t_effect.ToString(), "VerdanaBold", Color.Yellow, new Vector2(10, 2))); m_effectButtons.Last().m_clickEvent += new Button.clickDelegate(selectEffectTrigger); } if (m_triggerButtons.Count() > 0) { m_btnAddTrigger.setPosition(new Vector2(m_triggerButtons.Last().getBox().X, m_triggerButtons.Last().getBox().Y + 25)); } else { m_btnAddTrigger.setPosition(new Vector2(0, 40)); } if (m_effectButtons.Count() > 0) { m_btnAddEffect.setPosition(new Vector2(m_effectButtons.Last().getBox().X, m_effectButtons.Last().getBox().Y + 25)); } else { m_btnAddEffect.setPosition(new Vector2(m_btnAddTrigger.getBox().Width + 25, 40)); } }