View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001586 | Spring engine | Lua | public | 2009-08-25 13:13 | 2016-02-13 17:15 |
| Reporter | MelTraX | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | not fixable | ||
| Product Version | 0.80.2.0 | ||||
| Summary | 0001586: add default values to GetModOptions() | ||||
| Description | If I understand the current behavior correctly, Spring.GetModOptions() returns the [modoptions] section of script.txt without any changes. If a modopion isn't set at all in script.txt, its default value is used. That value is not included in GetModOptions() in that case though. So if you want to know the value in a widget, you either have to hardcode the default value in the widget (bad if the default in modoptions.lua changes) or you have to read modoptions.lua yourself to find the default. While the engine would also have to read modoptions.lua to find the default, it's probably less work because it already has functions to do so and it would only be needed once per game and not once per widget. | ||||
| Tags | No tags attached. | ||||
| Checked infolog.txt for Errors | |||||
|
|
> While the engine would also have to read modoptions.lua to find the default, it's probably less work because it already has functions to do so and it would only be needed once per game and not once per widget. The complicating factor here is that this isn't true: the engine does not read modoptions.lua at all currently; all code dealing with *options.lua is in unitsync. |
|
|
so the solution is to instruct lobby defs to always write all options to script.txt, even if they are on the default? |
|
|
yes |