Пример #1
0
        protected override void OnResponse(DialogResponse response)
        {
            if (response == DialogResponse.OK)
                ApplySettings();

            base.OnResponse(response);
        }
Пример #2
0
    public void Press(DialogResponse r)
    {
        if (r.action == "FIGHT") World.Instance.battlefield.StartBattle(global);
        else if (r.action == "TRADE") P.barter = global;

        if (dialog.name == "The First Dialog")
        {
            if (r.action == "Boo-Boo") P.party.Add(new LocalObject(LocalShape.Get("Krokar"), "Boo-Boo"));
            else if (r.action == "escherian shard") { }
        }

        /*else if (dialog.name == "Wild Dogs Encounter")
        {
            int threshold = global.Name == "Wild Dogs Large Pack" ? 6 : 1;
            if (r.name == "condition1") nextNode = P.party.Count <= threshold ? "1positive" : "1negative";
            else if (r.name == "condition2") nextNode = P.party.Count <= threshold + 1 ? "2positive" : "2negative";
        }*/

        string nextNode = r.jump;
        bool condition = false;

        int advantage = global.party.Count - P.party.Count;

        if (r.condition == "STRONGER") condition = advantage >= 2;
        else if (r.condition == "SAMESTRENGTH") condition = advantage < 2 && advantage > -2;

        if (r.condition != "") nextNode = nextNode + "_" + condition.ToString();

        if (nextNode != "") dialogNode = dialog.nodes[nextNode];
        else MyGame.Instance.dialog = false;

        MouseTriggerKeyword.Clear("dialog");
    }
 public override DialogResponse HandleOk()
 {
     var response = new DialogResponse("ShareModule", true);
     var folderId = Convert.ToInt32(treeview.SelectedValue);
     var document = new Document(Convert.ToInt32(Request.QueryString["mid"]));
     document.Move(folderId);
     global::umbraco.library.UpdateDocumentCache(document.Id);
     response.AddValue("parentId", folderId);
     response.AddValue("moduleId", document.Id.ToString());
     return response;
 }
Пример #4
0
    public DialogNode(XmlNode node)
    {
        text = MyXml.GetString(node, "text");
        name = MyXml.GetString(node, "name");
        description = MyXml.GetString(node, "description");

        XmlNode xnode = node.FirstChild;
        while (xnode != null)
        {
            DialogResponse temp = new DialogResponse(xnode);
            responses.Add(temp);
            xnode = xnode.NextSibling;
        }
    }
Пример #5
0
    private static DialogNode loadNode(XmlElement xmlEl,
        ref Conversation conversation, 
        ref List<DialogResponse> respWithoutChildren,
        ref List<DialogResponse> respThatSwitchConv)
    {
        string id = xmlEl.GetAttribute("id");
        string npcPhrase = xmlEl.GetAttribute("npcPhrase");
        //string voiceFile = xmlEl.GetAttribute("voiceFile");
        DialogNode node = new DialogNode(id, npcPhrase);

        XmlNodeList responsesXNL = xmlEl.ChildNodes;
        for (int j = 0; j < responsesXNL.Count; j++)
        {
            XmlElement responseXE = (XmlElement)responsesXNL[j];
            string pcPhrase = responseXE.GetAttribute("pcPhrase");
            string link = responseXE.GetAttribute("link");
            ResponseLinkType linkType = ResponseLinkType.dialogNode;
            if (responseXE.GetAttribute("linkType").
                Equals("dialogNode"))
                linkType = ResponseLinkType.dialogNode;
            else if (responseXE.GetAttribute("linkType").
                Equals("endConversation"))
                linkType = ResponseLinkType.endConversation;
            else
                linkType = ResponseLinkType.endAndChangeConversation;

            string switchConv = responseXE.
                GetAttribute("switchConversation");
            bool onlyAllowOnce = bool.Parse(responseXE.
                GetAttribute("onlyAllowOnce"));

            DialogResponse response = new DialogResponse(pcPhrase, link,
                onlyAllowOnce, linkType, switchConv);
            node.addResponse(response);
            if (responseXE.HasChildNodes)
            {
                XmlElement childNode = (XmlElement)responseXE.FirstChild;
                DialogNode dn = loadNode(childNode, ref conversation,
                    ref respWithoutChildren, ref respThatSwitchConv);
                response.childNode = dn;
                conversation.addDialogNode(dn);
            }
            else if (linkType == ResponseLinkType.dialogNode)
                respWithoutChildren.Add(response);
            if (linkType == ResponseLinkType.endAndChangeConversation)
                respThatSwitchConv.Add(response);
        }
        return node;
    }
        public override DialogResponse HandleOk()
        {
            var provider = ProviderHelper.GetGridItemProvider(Request.QueryString["provider"], null);
            GridItem item = provider.CreateItem(txtName.Text, Request.QueryString["pid"], Request.QueryString["tid"]);
            var response = new DialogResponse("CreateModule", true);
            response.AddValue("x", (int)Convert.ToDecimal(Request.QueryString["x"], CultureInfo.InvariantCulture));
            response.AddValue("y", (int)Convert.ToDecimal(Request.QueryString["y"], CultureInfo.InvariantCulture));
            response.AddValue("ph", Request.QueryString["ph"]);
            response.AddValue("id", item.Id);

            response.AddValue("html", HtmlWriter.Generate(writer => LinqItGridEditor.RenderModule(writer, provider, item)));

            response.AddCommand(DialogCommand.ShowDialog, "CustomContentEditor," + item.Id);

            return response;
        }
Пример #7
0
    void drawDialog()
    {
        GUI.Box(boxDimensions, "");
        GUILayout.BeginArea(contentDimensions);

        if (justStarted)
        {
            curNode                 = conversation.curNode;
            npcPhraseStyle          = new GUIStyle("label");
            npcPhraseStyle.wordWrap = true;

            pcPhraseStyle          = new GUIStyle("button");
            pcPhraseStyle.wordWrap = true;

            responses      = curNode.getResponses();
            responseHeight = 0;

            foreach (DialogResponse response in responses)
            {
                string msg = response.response;
                responseHeight += pcPhraseStyle.CalcHeight(new GUIContent(msg),
                                                           boxDimensions.width);
                responseHeight += pcPhraseStyle.padding.top * 2;
            }

            availableSpace  = boxDimensions.height - responseHeight;
            actualNPCHeight = npcPhraseStyle.CalcHeight(new GUIContent(
                                                            curNode.npcDialog), contentDimensions.width);
            actualNPCHeight += npcPhraseStyle.padding.top +
                               npcPhraseStyle.padding.bottom;

            if (availableSpace > maxNpcPhraseHeight)
            {
                availableSpace = maxNpcPhraseHeight;
            }
            ratio = availableSpace / actualNPCHeight;

            if (ratio < 1f)
            {
                npcPhrasePieces = Helper.cutPhrase(availableSpace,
                                                   contentDimensions.width, curNode.npcDialog,
                                                   npcPhraseStyle);
            }
            else
            {
                npcPhrasePieces[0] = curNode.npcDialog;
            }

            justStarted = false;
        }

        if (GUILayout.Button(npcPhrasePieces[curPiece], npcPhraseStyle,
                             GUILayout.MaxWidth(contentDimensions.width)))
        {
            curPiece++;
            curPiece = curPiece % npcPhrasePieces.Length;
        }

        for (int i = 0; i < responses.Length; i++)
        {
            DialogResponse response = responses[i];
            if (response.enabled)
            {
                if (GUILayout.Button(response.response, pcPhraseStyle,
                                     GUILayout.ExpandWidth(false)))
                {
                    if (response.onlyAllowOnce)
                    {
                        response.enabled = false;
                    }
                    linkToNode(response);
                    curNode   = conversation.curNode;
                    responses = curNode.getResponses();

                    responseHeight = 0;

                    foreach (DialogResponse r in responses)
                    {
                        string msg = r.response;
                        responseHeight += pcPhraseStyle.
                                          CalcHeight(new GUIContent(msg), boxDimensions.width);
                        responseHeight += pcPhraseStyle.padding.top * 2;
                    }

                    availableSpace  = boxDimensions.height - responseHeight;
                    actualNPCHeight = npcPhraseStyle.
                                      CalcHeight(new GUIContent(curNode.npcDialog),
                                                 contentDimensions.width);
                    actualNPCHeight += npcPhraseStyle.padding.top +
                                       npcPhraseStyle.padding.bottom;

                    if (availableSpace > maxNpcPhraseHeight)
                    {
                        availableSpace = maxNpcPhraseHeight;
                    }
                    ratio = availableSpace / actualNPCHeight;

                    if (ratio < 1f)
                    {
                        npcPhrasePieces = Helper.cutPhrase(availableSpace,
                                                           contentDimensions.width, curNode.npcDialog,
                                                           npcPhraseStyle);
                    }
                    else
                    {
                        npcPhrasePieces = new string[] { curNode.npcDialog }
                    };
                    curPiece = 0;
                }
            }
        }
        GUILayout.EndArea();
    }

    void linkToNode(DialogResponse response)
    {
        if (response.linkType == ResponseLinkType.endConversation)
        {
            endDialog(false);
        }
        else if (response.linkType == ResponseLinkType.dialogNode)
        {
            conversation.curNode = response.childNode;
        }
        else if (response.linkType == ResponseLinkType.
                 endAndChangeConversation)
        {
            conversation.curNode = response.switchNode;
            endDialog(true);
        }
    }

    void endDialog(bool switched)
    {
        enabled = false;
        if (conversation.resetConversationOnEnd && !switched)
        {
            conversation.curNode = conversation.startNode;
        }
        Messenger <bool> .Broadcast("enable phrases", true);

        StartCoroutine(Helper.rotate(transform,
                                     Quaternion.AngleAxis(180f, Vector3.up), 0.5f));
        GameObject target = new GameObject("cameraPosition");

        target.transform.position = cameraPosition;
        target.transform.rotation = cameraRotation;
        StartCoroutine(Helper.transitionCamera(target.transform, true,
                                               npcName));
        onEndDialog();
    }
Пример #8
0
 public void addResponse(DialogResponse dialogResponse)
 {
     responses.Add(dialogResponse);
 }
Пример #9
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     SetForm(typeof(FinalPoints));
 }
Пример #10
0
        private void cellEditValidating(object sender, CellEditEventArgs e)
        {
            if (e.SubItemIndex == 2 && e.RowObject is DialogResponse)
            {
                DialogResponse r = (DialogResponse)e.RowObject;
                if (((ComboBox)e.Control).SelectedItem == null)
                {
                    treeListView.RefreshObject(r);
                    return;
                }
                r.link = (String)((ComboBox)e.Control).SelectedItem;
                if (r.link.Equals("End conversation"))
                {
                    r.linkType = ResponseLinkType.endConversation;
                }
                else if (!r.link.Equals("End & switch conversation"))
                {
                    r.linkType = ResponseLinkType.dialogNode;
                }

                treeListView.RefreshObject(r);
            }
            else if (e.SubItemIndex == 1 && e.RowObject is DialogNode)
            {
                String     id   = (String)e.NewValue;
                DialogNode node = (DialogNode)e.RowObject;
                if (NpcIdGenerator.contains(id) && !id.Equals(node.id))
                {
                    showError("String is not unique", "Error");
                    e.NewValue = node.id;
                    e.Cancel   = true;
                    return;
                }
                if (id.Equals(""))
                {
                    showError("Id can not be empty.", "Error");
                    e.NewValue = node.id;
                    e.Cancel   = true;
                    return;
                }

                NpcIdGenerator.removeId(node.id);
                node.id = (String)e.NewValue;
                NpcIdGenerator.addId(node.id);
                treeListView.RefreshObject(node);

                //change links of responses where link == oldId
                List <DialogResponse> responses = new List <DialogResponse>();
                for (int i = 0; i < conversation.getRootNodes().Length; i++)
                {
                    DialogNode n = conversation.getRootNode(i);
                    responses.AddRange(getResponses(n));
                }
                for (int i = 0; i < responses.Count; i++)
                {
                    DialogResponse r = responses[i];
                    if (r.link.Equals((String)e.Value))
                    {
                        r.link = node.id;
                        treeListView.RefreshObject(r);
                    }
                }
            }

            if (!changesMade)
            {
                this.Text = this.Text + "*";
            }
            changesMade = true;
        }
Пример #11
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected abstract void OnDialogResponse(DialogResponse reponse);
Пример #12
0
 protected virtual void OnResponse(DialogResponse response)
 {
     if (Response != null)
         Response(this, new DialogResponseEventArgs(response));
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DialogResponseData"/> struct.
 /// </summary>
 /// <param name="response">Sent dialog response.</param>
 /// <param name="listItem">Selected item in list, -1 if no list.</param>
 /// <param name="inputText">Entered text or selected list item.</param>
 public DialogResponseData(DialogResponse response, int listItem, string inputText)
 {
     this.Response  = response;
     this.ListItem  = listItem;
     this.InputText = inputText;
 }
Пример #14
0
 public DialogResponses(DialogResponse one, DialogResponse two, DialogResponse three)
 {
     responseOne   = one;
     responseTwo   = two;
     responseThree = three;
 }
Пример #15
0
            public ShowDialogTaskEventArgs(Task t, 
				string message, string title, MessageButtons buttons,
				DialogResponse defResponse = DialogResponse.Other)
                : base(t)
            {
                this.Message = message;
                this.Title = title;
                this.Buttons = buttons;
                this.Response = defResponse;
            }
Пример #16
0
        /// <summary>
        /// Shows a dialog with the given message, title, and buttons.
        /// </summary>
        /// <param name="message">The message shown on the dialog.</param>
        /// <param name="title">The dialog's title.</param>
        /// <param name="buttons">The buttons shown on the dialog.</param>
        /// <param name="defResponse">The default dialog response to be
        /// returned if nothing handles the event and sets the response value.</param>
        /// <returns>The response from the dialog.</returns>
        protected virtual DialogResponse ShowMessageDialog(
			string message, string title, 
			MessageButtons buttons = MessageButtons.Ok,
			DialogResponse defResponse = DialogResponse.Other)
        {
            ShowDialogTaskEventArgs args = new ShowDialogTaskEventArgs(
                this, message, title, buttons, defResponse);

            if (ShowDialog != null)
                ShowDialog(this, args);

            return args.Response;
        }
Пример #17
0
 public void removeResponse(DialogResponse dialogResponse)
 {
     responses.Remove(dialogResponse);
 }
Пример #18
0
 public DialogResponses(DialogResponse one)
 {
     responseOne = one;
 }
Пример #19
0
 public DialogResponseEventArgs(DialogResponse response)
 {
     this.Response = response;
 }
Пример #20
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     SetForm(typeof(RiverCross));
 }
Пример #21
0
        private void HandleLoadWeapon(int responseID)
        {
            DialogResponse response = GetResponseByID("LoadWeaponPage", responseID);
            NWPlayer       oPC      = GetPC();

            if (!CanModifyWeapon())
            {
                oPC.FloatingText("You cannot modify your currently equipped Weapon.");
                return;
            }

            int      outfitID = (int)response.CustomData;
            PCWeapon entity   = GetPlayerWeapons(GetPC());

            if (entity == null)
            {
                return;
            }

            NWPlaceable oTempStorage  = (GetObjectByTag("OUTFIT_BARREL"));
            NWItem      oClothes      = oPC.RightHand;
            NWItem      storedClothes = null;

            oClothes.SetLocalString("TEMP_OUTFIT_UUID", oPC.GlobalID.ToString());

            if (outfitID == 1)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon1, oTempStorage);
            }
            else if (outfitID == 2)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon2, oTempStorage);
            }
            else if (outfitID == 3)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon3, oTempStorage);
            }
            else if (outfitID == 4)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon4, oTempStorage);
            }
            else if (outfitID == 5)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon5, oTempStorage);
            }
            else if (outfitID == 6)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon6, oTempStorage);
            }
            else if (outfitID == 7)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon7, oTempStorage);
            }
            else if (outfitID == 8)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon8, oTempStorage);
            }
            else if (outfitID == 9)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon9, oTempStorage);
            }
            else if (outfitID == 10)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Weapon10, oTempStorage);
            }

            if (storedClothes == null)
            {
                throw new Exception("Unable to locate stored Weapon.");
            }

            uint oCopy = CopyItem(oClothes.Object, oTempStorage.Object, true);

            var baseItemType = GetBaseItemType(oCopy);

            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.SimpleModel, 0, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.SimpleModel, 0), true);

            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.WeaponModel, 0, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.WeaponModel, 0), true);
            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.WeaponColor, 0, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.WeaponModel, 0), true);

            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.WeaponModel, 1, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.WeaponModel, 1), true);
            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.WeaponColor, 1, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.WeaponColor, 1), true);

            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.WeaponModel, 2, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.WeaponModel, 2), true);
            oCopy = _.CopyItemAndModify(oCopy, ItemAppearanceType.WeaponColor, 2, (int)GetItemAppearance(storedClothes.Object, ItemAppearanceType.WeaponColor, 2), true);

            NWItem oFinal = (CopyItem(oCopy, oPC.Object, true));

            oFinal.DeleteLocalString("TEMP_OUTFIT_UUID");
            DestroyObject(oCopy);
            oClothes.Destroy();
            storedClothes.Destroy();

            oPC.AssignCommand(() => ActionEquipItem(oFinal.Object, InventorySlot.RightHand));

            foreach (NWItem item in oTempStorage.InventoryItems)
            {
                if (item.GetLocalString("TEMP_OUTFIT_UUID") == oPC.GlobalID.ToString())
                {
                    item.Destroy();
                }
            }

            ShowLoadWeaponOptions();
        }
Пример #22
0
 /// <summary>
 /// Called when player input has been detected and an appropriate response needs to be determined.
 /// </summary>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     SetForm(typeof(Hunting));
 }
    // The actual window code goes here
    private void OnGUI()
    {
        // Set custom textures:
        Texture2D redBackground = new Texture2D(deleteConBtnSize, deleteConBtnSize);

        for (int i = 0; i < deleteConBtnSize; i++)
        {
            for (int j = 0; j < deleteConBtnSize; j++)
            {
                redBackground.SetPixel(j, i, new Color((180 + (2 * i)) / 255f, 0, 0));
            }
        }
        redBackground.Apply();
        Texture2D greenBackground = new Texture2D(deleteConBtnSize, deleteConBtnSize);

        for (int i = 0; i < deleteConBtnSize; i++)
        {
            for (int j = 0; j < deleteConBtnSize; j++)
            {
                greenBackground.SetPixel(j, i, new Color(0, (170 + (2 * i)) / 255f, 0));
            }
        }
        greenBackground.Apply();

        // Set styles for the delete node connection button
        deleteConnectionButton.fontSize          = 13;
        deleteConnectionButton.alignment         = TextAnchor.MiddleCenter;
        deleteConnectionButton.normal.textColor  = Color.white;
        deleteConnectionButton.normal.background = redBackground;
        deleteConnectionButton.border            = new RectOffset(10, 10, 10, 10);

        // Set styles for start button
        GUIStyle startNode = new GUIStyle
        {
            fontSize  = 13,
            alignment = TextAnchor.MiddleCenter
        };

        startNode.normal.textColor  = Color.white;
        startNode.normal.background = greenBackground;
        startNode.border            = new RectOffset(5, 5, 5, 5);


        // Set styles for the end button
        GUIStyle endNode = new GUIStyle
        {
            fontSize  = 13,
            alignment = TextAnchor.MiddleCenter
        };

        endNode.normal.textColor  = Color.white;
        endNode.normal.background = redBackground;


        // Lock sizes of window
        this.minSize = new Vector2(MIN_WIDTH, MIN_HEIGHT);
        this.maxSize = new Vector2(MAX_WIDTH, MAX_HEIGHT);

        Vector2 backgroundSize = new Vector2(position.width * 0.95f, position.height * 0.75f);

        // Draw editor title
        GUILayout.Label("Dialog Editor", EditorStyles.boldLabel);
        if (this.selectedCharacter != null)
        {
            GUILayout.Label("Editing dialog for " + this.selectedCharacter.name, EditorStyles.centeredGreyMiniLabel);
        }

        // Draw the dialog tree background
        Rect backgroundRect = new Rect(backgroundPosition.x, backgroundPosition.y, backgroundSize.x, backgroundSize.y);

        EditorGUI.DrawRect(backgroundRect, new Color(0.6f, 0.6f, 0.6f));

        // Add a new dialog node on button click
        GUIStyle newNodeButton = new GUIStyle
        {
            fontSize  = 20,
            alignment = TextAnchor.UpperCenter,
            fontStyle = FontStyle.Bold
        };

        if (GUI.Button(new Rect(position.width * 0.92f, 10, 30, 30), "+", newNodeButton))
        {
            DialogNode content      = new DialogNode("Write the dialog prompt here.");
            Vector2    nodePosition = new Vector2(Random.Range(backgroundPosition.x, backgroundSize.x - nodeWidth / 2), Random.Range(backgroundPosition.y, backgroundSize.y - nodeHeight / 2));
            nodes.Add(new WindowDialogNode(nodePosition, content));
        }

        if (selectedNodeIndex != -1 && selectedNodeIndex != START_NODE_INDEX && selectedNodeIndex != END_NODE_INDEX)
        {
            if (GUI.Button(new Rect(position.width * 0.86f, 10, 30, 30), "X", deleteConnectionButton))
            {
                RemoveNodeAtIndex(selectedNodeIndex);
            }
        }

        // If no nodes have been added to the graph, add a start node and end node
        if (this.nodes.Count == 0)
        {
            // Add the green start node:
            DialogNode startContent      = new DialogNode("Start Node");
            Vector2    startNodePosition = new Vector2(Random.Range(backgroundPosition.x, backgroundSize.x - nodeWidth / 2), Random.Range(backgroundPosition.y, backgroundSize.y - nodeHeight / 2));
            nodes.Add(new WindowDialogNode(startNodePosition, startContent));
            // Add a red end node:
            DialogNode endContent      = new DialogNode("End Node");
            Vector2    endNodePosition = new Vector2(Random.Range(backgroundPosition.x, backgroundSize.x - nodeWidth / 2), Random.Range(backgroundPosition.y, backgroundSize.y - nodeHeight / 2));
            nodes.Add(new WindowDialogNode(endNodePosition, endContent));
        }



        //Draw all the nodes in the graph, including the arrows represeting the traversable paths of dialog.
        BeginWindows();
        for (int i = 0; i < nodes.Count; i++)
        {
            // If the node is not a start node or the end node, we still need to set its Rect
            if (i == START_NODE_INDEX) // Index 0 of nodes is always the start node
            {
                nodes[START_NODE_INDEX].Rect = GUI.Window(START_NODE_INDEX, nodes[START_NODE_INDEX].Rect, DrawNodeWindow, "Start", startNode);
            }
            else if (i == END_NODE_INDEX)    // Index 1 of nodes is always the end node
            {
                nodes[END_NODE_INDEX].Rect = GUI.Window(END_NODE_INDEX, nodes[END_NODE_INDEX].Rect, DrawNodeWindow, "End", endNode);
            }
            else // Every index greater than 1 holds all the dialog nodes
            {
                nodes[i].Rect = GUI.Window(i, nodes[i].Rect, DrawNodeWindow, "Node " + (i - 1));
            }


            // Handles graph interaction. Also draws connections between nodes
            Event current = Event.current;
            if (nodes[i].Rect.Contains(current.mousePosition))
            {
                // If node is right-clicked, start creating a connection to a new node
                if (current.type == EventType.ContextClick)
                {
                    // If flag is true, then the user is trying to form the tail of the node connection
                    if (draggingNodeLink)
                    {
                        // If this connection has not already been formed, then form it
                        bool canCreateConnection = true;
                        for (int j = 0; j < nodes[draggingFromIndex].content.responses.Count; j++)
                        {
                            if (nodes[draggingFromIndex].content.responses[j].nextSentence == i)
                            {
                                canCreateConnection = false;
                                break;
                            }
                        }
                        if (canCreateConnection)
                        {
                            DialogResponse response = new DialogResponse("Write a response to the prompt here.", i);
                            nodes[draggingFromIndex].content.responses.Add(response);
                        }
                        draggingNodeLink = false;
                    }
                    // If the flag is false, then the user is trying to start with the head (beginning) of the connection
                    else
                    {
                        int numResponses = nodes[START_NODE_INDEX].content.responses.Count;
                        // Don't allow dialog paths to be created originating from the end node
                        if (i != END_NODE_INDEX)
                        {
                            draggingFromIndex = i;
                            draggingNodeLink  = true;
                        }
                    }
                    current.Use();
                }
                // If you left click on a node, display the node's info at the bottom of the gui
                else if (current.type == EventType.Layout)
                {
                    selectedNodeIndex = i;
                }
            }

            // Draw connections to neighbouring nodes
            Handles.color = Color.cyan;
            Vector2 currentNodePosition2d = nodes[i].Rect.position;
            Vector3 currentNodePosition   = new Vector3(currentNodePosition2d.x + WindowDialogNode.width / 2, currentNodePosition2d.y + WindowDialogNode.height / 2, 0);
            if (nodes[i].content != null)
            {
                for (int j = 0; j < nodes[i].content.responses.Count; j++)
                {
                    // Get the index for the target node from the nextSentence variable of the j-th response of this node
                    int targetNodeIndex = nodes[i].content.responses[j].nextSentence;

                    Vector2 targetNodePosition2d = nodes[targetNodeIndex].Rect.position;
                    Vector3 targetNodePosition   = new Vector3(targetNodePosition2d.x + WindowDialogNode.width / 2, targetNodePosition2d.y + WindowDialogNode.height / 2, 0);
                    Handles.DrawLine(currentNodePosition, targetNodePosition);


                    // Draw the arrow head:
                    Vector3 dirUnitVector = (targetNodePosition - currentNodePosition).normalized;
                    Vector3 perpendicularDirUnitVector = new Vector3(-dirUnitVector.y, dirUnitVector.x, 0).normalized;
                    Vector3 triangleHeight             = dirUnitVector * arrowheadHeight;
                    targetNodePosition = 0.5f * (targetNodePosition + currentNodePosition);
                    Vector3   triangleBase = new Vector3(targetNodePosition.x - triangleHeight.x, targetNodePosition.y - triangleHeight.y, 0);
                    Vector3[] vertices     =
                    {
                        targetNodePosition,
                        new Vector3(triangleBase.x + ((arrowheadHeight / 2) * perpendicularDirUnitVector.x),triangleBase.y + ((arrowheadHeight / 2) * perpendicularDirUnitVector.y),  0),
                        new Vector3(triangleBase.x - ((arrowheadHeight / 2) * perpendicularDirUnitVector.x),triangleBase.y - ((arrowheadHeight / 2) * perpendicularDirUnitVector.y),  0),
                    };
                    Handles.color = Color.cyan;
                    Handles.DrawAAConvexPolygon(vertices);
                }
            }
        }
        EndWindows();

        // Draws a line from selected node to the cursor position when creating a new node connection in the graph
        if (draggingNodeLink)
        {
            Vector2 mousePos = Event.current.mousePosition;
            Vector2 nodePos  = nodes[draggingFromIndex].Rect.position;
            Handles.color = Color.blue;
            Handles.DrawLine(new Vector3(mousePos.x, mousePos.y, 0), new Vector3(nodePos.x + WindowDialogNode.width / 2, nodePos.y + WindowDialogNode.height / 2, 0));
            Repaint();
        }

        // End node connection attempt if second left click not over a node
        Event secondEvent = Event.current;

        if (secondEvent.type == EventType.ContextClick)
        {
            draggingNodeLink = false;
            secondEvent.Use();
        }

        // If a node is selected in the graph, display its contents at the bottom of the gui window.
        if (selectedNodeIndex != -1)
        {
            DisplayNodeInfo();
        }

        // Label to say which node is currently highlighted in the dialog graph
        GUI.Label(new Rect(660, position.height * 0.86f, 100, 70), "Selected Node:");
        GUI.Label(new Rect(660, position.height * 0.89f, 100, 70), selectedNodeIndex == -1 ? "No node selected." : selectedNodeIndex == 0 ? "Start Node" : selectedNodeIndex == 1 ? "End Node" : "Node " + (selectedNodeIndex - 1));

        // Save the updated dialog graph:
        if (this.selectedCharacter != null)
        {
            this.selectedCharacter.UpdateDialogGraph(this.nodes);
        }
    } // end OnGUI method
Пример #24
0
 private void OnCancel(object sender, RoutedEventArgs e)
 {
     DialogResult = null;
     Response     = DialogResponse.Cancel;
     Close();
 }
Пример #25
0
 public ModalMessageDialog()
 {
     InitializeComponent();
     _response = DialogResponse.Cancel;
 }
Пример #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageDialogResponse" /> struct.
 /// </summary>
 /// <param name="response">The way in which the player has responded to the dialog.</param>
 /// <param name="inputText">The text the player has entered into the input field.</param>
 public InputDialogResponse(DialogResponse response, string inputText)
 {
     Response  = response;
     InputText = inputText;
 }
Пример #27
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     _response = DialogResponse.Cancel;
     Close();
 }
Пример #28
0
        public static bool OnAppearsWhen(int nodeType, int nodeID)
        {
            NWPlayer player    = (_.GetPCSpeaker());
            bool     hasDialog = HasPlayerDialog(player.GlobalID);

            if (!hasDialog)
            {
                return(false);
            }
            PlayerDialog dialog = LoadPlayerDialog(player.GlobalID);

            using (new Profiler(nameof(DialogService) + "." + nameof(OnAppearsWhen) + "." + dialog.ActiveDialogName))
            {
                DialogPage page  = dialog.CurrentPage;
                var        convo = GetConversation(dialog.ActiveDialogName);
                int        currentSelectionNumber = nodeID + 1;
                bool       displayNode            = false;
                string     newNodeText            = string.Empty;
                int        dialogOffset           = (NumberOfResponsesPerPage + 1) * (dialog.DialogNumber - 1);

                if (currentSelectionNumber == NumberOfResponsesPerPage + 1) // Next page
                {
                    int displayCount = page.NumberOfResponses - (NumberOfResponsesPerPage * dialog.PageOffset);

                    if (displayCount > NumberOfResponsesPerPage)
                    {
                        displayNode = true;
                    }
                }
                else if (currentSelectionNumber == NumberOfResponsesPerPage + 2) // Previous Page
                {
                    if (dialog.PageOffset > 0)
                    {
                        displayNode = true;
                    }
                }
                else if (currentSelectionNumber == NumberOfResponsesPerPage + 3) // Back
                {
                    if (dialog.NavigationStack.Count > 0 && dialog.EnableBackButton)
                    {
                        displayNode = true;
                    }
                }
                else if (nodeType == 2)
                {
                    int responseID = (dialog.PageOffset * NumberOfResponsesPerPage) + nodeID;
                    if (responseID + 1 <= page.NumberOfResponses)
                    {
                        DialogResponse response = page.Responses[responseID];

                        if (response != null)
                        {
                            newNodeText = response.Text;
                            displayNode = response.IsActive;
                        }
                    }
                }
                else if (nodeType == 1)
                {
                    if (player.GetLocalInt("DIALOG_SYSTEM_INITIALIZE_RAN") != 1)
                    {
                        convo.Initialize();
                        player.SetLocalInt("DIALOG_SYSTEM_INITIALIZE_RAN", 1);
                    }

                    if (dialog.IsEnding)
                    {
                        convo.EndDialog();
                        RemovePlayerDialog(player.GlobalID);
                        player.DeleteLocalInt("DIALOG_SYSTEM_INITIALIZE_RAN");
                        return(false);
                    }

                    page        = dialog.CurrentPage;
                    newNodeText = page.Header;

                    _.SetCustomToken(90000 + dialogOffset, newNodeText);
                    return(true);
                }

                _.SetCustomToken(90001 + nodeID + dialogOffset, newNodeText);
                return(displayNode);
            }
        }
Пример #29
0
 private void btnYes_Click(object sender, RoutedEventArgs e)
 {
     _response = DialogResponse.Yes;
     Close();
 }
Пример #30
0
        public static Record CreateRecord(string Tag)
        {
            Record outRecord;

            switch (Tag)
            {
            case "TES4":
                outRecord = new Header();
                break;

            case "GMST":
                outRecord = new GameSetting();
                break;

            case "TXST":
                outRecord = new TextureSet();
                break;

            case "MICN":
                outRecord = new MenuIcon();
                break;

            case "GLOB":
                outRecord = new GlobalVariable();
                break;

            case "CLAS":
                outRecord = new Class();
                break;

            case "FACT":
                outRecord = new Faction();
                break;

            case "HDPT":
                outRecord = new HeadPart();
                break;

            case "HAIR":
                outRecord = new Hair();
                break;

            case "EYES":
                outRecord = new Eyes();
                break;

            case "RACE":
                outRecord = new Race();
                break;

            case "SOUN":
                outRecord = new Sound();
                break;

            case "ASPC":
                outRecord = new AcousticSpace();
                break;

            case "MGEF":
                outRecord = new MagicEffect();
                break;

            case "SCPT":
                outRecord = new Script();
                break;

            case "LTEX":
                outRecord = new LandscapeTexture();
                break;

            case "ENCH":
                outRecord = new ObjectEffect();
                break;

            case "SPEL":
                outRecord = new ActorEffect();
                break;

            case "ACTI":
                outRecord = new ESPSharp.Records.Activator();
                break;

            case "TACT":
                outRecord = new TalkingActivator();
                break;

            case "TERM":
                outRecord = new Terminal();
                break;

            case "ARMO":
                outRecord = new Armor();
                break;

            case "BOOK":
                outRecord = new Book();
                break;

            case "CONT":
                outRecord = new Container();
                break;

            case "DOOR":
                outRecord = new Door();
                break;

            case "INGR":
                outRecord = new Ingredient();
                break;

            case "LIGH":
                outRecord = new Light();
                break;

            case "MISC":
                outRecord = new MiscItem();
                break;

            case "STAT":
                outRecord = new Static();
                break;

            case "SCOL":
                outRecord = new StaticCollection();
                break;

            case "MSTT":
                outRecord = new MoveableStatic();
                break;

            case "PWAT":
                outRecord = new PlaceableWater();
                break;

            case "GRAS":
                outRecord = new Grass();
                break;

            case "TREE":
                outRecord = new Tree();
                break;

            case "FURN":
                outRecord = new Furniture();
                break;

            case "WEAP":
                outRecord = new Weapon();
                break;

            case "AMMO":
                outRecord = new Ammunition();
                break;

            case "NPC_":
                outRecord = new NonPlayerCharacter();
                break;

            case "CREA":
                outRecord = new Creature();
                break;

            case "LVLC":
                outRecord = new LeveledCreature();
                break;

            case "LVLN":
                outRecord = new LeveledNPC();
                break;

            case "KEYM":
                outRecord = new Key();
                break;

            case "ALCH":
                outRecord = new Ingestible();
                break;

            case "IDLM":
                outRecord = new IdleMarker();
                break;

            case "NOTE":
                outRecord = new Note();
                break;

            case "COBJ":
                outRecord = new ConstructibleObject();
                break;

            case "PROJ":
                outRecord = new Projectile();
                break;

            case "LVLI":
                outRecord = new LeveledItem();
                break;

            case "WTHR":
                outRecord = new Weather();
                break;

            case "CLMT":
                outRecord = new Climate();
                break;

            case "REGN":
                outRecord = new Region();
                break;

            case "NAVI":
                outRecord = new NavigationMeshInfoMap();
                break;

            case "DIAL":
                outRecord = new DialogTopic();
                break;

            case "QUST":
                outRecord = new Quest();
                break;

            case "IDLE":
                outRecord = new IdleAnimation();
                break;

            case "PACK":
                outRecord = new Package();
                break;

            case "CSTY":
                outRecord = new CombatStyle();
                break;

            case "LSCR":
                outRecord = new LoadScreen();
                break;

            case "ANIO":
                outRecord = new AnimatedObject();
                break;

            case "WATR":
                outRecord = new Water();
                break;

            case "EFSH":
                outRecord = new EffectShader();
                break;

            case "EXPL":
                outRecord = new Explosion();
                break;

            case "DEBR":
                outRecord = new Debris();
                break;

            case "IMGS":
                outRecord = new ImageSpace();
                break;

            case "IMAD":
                outRecord = new ImageSpaceAdapter();
                break;

            case "FLST":
                outRecord = new FormList();
                break;

            case "PERK":
                outRecord = new Perk();
                break;

            case "BPTD":
                outRecord = new BodyPartData();
                break;

            case "ADDN":
                outRecord = new AddonNode();
                break;

            case "AVIF":
                outRecord = new ActorValueInformation();
                break;

            case "RADS":
                outRecord = new RadiationStage();
                break;

            case "CAMS":
                outRecord = new CameraShot();
                break;

            case "CPTH":
                outRecord = new CameraPath();
                break;

            case "VTYP":
                outRecord = new VoiceType();
                break;

            case "IPCT":
                outRecord = new Impact();
                break;

            case "IPDS":
                outRecord = new ImpactDataSet();
                break;

            case "ARMA":
                outRecord = new ArmorAddon();
                break;

            case "ECZN":
                outRecord = new EncounterZone();
                break;

            case "MESG":
                outRecord = new Message();
                break;

            case "RGDL":
                outRecord = new Ragdoll();
                break;

            case "DOBJ":
                outRecord = new DefaultObjectManager();
                break;

            case "LGTM":
                outRecord = new LightingTemplate();
                break;

            case "MUSC":
                outRecord = new MusicType();
                break;

            case "IMOD":
                outRecord = new ItemMod();
                break;

            case "REPU":
                outRecord = new Reputation();
                break;

            case "RCPE":
                outRecord = new Recipe();
                break;

            case "RCCT":
                outRecord = new RecipeCategory();
                break;

            case "CHIP":
                outRecord = new CasinoChip();
                break;

            case "CSNO":
                outRecord = new Casino();
                break;

            case "LSCT":
                outRecord = new LoadScreenType();
                break;

            case "MSET":
                outRecord = new MediaSet();
                break;

            case "ALOC":
                outRecord = new MediaLocationController();
                break;

            case "CHAL":
                outRecord = new Challenge();
                break;

            case "AMEF":
                outRecord = new AmmoEffect();
                break;

            case "CCRD":
                outRecord = new CaravanCard();
                break;

            case "CMNY":
                outRecord = new CaravanMoney();
                break;

            case "CDCK":
                outRecord = new CaravanDeck();
                break;

            case "DEHY":
                outRecord = new DehydrationStage();
                break;

            case "HUNG":
                outRecord = new HungerStage();
                break;

            case "SLPD":
                outRecord = new SleepDeprivationStage();
                break;

            case "CELL":
                outRecord = new Cell();
                break;

            case "WRLD":
                outRecord = new Worldspace();
                break;

            case "LAND":
                outRecord = new GenericRecord();
                break;

            case "NAVM":
                outRecord = new NavigationMesh();
                break;

            case "INFO":
                outRecord = new DialogResponse();
                break;

            case "REFR":
                outRecord = new Reference();
                break;

            case "ACHR":
                outRecord = new PlacedNPC();
                break;

            case "ACRE":
                outRecord = new PlacedCreature();
                break;

            case "PGRE":
                outRecord = new PlacedGrenade();
                break;

            case "PMIS":
                outRecord = new PlacedMissile();
                break;

            default:
                Console.WriteLine("Encountered unknown record: " + Tag);
                outRecord = new GenericRecord();
                break;
            }

            outRecord.Tag = Tag;

            return(outRecord);
        }
Пример #31
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     // parentGameMode.State = new CaulkRiverHelp(parentGameMode, UserData);
     SetForm(typeof(CaulkRiverHelp));
 }
Пример #32
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     // parentGameMode.State = new ProfessionSelector(parentGameMode, UserData);
     SetForm(typeof(ProfessionSelector));
 }
Пример #33
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     // parentGameMode.State = null;
     ClearForm();
 }
Пример #34
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     // Completely resets the game to default state it was in when it first started.
     GameSimulationApp.Instance.Restart();
 }
Пример #35
0
	void linkToNode(DialogResponse response)
	{
		if (response.linkType == ResponseLinkType.endConversation)
			endDialog(false);
		else if (response.linkType == ResponseLinkType.dialogNode)
			conversation.curNode = response.childNode;
		else if (response.linkType == ResponseLinkType.
		         endAndChangeConversation)
		{
			conversation.curNode = response.switchNode;
			endDialog(true);
		}
	}
Пример #36
0
 public DialogResponses(DialogResponse one, DialogResponse two)
 {
     responseOne = one; responseTwo = two;
 }
Пример #37
0
 public DialogResponseEventArgs(DialogResponse response)
 {
     this.Response = response;
 }
Пример #38
0
 /// <summary>
 /// Called when player input has been detected and an appropriate response needs to be determined.
 /// </summary>
 protected override void OnDialogResponse(DialogResponse response)
 {
     ClearForm();
 }
Пример #39
0
 /// <summary>
 /// Called when player input has been detected and an appropriate response needs to be determined.
 /// </summary>
 protected override void OnDialogResponse(DialogResponse response)
 {
     SetForm(typeof(Store));
 }
Пример #40
0
        private void HandleLoadOutfit(int responseID)
        {
            DialogResponse response = GetResponseByID("LoadOutfitPage", responseID);
            NWPlayer       oPC      = GetPC();

            if (!CanModifyClothes())
            {
                oPC.FloatingText("You cannot modify your currently equipped clothes.");
                return;
            }

            int      outfitID = (int)response.CustomData;
            PCOutfit entity   = GetPlayerOutfits(GetPC());

            NWPlaceable oTempStorage  = (_.GetObjectByTag("OUTFIT_BARREL"));
            NWItem      oClothes      = oPC.Chest;
            NWItem      storedClothes = null;

            oClothes.SetLocalString("TEMP_OUTFIT_UUID", oPC.GlobalID.ToString());

            if (outfitID == 1)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit1, oTempStorage);
            }
            else if (outfitID == 2)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit2, oTempStorage);
            }
            else if (outfitID == 3)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit3, oTempStorage);
            }
            else if (outfitID == 4)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit4, oTempStorage);
            }
            else if (outfitID == 5)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit5, oTempStorage);
            }
            else if (outfitID == 6)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit6, oTempStorage);
            }
            else if (outfitID == 7)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit7, oTempStorage);
            }
            else if (outfitID == 8)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit8, oTempStorage);
            }
            else if (outfitID == 9)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit9, oTempStorage);
            }
            else if (outfitID == 10)
            {
                storedClothes = SerializationService.DeserializeItem(entity.Outfit10, oTempStorage);
            }

            if (storedClothes == null)
            {
                throw new Exception("Unable to locate stored clothes.");
            }

            NWGameObject oCopy = _.CopyItem(oClothes.Object, oTempStorage.Object, TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LBICEP), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_BELT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_BELT), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOOT), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOREARM), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LHAND), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHIN), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHOULDER), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LTHIGH), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_NECK, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_NECK), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_PELVIS, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_PELVIS), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RBICEP), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOOT), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOREARM), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RHAND), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_ROBE, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_ROBE), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHIN), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHOULDER), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RTHIGH), TRUE);

            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO), TRUE);
            oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_TORSO, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_TORSO), TRUE);

            NWItem oFinal = (_.CopyItem(oCopy, oPC.Object, TRUE));

            oFinal.DeleteLocalString("TEMP_OUTFIT_UUID");
            _.DestroyObject(oCopy);
            oClothes.Destroy();
            storedClothes.Destroy();

            oPC.AssignCommand(() => _.ActionEquipItem(oFinal.Object, INVENTORY_SLOT_CHEST));

            foreach (NWItem item in oTempStorage.InventoryItems)
            {
                if (item.GetLocalString("TEMP_OUTFIT_UUID") == oPC.GlobalID.ToString())
                {
                    item.Destroy();
                }
            }

            ShowLoadOutfitOptions();
        }
Пример #41
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageDialogResponse" /> struct.
 /// </summary>
 /// <param name="response">The way in which the player has responded to the dialog.</param>
 public MessageDialogResponse(DialogResponse response)
 {
     Response = response;
 }
Пример #42
0
        public override void DoAction(NWPlayer player, string pageName, int responseID)
        {
            PlayerDialog    dialog      = DialogService.LoadPlayerDialog(GetPC().GlobalID);
            Guid            structureID = new Guid(_.GetLocalString(player.Area, "PC_BASE_STRUCTURE_ID"));
            PCBaseStructure structure   = DataService.PCBaseStructure.GetByID(structureID);
            PCBase          pcBase      = DataService.PCBase.GetByID(structure.PCBaseID);

            DialogPage     page     = dialog.GetPageByName(pageName);
            DialogResponse response = page.Responses[responseID - 1];

            bool carefulPilot = PerkService.GetCreaturePerkLevel(player, PerkType.CarefulPilot) > 0;

            if (pageName == "MainPage")
            {
                // The number of dialog options available can vary.  So query based on the actual text of the response.
                if (response.Text == "Land")
                {
                    ChangePage("LandingDestPage");
                }
                else if (response.Text == "Pilot Ship")
                {
                    SpaceService.CreateShipInSpace(player.Area); // In case we logged in here.
                    SpaceService.DoFlyShip(GetPC(), GetPC().Area);
                    EndConversation();
                }
                else if (response.Text == "Hyperspace Jump")
                {
                    // Build the list of destinations.
                    ChangePage("HyperDestPage");
                }
                else if (response.Text == "Take Off")
                {
                    // Check fuel
                    if (pcBase.Fuel < 1)
                    {
                        GetPC().SendMessage("You don't have enough fuel! You need 1 fuel to take off.");
                        dialog.ResetPage();
                    }
                    else
                    {
                        // Fuel is good - we have liftoff.
                        if (!SpaceService.DoPilotingSkillCheck(GetPC(), 2, carefulPilot))
                        {
                            // Failed our skill check.  Deduct fuel but don't do anything else.
                            GetPC().FloatingText("The ship shudders a bit, but your awkwardness on the throttle shows, and it doesn't make it off the dock.  Try again.");
                            pcBase.Fuel -= 1;
                            DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);
                            return;
                        }

                        EndConversation();

                        // Save details of the current dock for later.
                        Guid            shipPCBaseID = new Guid(pcBase.ShipLocation);
                        PCBaseStructure dock         = DataService.PCBaseStructure.GetByIDOrDefault(shipPCBaseID);

                        pcBase.Fuel        -= 1;
                        pcBase.DateRentDue  = DateTime.UtcNow.AddDays(99);
                        pcBase.ShipLocation = SpaceService.GetPlanetFromLocation(pcBase.ShipLocation) + " - Orbit";
                        DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);

                        SpaceService.CreateShipInSpace(player.Area);

                        // Give the impression of movement
                        foreach (var creature in player.Area.Objects)
                        {
                            if (creature.IsPC || creature.IsDM)
                            {
                                _.FloatingTextStringOnCreature("The ship is taking off", creature);
                            }
                        }

                        _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Fnf_Screen_Shake), player);

                        // Clean up the base structure, if we were in a PC dock not public starport.
                        // Get a reference to our placeable (and door), and delete them with some VFX.
                        if (dock != null)
                        {
                            PCBase dockBase = DataService.PCBase.GetByID(dock.PCBaseID);

                            IEnumerable <NWArea> areas = NWModule.Get().Areas;
                            NWArea landingArea         = new NWArea(_.GetFirstArea());

                            foreach (var area in areas)
                            {
                                if (_.GetResRef(area) == dockBase.AreaResref)
                                {
                                    landingArea = area;
                                }
                            }

                            List <AreaStructure> areaStructures = landingArea.Data["BASE_SERVICE_STRUCTURES"];
                            foreach (var plc in areaStructures)
                            {
                                if (plc.PCBaseStructureID == dock.ID)
                                {
                                    // Found our dock.  Clear its variable and play some VFX.
                                    plc.Structure.SetLocalInt("DOCKED_STARSHIP", 0);
                                    DoDustClouds(plc.Structure.Location);
                                    _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Fnf_Screen_Shake), plc.Structure);
                                }
                                else if (plc.PCBaseStructureID == structure.ID)
                                {
                                    // found either our ship or our entrance (both are saved with our structure ID).  Delete them.
                                    // Dp NOT remove the PC base structure object from the database.  We still need that.
                                    plc.Structure.Destroy();
                                }
                            }
                        }
                    }
                }
                else if (response.Text == "Access Fuel Bay")
                {
                    OpenFuelBay(false);
                    EndConversation();
                }
                else if (response.Text == "Access Stronidium Bay")
                {
                    OpenFuelBay(true);
                    EndConversation();
                }
                else if (response.Text == "Access Resource Bay")
                {
                    NWPlaceable bay = SpaceService.GetCargoBay(player.Area, GetPC());
                    if (bay != null)
                    {
                        GetPC().AssignCommand(() => _.ActionInteractObject(bay.Object));
                    }
                    EndConversation();
                }
                else if (response.Text == "Export Starcharts")
                {
                    NWItem item = _.CreateItemOnObject("starcharts", player, 1, _.Random(10000).ToString());

                    // Initialise the list, in case it hasn't been populated yet.
                    SpaceService.GetHyperspaceDestinationList(pcBase);

                    item.SetLocalInt("Starcharts", (int)pcBase.Starcharts);
                }
            }
            else if (pageName == "HyperDestPage")
            {
                // Check fuel
                if (pcBase.Fuel < 50)
                {
                    GetPC().SendMessage("You don't have enough fuel! You need 50 fuel to make a hyperspace jump.");
                    dialog.ResetPage();
                }
                else
                {
                    // Fuel is good - make the jump
                    if (!SpaceService.DoPilotingSkillCheck(GetPC(), 13, carefulPilot))
                    {
                        // Failed our skill check.  Deduct fuel but don't do anything else.
                        GetPC().FloatingText("Jump failed!  You forgot to whatsit the thingummyjig.");
                        pcBase.Fuel -= 50;
                        DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);
                        EndConversation();
                        return;
                    }

                    // Move the ship out of the old orbit.
                    SpaceService.RemoveShipInSpace(player.Area);

                    // Fade to black for hyperspace.
                    EndConversation();
                    pcBase.Fuel        -= 50;
                    pcBase.ShipLocation = response.Text + " - Orbit";
                    DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);

                    // Put the ship in its new orbit.
                    SpaceService.CreateShipInSpace(player.Area);

                    // Give the impression of movement - would be great to have the actual hyperspace jump graphics here.
                    foreach (var creature in player.Area.Objects)
                    {
                        if (creature.IsPC || creature.IsDM)
                        {
                            _.FloatingTextStringOnCreature("Making a hyperspace jump!", creature);
                            _.FadeToBlack(creature, 0.5f);
                            _.DelayCommand(1.0f, () => { _.FadeFromBlack(creature, 0.5f); });
                        }
                    }
                }
            }
            else if (pageName == "LandingDestPage")
            {
                // Skill check.
                if (!SpaceService.DoPilotingSkillCheck(GetPC(), 5, carefulPilot))
                {
                    // Failed our skill check.  Land anyway but burn more fuel.
                    if (pcBase.Fuel > 0)
                    {
                        GetPC().FloatingText("You overshoot the landing spot, burning extra fuel getting your ship into position.");
                        pcBase.Fuel -= 1;
                        DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);
                    }
                }

                // Get the response, then find the structure ID.
                Guid dockStructureID = dialog.CustomData["LAND_" + response.Text];

                // This could be a public startport ID or a private dock base structure ID.
                Starport starport = DataService.Starport.GetByStarportIDOrDefault(dockStructureID);
                if (starport != null)
                {
                    // We have a public starport.
                    if (player.Gold < starport.Cost)
                    {
                        player.SendMessage("You do not have enough credits to land here.");
                        return;
                    }
                    else
                    {
                        _.TakeGoldFromCreature(starport.Cost, player, true);

                        // Land.
                        pcBase.ShipLocation = starport.StarportID.ToString();
                        pcBase.DateRentDue  = DateTime.UtcNow.AddDays(1);
                        DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);

                        // Notify PC.
                        player.SendMessage("You have paid your first day's berthing fees. Use the Base Management System to extend your lease if you plan to stay longer, or your ship will be impounded.");

                        EndConversation();
                    }
                }
                else
                {
                    LoggingService.Trace(TraceComponent.Space, "Landing in PC base dock, ID: " + dockStructureID.ToString());
                    PCBaseStructure dock = DataService.PCBaseStructure.GetByIDOrDefault(dockStructureID);

                    if (dock == null)
                    {
                        player.SendMessage("ERROR: Could not find landing dock by ID.  Please report this.");
                        LoggingService.Trace(TraceComponent.Space, "Could not find landing dock ID " + dockStructureID.ToString());
                        return;
                    }

                    NWPlaceable plc = BaseService.FindPlaceableFromStructureID(dock.ID.ToString());

                    if (plc == null)
                    {
                        LoggingService.Trace(TraceComponent.Space, "Failed to find dock placeable.");
                        player.SendMessage("ERROR: Could not find landing dock placeable.  Please report this.");
                        return;
                    }

                    LoggingService.Trace(TraceComponent.Space, "Found dock, landing ship.");

                    // We've found our dock. Update our record of where the ship's exterior should spawn.
                    NWLocation loc = plc.Location;

                    structure.LocationX           = loc.X;
                    structure.LocationY           = loc.Y;
                    structure.LocationZ           = loc.Z;
                    structure.LocationOrientation = _.GetFacingFromLocation(loc);

                    DataService.SubmitDataChange(structure, DatabaseActionType.Update);

                    // And update the base to mark the parent dock as the location.
                    pcBase.ShipLocation = dock.ID.ToString();
                    DataService.SubmitDataChange(pcBase, DatabaseActionType.Update);

                    // Now use the Base Service to spawn the ship exterior.
                    BaseService.SpawnStructure(plc.Area, structure.ID);

                    // Mark the dock as occupied.
                    plc.SetLocalInt("DOCKED_STARSHIP", 1);

                    // Notify PCs in the landing area.
                    foreach (var creature in plc.Area.Objects)
                    {
                        if (creature.IsPC || creature.IsDM)
                        {
                            _.FloatingTextStringOnCreature("A ship has just landed!", creature);
                        }
                    }

                    // And shake the screen, because stuff.
                    _.ApplyEffectAtLocation(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Fnf_Screen_Shake), loc);
                    DoDustClouds(loc);
                }

                // We're landing.  Make sure any pilot or gunner get out of flight mode.
                SpaceService.LandCrew(player.Area);

                // If we are still here, we landed successfully.  Shake the screen about and notify PCs on the ship.
                // Give the impression of movement
                foreach (var creature in player.Area.Objects)
                {
                    if (creature.IsPC || creature.IsDM)
                    {
                        _.FloatingTextStringOnCreature("The ship is landing.", creature);
                    }
                }

                _.ApplyEffectToObject(DurationType.Instant, _.EffectVisualEffect(VisualEffect.Vfx_Fnf_Screen_Shake), player);
                SpaceService.RemoveShipInSpace(player.Area);

                EndConversation();
            }
        }
Пример #43
0
 /// <summary>
 /// Fires the <see cref="DialogResultSelected"/> event.
 /// </summary>
 /// <param name="dialogResponse"></param>
 private void NotifyView(DialogResponse dialogResponse)
 {
     if (null != _dialogResultSelected)
         _dialogResultSelected(this, EventArgs.Empty);
 }
Пример #44
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     // parentGameMode.State = new PointsAwardHelp(parentGameMode, UserData);
     SetForm(typeof(PointsAwardHelp));
 }
Пример #45
0
 private void OnYes(object sender, RoutedEventArgs e)
 {
     DialogResult = true;
     Response     = DialogResponse.Yes;
     Close();
 }
Пример #46
0
 /// <summary>
 ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
 ///     common to attach another state, or remove the current state based on the response.
 /// </summary>
 /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
 protected override void OnDialogResponse(DialogResponse reponse)
 {
     FinishCrossing();
 }
Пример #47
0
 private void OnNo(object sender, RoutedEventArgs e)
 {
     DialogResult = false;
     Response     = DialogResponse.No;
     Close();
 }