Exemple #1
0
    bool DisplayDialog(Verb verb)
    {
        // Open dialog for choosing time
        DialogPage dialogPage = new DialogPage();

        dialogPage.SetTitle("Wait Time");

        dialogPage.AddInputPanel((input) => {
            double amount = -1;
            if (!double.TryParse(input, out amount))
            {
                return;
            }

            verb.Register(new Dictionary <string, object>()
            {
                { "duration", amount }
            }, true);
        });

        Dictionary <string, object> data = new Dictionary <string, object>();

        data["gameObject"] = verb.self;
        data["verb"]       = verb;
        data["label"]      = verb.displayLabel;

        data["duration"] = 10.0;
        dialogPage.AddEntry("10", () => { verb.Register(data, true); });
        data["duration"] = 20.0;
        dialogPage.AddEntry("20", () => { verb.Register(data, true); });
        data["duration"] = 100.0;
        dialogPage.AddEntry("100", () => { verb.Register(data, true); });
        data["duration"] = 250.0;
        dialogPage.AddEntry("250", () => { verb.Register(data, true); });
        data["duration"] = 500.0;
        dialogPage.AddEntry("500", () => { verb.Register(data, true); });
        data["duration"] = 1000.0;
        dialogPage.AddEntry("1000", () => { verb.Register(data, true); });
        data["duration"] = 2000.0;
        dialogPage.AddEntry("2000", () => { verb.Register(data, true); });
        data["duration"] = 4000.0;
        dialogPage.AddEntry("4000", () => { verb.Register(data, true); });
        data["duration"] = 10000.0;
        dialogPage.AddEntry("10000", () => { verb.Register(data, true); });

        WaywardManager.instance.AddPage(dialogPage, WaywardManager.instance.GetRelativeWindowPoint(0.5, 0.5));

        return(true);
    }
Exemple #2
0
    bool DisplayDialog(Verb verb)
    {
        // Open dialog for choosing time
        DialogPage dialogPage = new DialogPage();

        dialogPage.SetTitle("Action");

        dialogPage.AddInputPanel((input) => {
            verb.Register(new Dictionary <string, object>()
            {
                { "message", input }
            }, true);
        });

        WaywardManager.instance.AddPage(dialogPage, WaywardManager.instance.GetRelativeWindowPoint(0.5, 0.5));

        return(true);
    }