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); }
internal void SelectGumpButton(string buttonLabel, GumpLabelPosition labelPosition) { lock (gumpLock) { if (CurrentGump != null) { new GumpResponseBuilder(CurrentGump, TriggerGump).PushButton(buttonLabel, labelPosition); } } }
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(); }
public SelectControlByLabelGumpParserProcessor(string controlLabel, GumpLabelPosition labelPosition, GumpControls targetControl) { this.controlLabel = controlLabel; this.labelPosition = labelPosition; this.targetControl = targetControl; }