Exemple #1
0
        private void SetUpDialog(int targetState)
        {
            if (GameStateManager.CurrentState != this)
                GameStateManager.PushState(this);

            controls = new ControlManager(font);
            controls.selectedControl = 0;
            curState = Char1.Dialog.getCurrentState();
            DialogLabel.Text = curState.stateText;
            DialogLabel.TabStop = false;
            DialogLabel.Position = new Vector2(20, 20);
            DialogLabel.SpriteFont = font;
            if (!controls.Contains(DialogLabel))
                controls.Add(DialogLabel);
            Vector2 pos = new Vector2(300, 300);
            foreach (Response res in curState.responses)
            {
                LinkLabel response = new LinkLabel();
                response.Text = res.responseText;
                response.Value = res.nextStateID;
                response.Function = res.OnSelect;
                response.Position = pos;
                response.Selected += dialog_selected;
                response.SpriteFont = font;
                pos.Y += 32;
                controls.Add(response);
            }
        }