Page MenuHomeWildfire Games

Fix dropbox item load from config
ClosedPublic

Authored by vladislavbelov on Aug 19 2017, 8:22 PM.

Details

Reviewers
elexis
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP20003: Support numerical data in option dropdowns, as expected by the shadow map…
Summary

Config's GetValue always returns string, so if config.json values contains integers, the search by string in integers won't work.

Currently it doesn't work for the shadow quality dropbox.

Test Plan
  1. Change the shadow map quality
  2. Restart the game
  3. Check the value

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vladislavbelov created this revision.Aug 19 2017, 8:22 PM
vladislavbelov edited the summary of this revision. (Show Details)
Vulcan added a subscriber: Vulcan.Aug 19 2017, 9:10 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1882/ for more details.

elexis accepted this revision.Aug 19 2017, 9:34 PM

This bug was noticed after D745 expected dropdowns to work with integers.

I had assumed options.js to work as intended as it wasn't changed by the patch.
I tested the C++ code by changing the default.cfg value, because the game has to be restarted anyway after changing the setting.

That commit only uses numbers in the config because C++ doesn't support switch statements with string literals.
So we have to support integers with dropdown values unfortunately.
Hence patch correct.

Patch probably complete. There is only one hunk in that file that deals with dropdowns, and that is correct.
I recall some slider bug, but that's not the one in the scope of this revision proposal.

This revision is now accepted and ready to land.Aug 19 2017, 9:34 PM
vladislavbelov edited the summary of this revision. (Show Details)Aug 19 2017, 9:38 PM
This revision was automatically updated to reflect the committed changes.