Exemple #1
0
        public GumpResponseBuilder SetTextEntry(string textEntryLabel, string value, GumpLabelPosition labelPosition)
        {
            var processor = new SelectControlByLabelGumpParserProcessor(textEntryLabel, labelPosition, GumpControls.TextEntry);
            var parser    = new GumpParser(processor);

            parser.Parse(gump);

            return(processor.SelectedControldId.HasValue ? SetTextEntry(processor.SelectedControldId.Value, value) : this);
        }
        public GumpResponseBuilder SetTextEntry(string textEntryLabel, string value, GumpLabelPosition labelPosition)
        {
            var processor = new SelectControlByLabelGumpParserProcessor(textEntryLabel, labelPosition, GumpControls.TextEntry);
            var parser    = new GumpParser(processor);

            parser.Parse(gump);

            if (processor.SelectedControldId.HasValue)
            {
                textEntries.Add(new Tuple <ushort, string>((ushort)processor.SelectedControldId.Value.Value, value));
            }

            return(this);
        }
        public GumpResponseBuilder SelectCheckBox(string checkBoxLabel, GumpLabelPosition labelPosition)
        {
            var processor = new SelectControlByLabelGumpParserProcessor(checkBoxLabel, labelPosition, GumpControls.CheckBox);
            var parser    = new GumpParser(processor);

            parser.Parse(gump);

            if (processor.SelectedControldId.HasValue)
            {
                return(SelectCheckBox(processor.SelectedControldId.Value));
            }

            return(this);
        }
        public void PushButton(string buttonLabel, GumpLabelPosition labelPosition)
        {
            var processor = new SelectControlByLabelGumpParserProcessor(buttonLabel, labelPosition, GumpControls.Button);
            var parser    = new GumpParser(processor);

            parser.Parse(gump);

            if (processor.SelectedControldId.HasValue)
            {
                new TriggerGumpResponse(gump, processor.SelectedControldId.Value, triggerGump, selectedCheckBoxes.ToArray(), textEntries.ToArray()).Execute();
                return;
            }

            new GumpFailureResponse(gump, $"Cannot find button '{buttonLabel}'.").Execute();
        }