11/* INI 格式捏脸转 LuaTable 格式 */
22
33// 读 Face 节下指定键的数值
4- function getFaceProperty ( ini , key , defaultValue = 0 ) {
4+ function getFaceProperty ( ini , key , defaultValue = 0 ) {
55 return parseInt ( ini [ "Face" ] [ key ] ) || defaultValue ;
66}
77
88// 读指定键的 Decal 数值组
99function getDecalSection ( ini , sectionName ) {
1010 let content = {
11- " bUse" : ! ! parseInt ( ini [ "CustomDetail" ] [ sectionName + "_valueEnable" ] ) ,
12- " nShowID" : parseInt ( ini [ "Decal" ] [ sectionName ] ) || 0 ,
13- " nColorID" : parseInt ( ini [ "Decal" ] [ sectionName + "_color" ] ) || 0 ,
14- " fValue1" : - 1 ,
15- " fValue2" : - 1 ,
16- " fValue3" : - 1
11+ bUse : ! ! parseInt ( ini [ "CustomDetail" ] [ sectionName + "_valueEnable" ] ) ,
12+ nShowID : parseInt ( ini [ "Decal" ] [ sectionName ] ) || 0 ,
13+ nColorID : parseInt ( ini [ "Decal" ] [ sectionName + "_color" ] ) || 0 ,
14+ fValue1 : - 1 ,
15+ fValue2 : - 1 ,
16+ fValue3 : - 1 ,
1717 } ;
18- if ( content [ "bUse" ] ) {
18+ if ( content [ "bUse" ] ) {
1919 content [ "fValue1" ] = parseFloat ( ini [ "CustomDetail" ] [ sectionName + "_value1" ] ) || 0 ;
2020 content [ "fValue2" ] = parseFloat ( ini [ "CustomDetail" ] [ sectionName + "_value2" ] ) || 0 ;
2121 content [ "fValue3" ] = parseFloat ( ini [ "CustomDetail" ] [ sectionName + "_value3" ] ) || 0 ;
@@ -26,81 +26,81 @@ function getDecalSection(ini, sectionName) {
2626// INI 格式转 LuaTable 格式
2727export function convertFaceIni ( ini ) {
2828 return {
29- "nRoleType" : parseInt ( ini [ "Base" ] [ "RoleType" ] ) ,
30- "nDecorationID" : parseInt ( ini [ "Base" ] [ "DecorationID" ] ) ,
31- "tDecal" : {
32- "BASE" : getDecalSection ( ini , "FaceBaseTexture" ) ,
33- "BROW" : getDecalSection ( ini , "Brow" ) ,
34- "EYE_LIGHT" : getDecalSection ( ini , "EyeLight" ) ,
35- "EYE_LINE" : getDecalSection ( ini , "EyeLine" ) ,
36- "EYE_SHADOW" : getDecalSection ( ini , "EyeShadow" ) ,
37- "EYE_SHADOW1" : getDecalSection ( ini , "EyeShadow1" ) ,
38- "EYE_SHADOW2" : getDecalSection ( ini , "EyeShadow2" ) ,
39- "EYE_SHADOW3" : getDecalSection ( ini , "EyeShadow3" ) ,
40- "EYE_SHADOW4" : getDecalSection ( ini , "EyeShadow4" ) ,
41- "EYE_SHADOW_FLASH1" : getDecalSection ( ini , "EyeShadowFlash1" ) ,
42- "EYE_SHADOW_FLASH2" : getDecalSection ( ini , "EyeShadowFlash2" ) ,
43- "EYE_SHADOW_FLASH3" : getDecalSection ( ini , "EyeShadowFlash3" ) ,
44- "EYE_SHADOW_FLASH4" : getDecalSection ( ini , "EyeShadowFlash4" ) ,
45- "LIP_LIGHT" : getDecalSection ( ini , "LipLight" ) ,
46- "LIP_FLASH" : getDecalSection ( ini , "LipFlash" ) ,
47- "LIP_GLOSS" : getDecalSection ( ini , "LipGloss" ) ,
48- "LIP_OVERLAP" :getDecalSection ( ini , "LipOverlap" ) ,
49- "IRIS_LEFT" : getDecalSection ( ini , "IrisLeft" ) ,
50- "IRIS_RIGHT" : getDecalSection ( ini , "IrisRight" ) ,
51- "BLUSHER_MOUSTACHE" : getDecalSection ( ini , "BlusherMoustache" ) ,
52- "DECAL" : getDecalSection ( ini , "Decal" )
29+ nRoleType : parseInt ( ini [ "Base" ] [ "RoleType" ] ) ,
30+ nDecorationID : parseInt ( ini [ "Base" ] [ "DecorationID" ] ) ,
31+ tDecal : {
32+ BASE : getDecalSection ( ini , "FaceBaseTexture" ) ,
33+ BROW : getDecalSection ( ini , "Brow" ) ,
34+ EYE_LIGHT : getDecalSection ( ini , "EyeLight" ) ,
35+ EYE_LINE : getDecalSection ( ini , "EyeLine" ) ,
36+ EYE_SHADOW : getDecalSection ( ini , "EyeShadow" ) ,
37+ EYE_SHADOW1 : getDecalSection ( ini , "EyeShadow1" ) ,
38+ EYE_SHADOW2 : getDecalSection ( ini , "EyeShadow2" ) ,
39+ EYE_SHADOW3 : getDecalSection ( ini , "EyeShadow3" ) ,
40+ EYE_SHADOW4 : getDecalSection ( ini , "EyeShadow4" ) ,
41+ EYE_SHADOW_FLASH1 : getDecalSection ( ini , "EyeShadowFlash1" ) ,
42+ EYE_SHADOW_FLASH2 : getDecalSection ( ini , "EyeShadowFlash2" ) ,
43+ EYE_SHADOW_FLASH3 : getDecalSection ( ini , "EyeShadowFlash3" ) ,
44+ EYE_SHADOW_FLASH4 : getDecalSection ( ini , "EyeShadowFlash4" ) ,
45+ LIP_LIGHT : getDecalSection ( ini , "LipLight" ) ,
46+ LIP_FLASH : getDecalSection ( ini , "LipFlash" ) ,
47+ LIP_GLOSS : getDecalSection ( ini , "LipGloss" ) ,
48+ LIP_OVERLAP : getDecalSection ( ini , "LipOverlap" ) ,
49+ IRIS_LEFT : getDecalSection ( ini , "IrisLeft" ) ,
50+ IRIS_RIGHT : getDecalSection ( ini , "IrisRight" ) ,
51+ BLUSHER_MOUSTACHE : getDecalSection ( ini , "BlusherMoustache" ) ,
52+ DECAL : getDecalSection ( ini , "Decal" ) ,
53+ } ,
54+ tBone : {
55+ NOSE_SIZE : getFaceProperty ( ini , "noseSize" ) ,
56+ UP_LIP_OUT : getFaceProperty ( ini , "upLipOut" ) ,
57+ NOSEBOW_WIDTH : getFaceProperty ( ini , "nosebowWidth" ) ,
58+ MOUTH_OPEN : getFaceProperty ( ini , "mouthOpen" ) ,
59+ CHEEK_Y : getFaceProperty ( ini , "cheekY" ) ,
60+ EYE_OPEN : getFaceProperty ( ini , "eyeOpen" ) ,
61+ FACE_Y : getFaceProperty ( ini , "faceY" ) ,
62+ MOUTH_END_L : getFaceProperty ( ini , "mouthEndL" ) ,
63+ JAW_LENGTH : getFaceProperty ( ini , "jawLength" ) ,
64+ UP_LIP : getFaceProperty ( ini , "upLip" ) ,
65+ EYE_DIST : getFaceProperty ( ini , "eyeDist" ) ,
66+ NOSETOP_POS_Y : getFaceProperty ( ini , "nosetopPosY" ) ,
67+ EYE_DIRC : getFaceProperty ( ini , "eyeDirc" ) ,
68+ EYEBOW_OUT : getFaceProperty ( ini , "eyebowOut" ) ,
69+ MOUTH_OUT : getFaceProperty ( ini , "mouthOut" ) ,
70+ RIDGE_Y : getFaceProperty ( ini , "ridgeY" ) ,
71+ MOUTH_END : getFaceProperty ( ini , "mouthEnd" ) ,
72+ NOSEBOW_BEND : getFaceProperty ( ini , "nosebowBend" ) ,
73+ JAW_WIDTH : getFaceProperty ( ini , "jawWidth" ) ,
74+ LOW_LIP_POS : getFaceProperty ( ini , "lowLipPos" ) ,
75+ PUPIL_DIRC : getFaceProperty ( ini , "pupilDirc" ) ,
76+ NOSETOP_POS_Z : getFaceProperty ( ini , "nosetopPosZ" ) ,
77+ MOUTH_POS : getFaceProperty ( ini , "mouthPos" ) ,
78+ MOUTH_SIZE : getFaceProperty ( ini , "mouthSize" ) ,
79+ LOW_LIP : getFaceProperty ( ini , "lowLip" ) ,
80+ FACE_Z : getFaceProperty ( ini , "faceZ" ) ,
81+ NOSETOP_WIDTH : getFaceProperty ( ini , "nosetopWidth" ) ,
82+ UP_FACE : getFaceProperty ( ini , "upFace" ) ,
83+ UP_LID_POS : getFaceProperty ( ini , "upLidPos" ) ,
84+ EYEBOW_POS : getFaceProperty ( ini , "eyebowPos" ) ,
85+ EYEBOW_DIRC : getFaceProperty ( ini , "eyebowDirc" ) ,
86+ UP_LIP_POS : getFaceProperty ( ini , "upLipPos" ) ,
87+ LOW_LIP_OUT : getFaceProperty ( ini , "lowLipOut" ) ,
88+ MOUTH_ROT : getFaceProperty ( ini , "mouthRot" ) ,
89+ EYE_SIZE : getFaceProperty ( ini , "eyeSize" ) ,
90+ EYE_POS : getFaceProperty ( ini , "eyePos" ) ,
91+ JAW_ROT : getFaceProperty ( ini , "jawRot" ) ,
92+ JAW_END : getFaceProperty ( ini , "jawEnd" ) ,
93+ EYECROW_Y : getFaceProperty ( ini , "eyecrowY" ) ,
94+ NOSETOP_UP : getFaceProperty ( ini , "nosetopUp" ) ,
95+ MOUTH_END_R : getFaceProperty ( ini , "mouthEndR" ) ,
96+ OUT : getFaceProperty ( ini , "out" ) ,
97+ JAW_POS : getFaceProperty ( ini , "jawPos" ) ,
98+ LOW_FACE : getFaceProperty ( ini , "lowFace" ) ,
99+ CHEEK_Z : getFaceProperty ( ini , "cheekZ" ) ,
100+ PUPIL_SIZE : getFaceProperty ( ini , "pupilSize" ) ,
101+ FACE_SCALE : getFaceProperty ( ini , "faceScale" ) ,
102+ NOSE_HEIGHT : getFaceProperty ( ini , "noseHeight" ) ,
103+ LOW_LID_POS : getFaceProperty ( ini , "lowLidPos" ) ,
53104 } ,
54- "tBone" : {
55- "NOSE_SIZE" : getFaceProperty ( ini , "noseSize" ) ,
56- "UP_LIP_OUT" : getFaceProperty ( ini , "upLipOut" ) ,
57- "NOSEBOW_WIDTH" : getFaceProperty ( ini , "nosebowWidth" ) ,
58- "MOUTH_OPEN" : getFaceProperty ( ini , "mouthOpen" ) ,
59- "CHEEK_Y" : getFaceProperty ( ini , "cheekY" ) ,
60- "EYE_OPEN" : getFaceProperty ( ini , "eyeOpen" ) ,
61- "FACE_Y" : getFaceProperty ( ini , "faceY" ) ,
62- "MOUTH_END_L" : getFaceProperty ( ini , "mouthEndL" ) ,
63- "JAW_LENGTH" : getFaceProperty ( ini , "jawLength" ) ,
64- "UP_LIP" : getFaceProperty ( ini , "upLip" ) ,
65- "EYE_DIST" : getFaceProperty ( ini , "eyeDist" ) ,
66- "NOSETOP_POS_Y" : getFaceProperty ( ini , "nosetopPosY" ) ,
67- "EYE_DIRC" : getFaceProperty ( ini , "eyeDirc" ) ,
68- "EYEBOW_OUT" : getFaceProperty ( ini , "eyebowOut" ) ,
69- "MOUTH_OUT" : getFaceProperty ( ini , "mouthOut" ) ,
70- "RIDGE_Y" : getFaceProperty ( ini , "ridgeY" ) ,
71- "MOUTH_END" : getFaceProperty ( ini , "mouthEnd" ) ,
72- "NOSEBOW_BEND" : getFaceProperty ( ini , "nosebowBend" ) ,
73- "JAW_WIDTH" : getFaceProperty ( ini , "jawWidth" ) ,
74- "LOW_LIP_POS" : getFaceProperty ( ini , "lowLipPos" ) ,
75- "PUPIL_DIRC" : getFaceProperty ( ini , "pupilDirc" ) ,
76- "NOSETOP_POS_Z" : getFaceProperty ( ini , "nosetopPosZ" ) ,
77- "MOUTH_POS" : getFaceProperty ( ini , "mouthPos" ) ,
78- "MOUTH_SIZE" : getFaceProperty ( ini , "mouthSize" ) ,
79- "LOW_LIP" : getFaceProperty ( ini , "lowLip" ) ,
80- "FACE_Z" : getFaceProperty ( ini , "faceZ" ) ,
81- "NOSETOP_WIDTH" : getFaceProperty ( ini , "nosetopWidth" ) ,
82- "UP_FACE" : getFaceProperty ( ini , "upFace" ) ,
83- "UP_LID_POS" : getFaceProperty ( ini , "upLidPos" ) ,
84- "EYEBOW_POS" : getFaceProperty ( ini , "eyebowPos" ) ,
85- "EYEBOW_DIRC" : getFaceProperty ( ini , "eyebowDirc" ) ,
86- "UP_LIP_POS" : getFaceProperty ( ini , "upLipPos" ) ,
87- "LOW_LIP_OUT" : getFaceProperty ( ini , "lowLipOut" ) ,
88- "MOUTH_ROT" : getFaceProperty ( ini , "mouthRot" ) ,
89- "EYE_SIZE" : getFaceProperty ( ini , "eyeSize" ) ,
90- "EYE_POS" : getFaceProperty ( ini , "eyePos" ) ,
91- "JAW_ROT" : getFaceProperty ( ini , "jawRot" ) ,
92- "JAW_END" : getFaceProperty ( ini , "jawEnd" ) ,
93- "EYECROW_Y" : getFaceProperty ( ini , "eyecrowY" ) ,
94- "NOSETOP_UP" : getFaceProperty ( ini , "nosetopUp" ) ,
95- "MOUTH_END_R" : getFaceProperty ( ini , "mouthEndR" ) ,
96- "OUT" : getFaceProperty ( ini , "out" ) ,
97- "JAW_POS" : getFaceProperty ( ini , "jawPos" ) ,
98- "LOW_FACE" : getFaceProperty ( ini , "lowFace" ) ,
99- "CHEEK_Z" : getFaceProperty ( ini , "cheekZ" ) ,
100- "PUPIL_SIZE" : getFaceProperty ( ini , "pupilSize" ) ,
101- "FACE_SCALE" : getFaceProperty ( ini , "faceScale" ) ,
102- "NOSE_HEIGHT" : getFaceProperty ( ini , "noseHeight" ) ,
103- "LOW_LID_POS" : getFaceProperty ( ini , "lowLidPos" )
104- }
105105 } ;
106106}
0 commit comments