Skip to content

Commit 0afa199

Browse files
authored
Update __formSettings.js
1 parent 1c1eda6 commit 0afa199

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/Workspace/Resources/__formSettings.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,31 @@ Workspace.newF("__formSettings", function(cl, settings) {
66

77
// translate something like m_OcclusionBakeSettings to occlusionBakeSettings
88
fixSettings = fixSettings.mapKeys( (k, v) => {
9+
10+
// removing the m_ and making the first letter lowercase
911
let fixed = k.replace("m_", ""); // remove the m_
1012
fixed = fixed.split(""); // split it up
1113
if (fixed[1].toUpperCase() != fixed[1]) fixed[0] = fixed[0].toLowerCase(); // if the 2nd character isn't capital turn the first to lowercase
12-
return fixed.join("");
14+
15+
let fixedStr = fixed.join("")
16+
.replace(":", ""); // also remove : from the string
17+
18+
19+
if (fixedStr.includes(" ")) {
20+
fixedStr = fixedStr.split(" ");
21+
fixedStr = fixedStr.map( (str, i ) => {
22+
if (i > 0) {
23+
str = str.split("");
24+
str[0] = str[0].toUpperCase();
25+
return str.join("");
26+
}
27+
else return str;
28+
});
29+
fixedStr = fixedStr.join("");
30+
}
31+
32+
// return the joined string
33+
return fixedStr
1334
});
1435

1536
// turn everything into unityscript objects

0 commit comments

Comments
 (0)