-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Feature Description
Restore Enhanced is an evolution of the original Smart! Restore feature that allows users to save and recall grid configuration presets with full CRUD operations (Create, Read, Update, Delete).
Original Restore Feature (Smart! Update 8)
The original implementation allowed users to save up to 10 numbered presets (0-9) containing:
- Grid counters (X, Y, Z)
- Spacing (X, Y, Z)
- Twirl/Rotation
- Levitation
- Steps (Up counter)
Users could press a hotkey (R + number key) to instantly apply a saved preset to the current hologram.
Restore Enhanced Improvements
New capabilities:
- Named Presets - Give presets descriptive names instead of just numbers (e.g., '5x5 Storage Grid', 'Manifold Row')
- Building Type Storage - Save the building class along with the configuration
- Example: Save 'Constructor 3x3' preset that remembers it's for constructors
- When recalled, could auto-switch to that building type (if available in inventory)
- Smart Panel Integration - Manage presets through the Smart Panel UI instead of just hotkeys
- Full CRUD Operations - Complete preset management:
- Create - Save new presets with custom names
- Read - View all saved presets with details
- Update - Edit existing preset names and settings
- Delete - Remove unwanted presets
- Extended Settings - Save additional configuration beyond the original 9 parameters
- Auto-connect settings (belt/pipe/power enabled states)
- Recipe selection (if applicable)
- Rotation mode
- Any other per-hologram settings
UI/UX Design - Full CRUD Interface
Smart Panel Tab: 'Presets'
Preset List View:
- Scrollable list showing all saved presets
- Each preset row displays:
- Preset name (editable inline)
- Building type icon
- Grid size preview (e.g., '3×3×1')
- Spacing preview (e.g., 'Spacing: 10m')
- Action buttons: Apply | Edit | Delete
CRUD Operations:
-
CREATE - Save New Preset
- Button: 'Save Current Configuration'
- Opens dialog:
- Text input: Preset name (required)
- Checkbox: 'Save building type' (default: checked)
- Checkbox: 'Save auto-connect settings' (default: checked)
- Checkbox: 'Save recipe' (if applicable)
- Preview of settings to be saved
- Buttons: Save | Cancel
-
READ - View Presets
- List view with all presets
- Click preset row to expand details:
- Full configuration display
- Building type
- All saved parameters
- Creation date
- Last modified date
- Search/filter bar to find presets by name or building type
-
UPDATE - Edit Preset
- Click 'Edit' button on preset row
- Opens edit dialog:
- Editable name
- Option to update settings from current hologram
- Option to manually adjust individual parameters
- Preview changes before saving
- Buttons: Save Changes | Cancel
- Inline name editing: Double-click preset name to rename
-
DELETE - Remove Preset
- Click 'Delete' button on preset row
- Confirmation dialog: 'Delete preset [name]? This cannot be undone.'
- Buttons: Delete | Cancel
- Optional: Bulk delete with multi-select
Additional Features:
- Duplicate Preset - Clone existing preset with new name
- Export/Import - Share presets with other players (JSON format)
- Preset Categories - Organize presets into folders (e.g., 'Foundations', 'Factories', 'Logistics')
- Quick Apply Hotkeys - Assign hotkeys to favorite presets (optional)
Workflow Examples
Creating a Preset:
- Configure hologram (e.g., 5×5 storage container grid with 10m spacing)
- Open Smart Panel → Presets tab
- Click 'Save Current Configuration'
- Enter name: 'Storage 5x5 - 10m spacing'
- Confirm settings → Click Save
- Preset appears in list
Updating a Preset:
- Find preset in list
- Click 'Edit' button
- Change name or click 'Update from Current Hologram'
- Preview changes
- Click 'Save Changes'
Deleting a Preset:
- Find preset in list
- Click 'Delete' button
- Confirm deletion
- Preset removed from list
Applying a Preset:
- Browse preset list
- Click 'Apply' button on desired preset
- Current hologram instantly configured with saved settings
- If building type was saved, optionally switch to that building
Technical Implementation Notes
Data Structure:
struct FSFRestoreEnhancedStruct
{
FGuid PresetID; // NEW: Unique identifier for CRUD operations
FString PresetName; // NEW: User-defined name
FDateTime CreatedAt; // NEW: Creation timestamp
FDateTime ModifiedAt; // NEW: Last modified timestamp
TSubclassOf<AFGBuildable> BuildingClass; // NEW: Building type (optional)
// Original settings
int ItemCounterX;
int ItemCounterY;
int ItemCounterZ;
int SpacingCounterX;
int SpacingCounterY;
int SpacingCounterZ;
int TwirlCounter;
int LevitationCounter;
int UpCounter;
// NEW: Extended settings
bool bSaveBuildingType;
bool bSaveAutoConnectSettings;
bool bSaveRecipe;
bool bBeltAutoConnectEnabled;
bool bPipeAutoConnectEnabled;
bool bPowerAutoConnectEnabled;
FString SavedRecipeName;
// ... other settings as needed
};CRUD Service Class:
class USFPresetManagementService
{
public:
// CREATE
FGuid CreatePreset(const FSFRestoreEnhancedStruct& PresetData);
// READ
TArray<FSFRestoreEnhancedStruct> GetAllPresets();
FSFRestoreEnhancedStruct GetPresetByID(const FGuid& PresetID);
TArray<FSFRestoreEnhancedStruct> SearchPresets(const FString& SearchQuery);
// UPDATE
bool UpdatePreset(const FGuid& PresetID, const FSFRestoreEnhancedStruct& UpdatedData);
bool RenamePreset(const FGuid& PresetID, const FString& NewName);
// DELETE
bool DeletePreset(const FGuid& PresetID);
bool DeleteMultiplePresets(const TArray<FGuid>& PresetIDs);
// UTILITY
bool DuplicatePreset(const FGuid& SourceID, const FString& NewName);
FString ExportPreset(const FGuid& PresetID);
FGuid ImportPreset(const FString& PresetJSON);
};Storage:
- Save to mod configuration file (persistent across sessions)
- Array of presets with unique GUIDs
- Automatic backup before modifications
- Validation on load (handle corrupted/missing data gracefully)
Original Implementation Reference:
SFSystem+Restore.cpp- Save/restore logicFSFRestoreStruct- Original data structureSFConfig.Restore- Array of 10 presets
Priority
Medium-High - Quality of life feature that significantly improves workflow for users who frequently switch between different building patterns.
Related Issues
- Original Restore feature was a beloved part of Smart! Update 8
- Complements existing Smart Panel functionality
- Could integrate with future 'Quick Build' or 'Template' systems
Success Criteria
CRUD Operations:
- Create - Users can save new named presets with building types and extended settings
- Read - Users can view all presets in a list with search/filter capabilities
- Update - Users can edit preset names and update settings from current hologram
- Delete - Users can remove presets with confirmation dialog
UI/UX:
- Presets managed through Smart Panel UI with dedicated tab
- Inline editing for preset names (double-click to rename)
- Confirmation dialogs for destructive operations (delete)
- Preview of settings before saving/updating
Functionality:
- Applying a preset instantly configures the hologram
- Presets persist across game sessions
- No hard limit on number of presets
- Duplicate preset feature for quick variations
- Export/Import presets as JSON for sharing
Quality:
- Backward compatible with existing Smart! configurations
- Graceful handling of corrupted/missing preset data
- Automatic backup before modifications
- Validation on preset load