예제 #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);
        }
예제 #2
0
 internal void SelectGumpButton(string buttonLabel, GumpLabelPosition labelPosition)
 {
     lock (gumpLock)
     {
         if (CurrentGump != null)
         {
             new GumpResponseBuilder(CurrentGump, TriggerGump).PushButton(buttonLabel, labelPosition);
         }
     }
 }
예제 #3
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);

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

            return(this);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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();
        }
 public SelectControlByLabelGumpParserProcessor(string controlLabel, GumpLabelPosition labelPosition, GumpControls targetControl)
 {
     this.controlLabel  = controlLabel;
     this.labelPosition = labelPosition;
     this.targetControl = targetControl;
 }