Skip to content

Commit

Permalink
Add support for makeup 1, 2 and skin type editing
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowth117 committed Jul 20, 2022
1 parent e7d9089 commit 16076db
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 65 deletions.
Expand Up @@ -43,6 +43,7 @@ public class CharacterMakingIndexHandler
public Dictionary<string, int> faceDict = new();
public Dictionary<string, int> faceTexDict = new();
public Dictionary<string, int> facePaintDict = new();
public Dictionary<string, int> skinDict = new();
public Dictionary<string, int> earDict = new();
public Dictionary<string, int> hornDict = new();
public Dictionary<string, int> teethDict = new();
Expand Down Expand Up @@ -70,6 +71,7 @@ public class CharacterMakingIndexHandler
public Dictionary<int, string> faceDictReverse = new();
public Dictionary<int, string> faceTexDictReverse = new();
public Dictionary<int, string> facePaintDictReverse = new();
public Dictionary<int, string> skinDictReverse = new();
public Dictionary<int, string> earDictReverse = new();
public Dictionary<int, string> hornDictReverse = new();
public Dictionary<int, string> teethDictReverse = new();
Expand Down Expand Up @@ -259,7 +261,10 @@ private void GenerateNameCache(bool writeToDisk = false)
faceTexDict = ProcessNames(textByCat, masterIdList, nameDicts, nameCache, "", null, cmx.faceTextureDict, out faceTexDictReverse, writeToDisk);

//***Face paint
facePaintDict = ProcessNames(textByCat, masterIdList, nameDicts, nameCache, "facepaint1", null, cmx.fcpDict, out facePaintDictReverse, writeToDisk);
facePaintDict = ProcessNames(textByCat, masterIdList, nameDicts, nameCache, "facepaint2", null, cmx.fcpDict, out facePaintDictReverse, writeToDisk);

//***NGS Skin
skinDict = ProcessNames(textByCat, masterIdList, nameDicts, nameCache, "skin", null, cmx.fcpDict, out skinDictReverse, writeToDisk);

//***Ear
earDict = ProcessNames(textByCat, masterIdList, nameDicts, nameCache, "ears", null, cmx.ngsEarDict, out earDictReverse, writeToDisk);
Expand Down
3 changes: 3 additions & 0 deletions CharFileLibrary/Character_Making_File_Tool/IceHandler.cs
Expand Up @@ -91,6 +91,9 @@ public unsafe static BitmapSource GetIconFromIce(string pso2_bin, int fileNum, s
case "leg_":
typeString = GetCastLegIconString(finalId);
break;
case "skin01_":
typeString = GetSkinIconString(finalId);
break;
default:
throw new Exception("Unexpected icon type!");
}
Expand Down
Expand Up @@ -215,7 +215,7 @@ public void GetCharacterModel(xxpGeneralReboot xxpIn, CharacterMakingIndex cmxIn
{
aqu.aquaModels[0].models[0].splitVSETPerMesh();
}
FbxExporter.ExportToFile(aqu.aquaModels[0].models[0], compositeBones, "C:/Test.fbx", true);
FbxExporter.ExportToFile(aqu.aquaModels[0].models[0], compositeBones, new List<AquaMotion>(), "C:/Test.fbx", new List<string>(), true);
}

public void ApplyProportions(List<TransformSet> props, AquaObject bodyModel, AquaNode aquaNode)
Expand Down
Binary file modified CharFileLibrary/Libraries/AquaLib/AquaModelLibrary.dll
Binary file not shown.
Binary file modified CharFileLibrary/Libraries/AquaLib/ZomboniLib.dll
Binary file not shown.
150 changes: 88 additions & 62 deletions NGS Salon Tool/MainWindow.xaml

Large diffs are not rendered by default.

47 changes: 46 additions & 1 deletion NGS Salon Tool/MainWindow.xaml.cs
Expand Up @@ -429,6 +429,9 @@ private void PartCheck()
int legPart = (int)xxpHandler.baseSLCT.legPart;
int bodyPaint = (int)xxpHandler.baseSLCT.bodyPaintPart;
int bodyPaint2 = (int)xxpHandler.baseSLCT2.bodyPaint2Part;
int skinPart = (int)xxpHandler.baseSLCTNGS.skinTextureSet;
int facePaint = (int)xxpHandler.baseSLCT.makeup1Part;
int facePaint2 = (int)xxpHandler.baseSLCT.makeup2Part;
int stickerPart = (int)xxpHandler.baseSLCT.stickerPart;
int hairPart = (int)xxpHandler.baseSLCT.hairPart;
int rightEyePart = (int)xxpHandler.baseSLCT.eyePart;
Expand Down Expand Up @@ -463,6 +466,9 @@ private void PartCheck()
AddPartIfMissing(legPart, cmxHandler.castLegDict, cmxHandler.castLegDictReverse);
AddPartIfMissing(bodyPaint, cmxHandler.bodyPaintDict, cmxHandler.bodyPaintDictReverse);
AddPartIfMissing(bodyPaint2, cmxHandler.bodyPaintDict, cmxHandler.bodyPaintDictReverse);
AddPartIfMissing(skinPart, cmxHandler.skinDict, cmxHandler.skinDictReverse);
AddPartIfMissing(facePaint, cmxHandler.facePaintDict, cmxHandler.facePaintDictReverse);
AddPartIfMissing(facePaint2, cmxHandler.facePaintDict, cmxHandler.facePaintDictReverse);
AddPartIfMissing(stickerPart, cmxHandler.stickerDict, cmxHandler.stickerDictReverse);
AddPartIfMissing(hairPart, cmxHandler.hairDict, cmxHandler.hairDictReverse);
AddPartIfMissing(rightEyePart, cmxHandler.eyeDict, cmxHandler.eyeDictReverse);
Expand Down Expand Up @@ -594,6 +600,9 @@ private void PartDropdowns()
eyelashesCB.SelectedIndex = eyelashesCB.Items.IndexOf(cmxHandler.eyelashDictReverse[(int)xxpHandler.baseSLCT.eyelashPart]);
faceModelCB.SelectedIndex = faceModelCB.Items.IndexOf(cmxHandler.faceDictReverse[(int)xxpHandler.baseSLCT.faceTypePart]);
faceTexCB.SelectedIndex = faceTexCB.Items.IndexOf(cmxHandler.faceTexDictReverse[(int)xxpHandler.baseSLCT.faceTexPart]);
facePaintCB.SelectedIndex = facePaintCB.Items.IndexOf(cmxHandler.facePaintDictReverse[(int)xxpHandler.baseSLCT.makeup1Part]);
facePaint2CB.SelectedIndex = facePaint2CB.Items.IndexOf(cmxHandler.facePaintDictReverse[(int)xxpHandler.baseSLCT.makeup2Part]);
skinCB.SelectedIndex = skinCB.Items.IndexOf(cmxHandler.skinDictReverse[(int)xxpHandler.baseSLCTNGS.skinTextureSet]);
earsCB.SelectedIndex = earsCB.Items.IndexOf(cmxHandler.earDictReverse[(int)xxpHandler.baseSLCTNGS.earsPart]);
hornsCB.SelectedIndex = hornsCB.Items.IndexOf(cmxHandler.hornDictReverse[(int)xxpHandler.baseSLCTNGS.hornPart]);
teethCB.SelectedIndex = teethCB.Items.IndexOf(cmxHandler.teethDictReverse[(int)xxpHandler.baseSLCTNGS.teethPart]);
Expand Down Expand Up @@ -656,6 +665,9 @@ private void LoadGameData()
leftEyeCB.ItemsSource = cmxHandler.eyeDict.Keys;
faceModelCB.ItemsSource = cmxHandler.faceDict.Keys;
faceTexCB.ItemsSource = cmxHandler.faceTexDict.Keys;
facePaintCB.ItemsSource = cmxHandler.facePaintDict.Keys;
facePaint2CB.ItemsSource = cmxHandler.facePaintDict.Keys;
skinCB.ItemsSource = cmxHandler.skinDict.Keys;
earsCB.ItemsSource = cmxHandler.earDict.Keys;
hornsCB.ItemsSource = cmxHandler.hornDict.Keys;
teethCB.ItemsSource = cmxHandler.teethDict.Keys;
Expand Down Expand Up @@ -936,7 +948,7 @@ private void EyebrowsSelectionChanged(object sender, SelectionChangedEventArgs e
eyebrowsIcon.Source = null;
return;
}
eyebrowsIcon.Source = IceHandler.GetIconFromIce(pso2_binDir, cmxHandler.eyebrowDict[text], CharacterMakingIndex.eyebrowsIcon);
eyebrowsIcon.Source = IceHandler.GetIconFromIce(pso2_binDir, cmxHandler.eyebrowDict[text], CharacterMakingIndex.eyeBrowsIcon);
xxpHandler.baseSLCT.eyebrowPart = (uint)cmxHandler.eyebrowDict[text];
}
private void EyelashesSelectionChanged(object sender, SelectionChangedEventArgs e)
Expand Down Expand Up @@ -979,6 +991,39 @@ private void FaceTexSelectionChanged(object sender, SelectionChangedEventArgs e)
}
xxpHandler.baseSLCT.faceTexPart = (uint)cmxHandler.faceTexDict[text];
}
private void FacePaintSelectionChanged(object sender, SelectionChangedEventArgs e)
{
string text = (sender as ComboBox).SelectedItem as string;
if (text == null)
{
facePaintIcon.Source = null;
return;
}
facePaintIcon.Source = IceHandler.GetIconFromIce(pso2_binDir, cmxHandler.facePaintDict[text], CharacterMakingIndex.facePaintIcon);
xxpHandler.baseSLCT.makeup1Part = (uint)cmxHandler.facePaintDict[text];
}
private void FacePaint2SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string text = (sender as ComboBox).SelectedItem as string;
if (text == null)
{
facePaint2Icon.Source = null;
return;
}
facePaint2Icon.Source = IceHandler.GetIconFromIce(pso2_binDir, cmxHandler.facePaintDict[text], CharacterMakingIndex.facePaintIcon);
xxpHandler.baseSLCT.makeup2Part = (uint)cmxHandler.facePaintDict[text];
}
private void SkinSelectionChanged(object sender, SelectionChangedEventArgs e)
{
string text = (sender as ComboBox).SelectedItem as string;
if (text == null)
{
skinIcon.Source = null;
return;
}
skinIcon.Source = IceHandler.GetIconFromIce(pso2_binDir, cmxHandler.skinDict[text], CharacterMakingIndex.skinIcon);
xxpHandler.baseSLCT.makeup2Part = (uint)cmxHandler.skinDict[text];
}
private void EarsSelectionChanged(object sender, SelectionChangedEventArgs e)
{
string text = (sender as ComboBox).SelectedItem as string;
Expand Down

0 comments on commit 16076db

Please sign in to comment.