SmartTableLayoutStore.h
Where a rearranged header is kept between sessions, and how it comes back.
The one line way in: layouts in the config file, keyed by table id.
Config and not a save game. A column width is a setting and not progress: it carries into a new game, and it never grows a save file.
GGameUserSettingsIni is the file UGameUserSettings writes resolution and quality into, so a packaged build reads and writes it wherever the game runs.
- Class
- USmartTableConfigLayoutStore
- Extends
- USmartTableLayoutStore
- Members
- 13
- Panel fields
- 2
Public functions 1
Protected functions 2
Private functions 3
Worked out on every call and never stored. With ConfigFileName empty, the answer follows GGameUserSettingsIni wherever the engine moves it.
Puts the disk write a short while after the last change, and drops any write already waiting.
A sort click, a hide, a menu move and every FRAME of a resize drag each count as a save. Writing the ini on each of those is a file write on the game thread in the middle of the drag.
The value is in GConfig the moment SaveLayout runs, so a load in the same session reads back what was just written whether the file has been touched yet or not.
Writes the ini and forgets the waiting write. Called by the timer and by BeginDestroy.
Public variables 2
The heading in the ini file that stored layouts sit under. One line per table id, and two stores pointed at two headings keep two sets of layouts apart.
Which ini file. Empty means the game settings ini, and that is right for nearly every table.
A game that files its settings somewhere of its own names that file here.
Private variables 2
Valid exactly while a write is waiting. ScheduleFlush replaces the timer behind it and never adds a second one.
The files already written to and not yet flushed. ConfigFileName is editable in the panel and can be set from a graph, so reading it again at flush time can name a file nothing ever went to. A set, since the name can move between two saves and both files are then owed a flush.
USmartTableLayoutStore class
Where the column layout of a table goes between sessions.
Nothing is set by default, and nothing is written anywhere. With a store set and a TableId on the table, a layout is read back as the table is built and written again on every change the table did itself.
A save game needs none of this. GetLayout and ApplyLayout give over an FSmartTableLayout whose every member is SaveGame, so it drops into a save file as one field.
EditInlineNew is what puts a store in the Details panel. LayoutStore is Instanced, and the panel builds one in place from the classes carrying that flag.
Public functions 2
False means nothing is on file for this id. A first run is the usual reason, and not a failure.
Called on every layout change the table did itself, and never on ApplyLayout.
SmartTable namespace
Public functions 1
Brings a layout just read from a store up to FSmartTableLayout::CurrentVersion. True when it arrived below that, which a caller can say once instead of on every load.
A version 0 file carries a width for every column, with nothing marking which of those a drag chose. Those widths go, and hiding, order and sort come through.
A version 1 file holds the drawn order inside Columns. Order is left empty here, since a store knows nothing about the table it loads for, and USmartTable::LoadStoredLayout fills it in.
Next: SmartTableSortKey.h