Skip to content

Commit aa4741d

Browse files
committed
QOL changes to the Comme il Faut WF app, additionally Social Exchange IDs are now being properly produced
1 parent 68c0f24 commit aa4741d

7 files changed

+29
-20
lines changed

Assets/CommeillFaut/CommeillFautAsset.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ public Guid AddOrUpdateExchange(SocialExchangeDTO dto)
202202
{
203203

204204
var idx = m_SocialExchanges.FindIndex(x => x.Id == dto.Id);
205-
System.Guid actualID = new Guid();
205+
System.Guid actualId;
206206
if (idx < 0)
207207
{
208208
var se = new SocialExchange(dto);
209209
m_SocialExchanges.Add(se);
210-
actualID = se.Id;
210+
actualId = se.Id;
211211
}
212212
else
213213
{
@@ -218,11 +218,11 @@ public Guid AddOrUpdateExchange(SocialExchangeDTO dto)
218218
m_SocialExchanges[idx].Name = dto.Name;
219219
m_SocialExchanges[idx].Steps = m_SocialExchanges[idx].StringToSteps(dto.Steps);
220220
m_SocialExchanges[idx].InfluenceRules = dto.InfluenceRules.Select(x=>new InfluenceRule(x)).ToList();
221-
actualID = m_SocialExchanges[idx].Id;
221+
actualId = m_SocialExchanges[idx].Id;
222222

223223
}
224224

225-
return actualID;
225+
return actualId;
226226
}
227227

228228
public void RemoveSocialExchange(Guid id)
@@ -277,6 +277,11 @@ public void SetObjectData(ISerializationData dataHolder, ISerializationContext c
277277
{
278278

279279
m_SocialExchanges = new List<SocialExchange>(dataHolder.GetValue<SocialExchange[]>("SocialExchanges"));
280+
281+
foreach (var se in m_SocialExchanges)
282+
{
283+
se.Id = Guid.NewGuid();
284+
}
280285
}
281286

282287

Assets/CommeillFaut/SocialExchange.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace CommeillFaut
1414
public class SocialExchange : ICustomSerialization
1515
{
1616

17-
public Guid Id { get; private set; }
17+
public Guid Id { get; set; }
1818

1919
public string Description { get; set; }
2020

AuthoringTools/CommeillFautWF/AddInfluenceRule.Designer.cs

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AuthoringTools/CommeillFautWF/AddSocialExchange.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AuthoringTools/CommeillFautWF/AddSocialExchange.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ private void buttonAdd_Click(object sender, EventArgs e)
5454
dto.Description = textBoxDescription.Text;
5555
dto.Steps = stepsTextBox.Text;
5656
dto.Target = wfNameTarget.Value;
57-
UpdatedGuid = asset.AddOrUpdateExchange(dto);
57+
dto.Id = asset.AddOrUpdateExchange(dto);
58+
UpdatedGuid = dto.Id;
5859
Close();
5960
}
6061
catch (Exception ex)

AuthoringTools/CommeillFautWF/InfluenceRuleInspector.Designer.cs

+5-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AuthoringTools/CommeillFautWF/MainForm.cs

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ private void auxAddOrUpdateItem(SocialExchangeDTO item)
8585
{
8686
var diag = new AddSocialExchange(LoadedAsset, item);
8787
diag.ShowDialog(this);
88+
89+
8890
if (diag.UpdatedGuid != Guid.Empty)
8991
{
9092
// _socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList();
@@ -96,6 +98,7 @@ private void auxAddOrUpdateItem(SocialExchangeDTO item)
9698
EditorTools.HighlightItemInGrid<SocialExchangeDTO>
9799
(gridSocialExchanges, diag.UpdatedGuid);
98100
}
101+
_socialExchangeList.Refresh();
99102

100103
SetModified();
101104
}
@@ -120,6 +123,8 @@ private void buttonDuplicateSE_Click(object sender, EventArgs e)
120123
_socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList();
121124
EditorTools.HighlightItemInGrid<SocialExchangeDTO>(gridSocialExchanges, newRuleId);
122125
}
126+
127+
SetModified();
123128
}
124129

125130
private void buttonRemoveSE_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)