Skip to content

Commit

Permalink
QOL changes to the Comme il Faut WF app, additionally Social Exchange…
Browse files Browse the repository at this point in the history
… IDs are now being properly produced
  • Loading branch information
Rexrex committed Oct 8, 2018
1 parent 68c0f24 commit aa4741d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 20 deletions.
13 changes: 9 additions & 4 deletions Assets/CommeillFaut/CommeillFautAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ public Guid AddOrUpdateExchange(SocialExchangeDTO dto)
{

var idx = m_SocialExchanges.FindIndex(x => x.Id == dto.Id);
System.Guid actualID = new Guid();
System.Guid actualId;
if (idx < 0)
{
var se = new SocialExchange(dto);
m_SocialExchanges.Add(se);
actualID = se.Id;
actualId = se.Id;
}
else
{
Expand All @@ -218,11 +218,11 @@ public Guid AddOrUpdateExchange(SocialExchangeDTO dto)
m_SocialExchanges[idx].Name = dto.Name;
m_SocialExchanges[idx].Steps = m_SocialExchanges[idx].StringToSteps(dto.Steps);
m_SocialExchanges[idx].InfluenceRules = dto.InfluenceRules.Select(x=>new InfluenceRule(x)).ToList();
actualID = m_SocialExchanges[idx].Id;
actualId = m_SocialExchanges[idx].Id;

}

return actualID;
return actualId;
}

public void RemoveSocialExchange(Guid id)
Expand Down Expand Up @@ -277,6 +277,11 @@ public void SetObjectData(ISerializationData dataHolder, ISerializationContext c
{

m_SocialExchanges = new List<SocialExchange>(dataHolder.GetValue<SocialExchange[]>("SocialExchanges"));

foreach (var se in m_SocialExchanges)
{
se.Id = Guid.NewGuid();
}
}


Expand Down
2 changes: 1 addition & 1 deletion Assets/CommeillFaut/SocialExchange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace CommeillFaut
public class SocialExchange : ICustomSerialization
{

public Guid Id { get; private set; }
public Guid Id { get; set; }

public string Description { get; set; }

Expand Down
10 changes: 5 additions & 5 deletions AuthoringTools/CommeillFautWF/AddInfluenceRule.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AuthoringTools/CommeillFautWF/AddSocialExchange.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion AuthoringTools/CommeillFautWF/AddSocialExchange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ private void buttonAdd_Click(object sender, EventArgs e)
dto.Description = textBoxDescription.Text;
dto.Steps = stepsTextBox.Text;
dto.Target = wfNameTarget.Value;
UpdatedGuid = asset.AddOrUpdateExchange(dto);
dto.Id = asset.AddOrUpdateExchange(dto);
UpdatedGuid = dto.Id;
Close();
}
catch (Exception ex)
Expand Down
12 changes: 5 additions & 7 deletions AuthoringTools/CommeillFautWF/InfluenceRuleInspector.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions AuthoringTools/CommeillFautWF/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ private void auxAddOrUpdateItem(SocialExchangeDTO item)
{
var diag = new AddSocialExchange(LoadedAsset, item);
diag.ShowDialog(this);


if (diag.UpdatedGuid != Guid.Empty)
{
// _socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList();
Expand All @@ -96,6 +98,7 @@ private void auxAddOrUpdateItem(SocialExchangeDTO item)
EditorTools.HighlightItemInGrid<SocialExchangeDTO>
(gridSocialExchanges, diag.UpdatedGuid);
}
_socialExchangeList.Refresh();

SetModified();
}
Expand All @@ -120,6 +123,8 @@ private void buttonDuplicateSE_Click(object sender, EventArgs e)
_socialExchangeList.DataSource = LoadedAsset.GetAllSocialExchanges().ToList();
EditorTools.HighlightItemInGrid<SocialExchangeDTO>(gridSocialExchanges, newRuleId);
}

SetModified();
}

private void buttonRemoveSE_Click(object sender, EventArgs e)
Expand Down

0 comments on commit aa4741d

Please sign in to comment.