/// <summary>
 /// Go down to Events in a state using arrow keys.
 /// </summary>
 private static void gotoEventsFromStateDown()
 {
     if (heroObject.states.states[stateID].heroEvent.Count > 0)
     {
         EventMenuBlock.showBlockContent(0, stateID);
     }
     else
     {
         gotoStateDown();
     }
 }
        /// <summary>
        /// Go up to Events in a state using arrow keys.
        /// </summary>
        private static void gotoEventsFromStateUp()
        {
            int count = heroObject.states.states[stateID - 1].heroEvent.Count;

            if (count > 0)
            {
                stateID--;
                eventID = count - 1;
                EventMenuBlock.showBlockContent(count - 1, stateID);
            }
            else
            {
                gotoStateUp();
            }
        }
        /// <summary>
        /// Go down to event X from last action in previous event.
        /// </summary>
        private static void gotoEventFromActionDown()
        {
            int eventCount = heroObject.states.states[stateID].heroEvent.Count;

            // go to next event
            if (eventID < eventCount - 1)
            {
                eventID++;
                EventMenuBlock.showBlockContent(eventID, stateID);
            }

            // go to next state
            else
            {
                gotoStateFromEventDown();
            }
        }
        /// <summary>
        /// Go up to States from Variables.
        /// </summary>
        private static void gotoStatesFromVariables()
        {
            // if states is expanded and if there are any states, go to the last state.
            // if states is expanded and there are no states, go to states heading
            if (heroObject.states.visible)
            {
                int stateCount = heroObject.states.states.Count;
                if (stateCount > 0)
                {
                    int eventCount = heroObject.states.states[stateCount - 1].heroEvent.Count;

                    // if there are no events in the last state, go to the last state
                    if (eventCount <= 0)
                    {
                        StateMenuBlock.showBlockContent(stateCount - 1);
                    }

                    // if states > state is expanded, go to the last event
                    // if states > state is not expanded, to to the last state
                    else if (eventCount > 0)
                    {
                        // if states > state is expanded, go to the last event
                        if (heroObject.states.states[stateCount - 1].visible)
                        {
                            int actionCount = heroObject.states.states[stateCount - 1].heroEvent[eventCount - 1].actions.Count;

                            // if there are no actions in the last event, go to the last event
                            if (actionCount <= 0)
                            {
                                EventMenuBlock.showBlockContent(eventCount - 1, stateCount - 1);
                            }

                            // if states > state > event is expanded, go to to last action
                            // if states > state > event is not expanded, go to the last event
                            else if (actionCount > 0)
                            {
                                // if state > event is expanded, go to the last action
                                if (heroObject.states.states[stateCount - 1].heroEvent[eventCount - 1].visible)
                                {
                                    ActionMenuBlock.showBlockContent(actionCount - 1, eventCount - 1, stateCount - 1);
                                }
                                else
                                {
                                    EventMenuBlock.showBlockContent(eventCount - 1, stateCount - 1);
                                }
                            }
                        }

                        // if states > state is not expanded, to to the last state
                        else
                        {
                            StateMenuBlock.showBlockContent(stateCount - 1);
                        }
                    }
                }
                else
                {
                    StateMenuBlock.showBlockTitle();
                }
            }

            // go to state heading
            else
            {
                StateMenuBlock.showBlockTitle();
            }
        }
 /// <summary>
 /// Go up to event X from first action in the event.
 /// </summary>
 private static void gotoEventFromActionUp()
 {
     EventMenuBlock.showBlockContent(eventID, stateID);
 }