Iterator character for ini keys
Bug #895535 reported by
pd
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ares |
Fix Released
|
Wishlist
|
pd |
Bug Description
I would like to propose the introduction of an iterator character for ini keys.
Let me start off with an example, which might already explain it:
[InfantryTypes]
+=E1
+=E2
+=SHK
...
The idea is to simplify list sections especially.
The iterator character (I propose '+'), if found in an ini key name, is replaced by "the next free number" in that section.
Pseudo-code:
int i = 0;
for(i = 0; sectionExists(
keyName = keyName.
This would be exceptionally useful when dealing with multiple included ini files, as you would not have to hunt and peck through all your inis in order to find out whether a key (an index) is already in use.
To post a comment you must log in.
Don't the arrays enumerate automatically anyway?
If I place
[InfantryTypes]
BATMAN=BATMAN
SUPERMAN=SUPERMAN
IRONMAN=IRONMAN
doesn't the game convert it to
[InfantryTypes]
0=BATMAN
1=SUPERMAN
2=IRONMAN
anyway?
With that in mind, there is really no big difference between pressing "+" once, and holding down random keys for random amounts of time.
I'll be just as quick typing
[InfantryTypes]
+=BATMAN
+=SUPERMAN
+=IRONMAN
as I'll be typing
[InfantryTypes]
qqqq=BATMAN
aaa=SUPERMAN
vvvvvvvvv=IRONMAN
If you do want to simplify listing, would it not be more efficient and more of an actual change to change the recognition pattern to something like ^([^;\s]+), that is, simply allow lists like
[InfantryTypes]
BATMAN
SUPERMAN ; this is a comment and should not be recognized
IRONMAN
?
Strikes me as a better ideal to strive for. *shrugs*