Page MenuHomeWildfire Games

Get User Config Setting getUserConfigBool, getUserConfigString, getUserConfigNumber
Needs ReviewPublic

Authored by ffffffff on Jan 11 2018, 2:33 PM.

Details

Reviewers
elexis
Summary

Suggests.

getUserConfigBool, getUserConfigString, getUserConfigNumber(name)

replaces

Engine.ConfigDB_GetValue("user", name) !/===/== "true"
Engine.ConfigDB_GetValue("user", name)
+Engine.ConfigDB_GetValue("user", name)
Test Plan

test

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ffffffff created this revision.Jan 11 2018, 2:33 PM
ffffffff added inline comments.Jan 11 2018, 2:36 PM
binaries/data/mods/public/gui/prelobby/prelobby.js
48

might be only +

bb added a comment.Jan 11 2018, 6:19 PM

Don't see the benefit of adding this spaghetti

elexis added a subscriber: elexis.Jan 11 2018, 6:32 PM

It would be the getter pendant to the setter proposed in D1211. But the names should be really well chosen if so.

Also if we add a getter, we might want to add different getters, one for boolean values, one for numbers and one for strings. Maybe.

ffffffff updated this revision to Diff 5441.Jan 23 2018, 11:04 AM
ffffffff edited the summary of this revision. (Show Details)

Spaghetti update. Gains 479 chars. Name.

ffffffff retitled this revision from Suggest function readConfigSetting(name) to Suggest function readUserConfigSetting(name).Jan 23 2018, 11:05 AM
ffffffff planned changes to this revision.Jan 27 2018, 11:11 PM

getter
(22:48:11) elexis: getConfigThingBool
(22:48:13) elexis: getConfigThingString
(22:48:16) elexis: getConfigThingNumber
(22:48:21) elexis: !== "true" ist lame
(22:48:30) elexis: IMO

ffffffff updated this revision to Diff 5571.Jan 29 2018, 9:09 AM

3 getter

ffffffff added inline comments.Jan 29 2018, 4:03 PM
binaries/data/mods/public/gui/pregame/mainmenu.js
132

maybe spaces right

binaries/data/mods/public/gui/session/input.js
1218

Number check redundant.

return getUserConfigNumber("gui.session.batchtrainingsize") || 5;

Maybe whole function can be inlined.

binaries/data/mods/public/gui/session/session.js
1377

this function is a joke. used only once. inline and rid of lines

binaries/data/mods/public/gui/session/session.xml
43

interesting note compared to silhouttes this setting (and above) is not written to user config but kept temp in user config

ffffffff added inline comments.Jan 31 2018, 10:11 AM
binaries/data/mods/public/gui/session/session.xml
43

seems correct

ffffffff updated this revision to Diff 5699.Feb 7 2018, 4:05 PM
ffffffff edited reviewers, added: elexis; removed: bb.
ffffffff removed a subscriber: elexis.

can we finally commit that and overtake it into code so i don't have to rebase it all the time because it's coming new engine getValues calls in the code??

ffffffff retitled this revision from Suggest function readUserConfigSetting(name) to Get User Config Setting getUserConfigBool, getUserConfigString, getUserConfigNumber.Feb 7 2018, 4:09 PM
ffffffff edited the summary of this revision. (Show Details)
ffffffff added inline comments.Feb 7 2018, 4:58 PM
binaries/data/mods/public/gui/session/session.js
1377

ok keep

ffffffff added inline comments.Feb 9 2018, 12:40 AM
binaries/data/mods/public/gui/common/functions_utility.js
19

even possible to set as

const getUserConfigBool = name => Engine.ConfigDB_GetValue("user", name) === "true";