Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same NPCDialogDifficulty data #3

Open
Vitalick opened this issue Oct 16, 2021 · 0 comments
Open

Same NPCDialogDifficulty data #3

Vitalick opened this issue Oct 16, 2021 · 0 comments

Comments

@Vitalick
Copy link

Vitalick commented Oct 16, 2021

idx variable should be declared upper then cycle foreach (var npcDialogSectionProperty in typeof(NPCDialogSection).GetProperties())
In this moment every NPCDialogDifficulty in NPCDialogSection have same data

var skippedProperties = new string[] { "Header", "Length" };
foreach (var npcDialogSectionProperty in typeof(NPCDialogSection).GetProperties())
{
if (skippedProperties.Contains(npcDialogSectionProperty.Name)) continue;
NPCDialogDifficulty npcDialogDifficulty = new NPCDialogDifficulty();
int idx = 0;
foreach (var property in typeof(NPCDialogDifficulty).GetProperties())
{
NPCDialogData data = new NPCDialogData();
data.Introduction = bits[idx];
data.Congratulations = bits[idx + (0x18 * 8)];
idx++;
property.SetValue(npcDialogDifficulty, data);
}
npcDialogSectionProperty.SetValue(npcDialogSection, npcDialogDifficulty);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant