protected void DrawSaveFileName(Rect inRect) { DrawEntryHeader("Preset Files: Save mode", backgroundColor: Color.red); var fileNameRect = ListingStandard.GetRect(DefaultElementHeight); var fileNameLabelRect = fileNameRect.LeftPart(0.2f); Widgets.Label(fileNameLabelRect, "FileName:"); var fileNameTextRect = fileNameRect.RightPart(0.8f); if (string.IsNullOrEmpty(_selectedFileName)) { _selectedFileName = _userData.PresetManager.NextPresetFileName; } _selectedFileName = Widgets.TextField(fileNameTextRect, _selectedFileName); ListingStandard.GapLine(DefaultGapLineHeight); ListingStandard.CheckboxLabeled("Save Options", ref _saveOptions, "Check to also save options alongside filters."); ListingStandard.GapLine(DefaultGapLineHeight); DrawEntryHeader($"Author: [optional; {MaxAuthorNameLength} chars max]"); _presetAuthorSave = ListingStandard.TextEntry(_presetAuthorSave); if (_presetAuthorSave.Length >= MaxAuthorNameLength) { _presetAuthorSave = _presetAuthorSave.Substring(0, MaxAuthorNameLength); } ListingStandard.GapLine(DefaultGapLineHeight); DrawEntryHeader($"Description: [optional; {MaxDescriptionLength} chars max]"); var descriptionRect = ListingStandard.GetRect(80f); _presetDescriptionSave = Widgets.TextAreaScrollable(descriptionRect, _presetDescriptionSave, ref _scrollPosPresetDescription); if (_presetDescriptionSave.Length >= MaxDescriptionLength) { _presetDescriptionSave = _presetDescriptionSave.Substring(0, MaxDescriptionLength); } }
protected void DrawLoadPresetInfo(Rect inRect) { DrawEntryHeader("Preset Info:", backgroundColor: Color.green); if (_selectedItemIndex < 0) { return; } ListingStandard.TextEntryLabeled2("Preset Name:", _selectedFileName); var preset = _userData.PresetManager.PresetByPresetName(_selectedFileName); if (preset == null) { return; } ListingStandard.TextEntryLabeled2("Author:", preset.PresetInfo.Author); ListingStandard.Label("Description:"); var descriptionRect = ListingStandard.GetRect(80f); Widgets.TextAreaScrollable(descriptionRect, preset.PresetInfo.Description, ref _scrollPosPresetLoadDescription); ListingStandard.Label("Filters:"); const float maxOuterRectHeight = 130f; ListingStandard.ScrollableTextArea(maxOuterRectHeight, preset.PresetInfo.FilterInfo, ref _scrollPosPresetFilterInfo, _stylePresetInfo, DefaultScrollableViewShrinkWidth); ListingStandard.Label("Options:"); ListingStandard.ScrollableTextArea(maxOuterRectHeight, preset.PresetInfo.OptionInfo, ref _scrollPosPresetOptionInfo, _stylePresetInfo, DefaultScrollableViewShrinkWidth); }