Currently I use ini_file_ex from _g.script which has one major drawback
It parses the files in question when saving them.
This means that things like #include "presets\trade_discounts.ltx" get parsed - meaning in the resulting file this line is missing and instead the sections of the included file are present in the file.
This also concerns inheriting sections [supplies_1]:common_stock - in the final file it will just be [supplies_1] with the inherited values of section common_stock
It is also currently not possible to add new sections (only via vanilla anomaly methods), to change the "parent" sections a section inherits from or "include" any other ltx files
The Idea floating around in my head requires using luas IO Library to modify the LTX and keep them "unparsed" to so speak https://www.lua.org/pil/21.html
I'd have to reimplement a LTX parser that can
Modify lines
Overwrite / Replace a line
Add before / after a line
Search and Modify the section definition [supplies_1]:common_stock
Add Section to Inherit from [supplies_1]:common_stock,some_other_section
Remove Section to Inherit from [supplies_1]
Perhaps even Remove sections (not sure if that makes any sense)
Currently I use
ini_file_ex
from_g.script
which has one major drawbackThis means that things like
#include "presets\trade_discounts.ltx"
get parsed - meaning in the resulting file this line is missing and instead the sections of the included file are present in the file.This also concerns inheriting sections
[supplies_1]:common_stock
- in the final file it will just be[supplies_1]
with the inherited values of sectioncommon_stock
It is also currently not possible to add new sections (only via vanilla anomaly methods), to change the "parent" sections a section inherits from or "include" any other ltx files
The Idea floating around in my head requires using luas IO Library to modify the LTX and keep them "unparsed" to so speak https://www.lua.org/pil/21.html
I'd have to reimplement a LTX parser that can
[supplies_1]:common_stock
[supplies_1]:common_stock,some_other_section
[supplies_1]