Skip to content

Commit bc302b9

Browse files
committed
- Added 'Advanced...' button to the Appearance tab. (WIP)
- Resized and repositioned the appearance preset buttons to better fit with the quest facts tab design. - Fixed #30
1 parent 252d98e commit bc302b9

7 files changed

Lines changed: 350 additions & 61 deletions

File tree

CP2077SaveEditor/Utils/AppearanceHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public AppearanceGender BodyGender
6262
var playerPuppet = (PlayerPuppetPS)activeSave.GetPSDataContainer().ClassList.Where(x => x is PlayerPuppetPS).FirstOrDefault();
6363
if (value == AppearanceGender.Female)
6464
{
65-
playerPuppet.Gender = string.Empty;
65+
playerPuppet.Gender = "Female";
6666
if (!SuppressBodyGenderPrompt)
6767
{
6868
SetAllValues(JsonConvert.DeserializeObject<CharacterCustomizationAppearances>(CP2077SaveEditor.Properties.Resources.FemaleDefaultPreset));

CP2077SaveEditor/Views/AdvancedAppearanceDialog.Designer.cs

Lines changed: 151 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Drawing;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows.Forms;
10+
using CP2077SaveEditor.Extensions;
11+
using static CyberCAT.Core.Classes.NodeRepresentations.CharacterCustomizationAppearances;
12+
13+
namespace CP2077SaveEditor
14+
{
15+
public partial class AdvancedAppearanceDialog : Form
16+
{
17+
private Dictionary<string, HashValueEntry> options = new Dictionary<string, HashValueEntry>();
18+
private Form1 parent;
19+
20+
public AdvancedAppearanceDialog()
21+
{
22+
InitializeComponent();
23+
}
24+
25+
private void AdvancedAppearanceDialog_Load(object sender, EventArgs e)
26+
{
27+
parent = this.Owner as Form1;
28+
var container = Form1.activeSaveFile.GetAppearanceContainer();
29+
30+
foreach (var section in container.FirstSection.AppearanceSections)
31+
{
32+
foreach (var mainEntry in section.MainList)
33+
{
34+
options.Add("face/" + section.SectionName + "/" + mainEntry.SecondString, mainEntry);
35+
}
36+
}
37+
38+
foreach (var section in container.SecondSection.AppearanceSections)
39+
{
40+
foreach (var mainEntry in section.MainList)
41+
{
42+
options.Add("hands/" + section.SectionName + "/" + mainEntry.SecondString, mainEntry);
43+
}
44+
}
45+
46+
foreach (var section in container.ThirdSection.AppearanceSections)
47+
{
48+
foreach (var mainEntry in section.MainList)
49+
{
50+
options.Add("body/" + section.SectionName + "/" + mainEntry.SecondString, mainEntry);
51+
}
52+
}
53+
54+
optionsBox.Items.AddRange(options.Keys.ToArray());
55+
}
56+
57+
private void optionsBox_SelectedIndexChanged(object sender, EventArgs e)
58+
{
59+
if (optionsBox.SelectedItem != null)
60+
{
61+
HashValueEntry entry = options[(string)optionsBox.SelectedItem];
62+
63+
firstBox.Text = entry.FirstString;
64+
secondBox.Text = entry.SecondString;
65+
pathBox.Text = entry.GetPath();
66+
}
67+
}
68+
}
69+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<root>
2+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
3+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
4+
<xsd:element name="root" msdata:IsDataSet="true">
5+
<xsd:complexType>
6+
<xsd:choice maxOccurs="unbounded">
7+
<xsd:element name="metadata">
8+
<xsd:complexType>
9+
<xsd:sequence>
10+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
11+
</xsd:sequence>
12+
<xsd:attribute name="name" use="required" type="xsd:string" />
13+
<xsd:attribute name="type" type="xsd:string" />
14+
<xsd:attribute name="mimetype" type="xsd:string" />
15+
<xsd:attribute ref="xml:space" />
16+
</xsd:complexType>
17+
</xsd:element>
18+
<xsd:element name="assembly">
19+
<xsd:complexType>
20+
<xsd:attribute name="alias" type="xsd:string" />
21+
<xsd:attribute name="name" type="xsd:string" />
22+
</xsd:complexType>
23+
</xsd:element>
24+
<xsd:element name="data">
25+
<xsd:complexType>
26+
<xsd:sequence>
27+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
28+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
29+
</xsd:sequence>
30+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
31+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
32+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
33+
<xsd:attribute ref="xml:space" />
34+
</xsd:complexType>
35+
</xsd:element>
36+
<xsd:element name="resheader">
37+
<xsd:complexType>
38+
<xsd:sequence>
39+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
40+
</xsd:sequence>
41+
<xsd:attribute name="name" type="xsd:string" use="required" />
42+
</xsd:complexType>
43+
</xsd:element>
44+
</xsd:choice>
45+
</xsd:complexType>
46+
</xsd:element>
47+
</xsd:schema>
48+
<resheader name="resmimetype">
49+
<value>text/microsoft-resx</value>
50+
</resheader>
51+
<resheader name="version">
52+
<value>2.0</value>
53+
</resheader>
54+
<resheader name="reader">
55+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
56+
</resheader>
57+
<resheader name="writer">
58+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
59+
</resheader>
60+
</root>

0 commit comments

Comments
 (0)