Skip to content

Commit 25423e8

Browse files
committedSep 13, 2016
- Applied minor tweaks and fixes
1 parent 72a5739 commit 25423e8

File tree

17 files changed

+68
-48
lines changed

17 files changed

+68
-48
lines changed
 

‎Assets/EmotionalAppraisal/AppraisalRules/AppraisalRule.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ namespace EmotionalAppraisal.AppraisalRules
1313
/// @author João Dias
1414
/// @author Pedro Gonçalves
1515
[Serializable]
16-
public class AppraisalRule : BaseDomainObject
16+
public class AppraisalRule
1717
{
18-
public Name EventName { get; set; }
18+
[NonSerialized]
19+
private Guid m_id;
20+
21+
public Guid Id { get { return m_id; } set { m_id = value; } }
22+
public Name EventName { get; set; }
1923
public ConditionSet Conditions { get; set; }
2024

2125
public AppraisalRule(Name eventName, ConditionSet conditions = null)
@@ -25,8 +29,9 @@ public AppraisalRule(Name eventName, ConditionSet conditions = null)
2529
Desirability = Praiseworthiness = 0;
2630
}
2731

28-
public AppraisalRule(AppraisalRuleDTO appraisalRuleDTO) :base(appraisalRuleDTO.Id)
32+
public AppraisalRule(AppraisalRuleDTO appraisalRuleDTO)
2933
{
34+
m_id = appraisalRuleDTO.Id;
3035
EventName = Name.BuildName(appraisalRuleDTO.EventMatchingTemplate);
3136
Desirability = appraisalRuleDTO.Desirability;
3237
Praiseworthiness = appraisalRuleDTO.Praiseworthiness;
@@ -37,8 +42,9 @@ public AppraisalRule(AppraisalRuleDTO appraisalRuleDTO) :base(appraisalRuleDTO.I
3742
/// Clone Constructor
3843
/// </summary>
3944
/// <param name="other">the reaction to clone</param>
40-
public AppraisalRule(AppraisalRule other) : base(other.Id)
45+
public AppraisalRule(AppraisalRule other)
4146
{
47+
m_id = other.m_id;
4248
EventName = other.EventName;
4349
Conditions = new ConditionSet(other.Conditions);
4450
Desirability = other.Desirability;

‎Assets/EmotionalAppraisal/AppraisalRules/ReactiveAppraisalDerivator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ public void SetObjectData(ISerializationData dataHolder, ISerializationContext c
211211

212212
foreach (var r in rules)
213213
{
214+
r.Id = Guid.NewGuid();
214215
AddEmotionalReaction(r);
215216
}
216217
}

‎Assets/EmotionalAppraisal/BaseDomainObject.cs

-24
This file was deleted.

‎Assets/EmotionalAppraisal/EmotionalAppraisal.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
<Compile Include="ActiveEmotion.cs" />
4141
<Compile Include="AppraisalRules\AppraisalRule.cs" />
4242
<Compile Include="AppraisalRules\ReactiveAppraisalDerivator.cs" />
43-
<Compile Include="BaseDomainObject.cs" />
4443
<Compile Include="BaseEmotion.cs" />
4544
<Compile Include="Components\IAffectDerivator.cs" />
4645
<Compile Include="Components\IAppraisalDerivator.cs" />

‎Assets/IntegratedAuthoringTool/IntegratedAuthoringToolAsset.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ public void SetObjectData(ISerializationData dataHolder, ISerializationContext c
303303
{
304304
m_agentDialogues = new List<DialogStateAction>(agentDialogueArray.Select(dto => new DialogStateAction(dto)));
305305
}
306-
}
306+
307+
m_dialogueStates = new Dictionary<string, string>();
308+
}
307309

308310
#endregion
309311

‎Components/Utilities/export.bat ‎Assets/SocialImportance/export.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22
SET debugPath=bin\Debug
3-
SET debugInclude=*.dll *.pdb
3+
SET debugInclude=*.dll *.pdb *.mdb
44
SET releasePath=bin\Release
55
SET releaseInclude=*.dll
66

‎Components/WellFormedNames/Implementation/ComposedName.cs

+5-9
Original file line numberDiff line numberDiff line change
@@ -180,23 +180,19 @@ public override bool Equals(Name name)
180180

181181
public override bool Match(Name name)
182182
{
183-
var other = name as ComposedName;
184-
if (other == null)
185-
return false;
183+
if (name.IsUniversal)
184+
return true;
186185

187-
if (other.Terms.Length != Terms.Length)
186+
var other = name as ComposedName;
187+
if (other?.Terms.Length != Terms.Length)
188188
return false;
189189

190190
if (!other.RootSymbol.Match(RootSymbol))
191191
{
192192
return false;
193193
}
194194

195-
for (int i = 0; i < Terms.Length; i++)
196-
if (!Terms[i].Match(other.Terms[i]))
197-
return false;
198-
199-
return true;
195+
return !Terms.Where((t, i) => !t.Match(other.Terms[i])).Any();
200196
}
201197

202198
public override Name ApplyToTerms(Func<Name, Name> transformFunction)

‎Components/WellFormedNames/Implementation/PrimitiveSymbol.cs

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public override Name MakeGround(SubstitutionSet bindings)
8585

8686
public override bool Match(Name name)
8787
{
88+
if (name.IsUniversal)
89+
return true;
90+
8891
PrimitiveSymbol s = name as PrimitiveSymbol;
8992
if (s == null)
9093
return false;

‎Components/WellFormedNames/Implementation/VariableSymbol.cs

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ public override Name MakeGround(SubstitutionSet bindings)
8383

8484
public override bool Match(Name name)
8585
{
86+
if (name.IsUniversal)
87+
return true;
88+
8689
return Equals(name as VariableSymbol);
8790
}
8891

‎Components/WellFormedNames/Unifier.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static bool Unify(Name name1, Name name2, out IEnumerable<Substitution> b
3737

3838
if (name1.IsGrounded && name2.IsGrounded)
3939
{
40-
var result = name1.Equals(name2);
40+
var result = name1.Match(name2);
4141
if (result)
4242
bindings = Enumerable.Empty<Substitution>();
4343
return result;

‎ExportDlls.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22

33
SET exportBat=export.bat
4-
SET excludeDirectories=tools Tests
4+
SET excludeDirectories=\tools\ \Tests\
55
SET pdo2mdbPath=\tools\pdb2mdb\pdb2mdb.exe
66

77
IF NOT "%~1" == "debug" (
@@ -25,7 +25,7 @@ IF NOT EXIST "%targetPath%" (
2525
exit /B
2626
)
2727

28-
FOR /F %%i IN ('dir /b /AD ^| findstr /v /x "%excludeDirectories%"') DO (
28+
FOR /F "delims=" %%i IN ('dir /B /S /A:D ^| findstr /v "%excludeDirectories%"') DO (
2929
pushd "%%~fi"
3030
IF EXIST %exportBat% (
3131
echo Exporting %%i

‎GUI/GAIPS.AssetEditorTools/BaseAssetForm.cs

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ protected BaseAssetForm()
2323

2424
public void SetModified()
2525
{
26+
if(_wasModified)
27+
return;
28+
2629
_wasModified = true;
2730
UpdateWindowTitle();
2831
}

‎GUI/IntegratedAuthoringToolWF/Program.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Windows.Forms;
33
using AssetManagerPackage;
4+
using GAIPS.AssetEditorTools;
45

56
namespace IntegratedAuthoringToolWF
67
{
@@ -12,6 +13,8 @@ static class Program
1213
[STAThread]
1314
static void Main()
1415
{
16+
AssetManager.Instance.Bridge = new ApplicationBridge();
17+
1518
Application.EnableVisualStyles();
1619
Application.SetCompatibleTextRenderingDefault(false);
1720
Application.Run(new MainForm());

‎GUI/IntegratedAuthoringToolWF/TextToSpeechForm.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ private void GenerateVoicesTask(string basePath, IProgressBarControler controlle
133133
int i = 0;
134134
foreach (var split in _agentActions.Zip(controller.Split(_agentActions.Length), (dto, ctrl) => new { data = dto, ctrl }))
135135
{
136-
var path = Path.Combine(basePath, split.data.Id.ToString("N"));
136+
var id = $"{split.data.CurrentState}#{split.data.NextState}#{split.data.Meaning}({split.data.Style})".ToUpperInvariant();
137+
var path = Path.Combine(basePath, id);
137138
Directory.CreateDirectory(path);
138139

139140
split.ctrl.Message = $"Generating TTS for Utterance ({++i}/{_agentActions.Length})";

‎GUI/RolePlayCharacterWF/BaseAssetControl.cs

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ private void button1_Click(object sender, EventArgs e)
6363
private void button2_Click(object sender, EventArgs e)
6464
{
6565
_path.Text = string.Empty;
66+
OnPathChanged?.Invoke(this, new EventArgs());
6667
}
6768

6869
private void _path_TextChanged(object sender, EventArgs e)

‎GUI/RolePlayCharacterWF/MainForm.cs

+29-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ namespace RolePlayCharacterWF
77
{
88
public sealed partial class MainForm : BaseRPCForm
99
{
10+
private bool _ignoreEvents = false;
11+
1012
public MainForm()
1113
{
1214
InitializeComponent();
1315
}
1416

1517
protected override void OnAssetDataLoaded(RolePlayCharacterAsset asset)
16-
{
18+
{
19+
_ignoreEvents = true;
20+
1721
textBoxCharacterName.Text = asset.CharacterName;
1822
textBoxCharacterBody.Text = asset.BodyName;
1923
var ea = EditorTools.GetFieldValue<EmotionalAppraisal.EmotionalAppraisalAsset>(asset, "_emotionalAppraisalAsset");
@@ -24,34 +28,56 @@ protected override void OnAssetDataLoaded(RolePlayCharacterAsset asset)
2428

2529
var si = EditorTools.GetFieldValue<SocialImportance.SocialImportanceAsset>(asset, "_socialImportanceAsset");
2630
siAssetControl1.SetAsset(si);
31+
32+
_ignoreEvents = false;
2733
}
2834

2935
private void textBoxCharacterName_TextChanged(object sender, EventArgs e)
3036
{
37+
if(_ignoreEvents)
38+
return;
39+
3140
CurrentAsset.CharacterName = textBoxCharacterName.Text;
41+
SetModified();
3242
}
3343

3444
private void textBoxCharacterBody_TextChanged(object sender, EventArgs e)
3545
{
36-
CurrentAsset.BodyName = textBoxCharacterBody.Text;
37-
}
46+
if (_ignoreEvents)
47+
return;
48+
49+
CurrentAsset.BodyName = textBoxCharacterBody.Text;
50+
SetModified();
51+
}
3852

3953
private void eaAssetControl1_OnPathChanged(object sender, EventArgs e)
4054
{
55+
if (_ignoreEvents)
56+
return;
57+
4158
CurrentAsset.EmotionalAppraisalAssetSource = eaAssetControl1.Path;
4259
ReloadAsset(sender,e);
60+
SetModified();
4361
}
4462

4563
private void edmAssetControl1_OnPathChanged(object sender, EventArgs e)
4664
{
65+
if (_ignoreEvents)
66+
return;
67+
4768
CurrentAsset.EmotionalDecisionMakingSource = edmAssetControl1.Path;
4869
ReloadAsset(sender, e);
70+
SetModified();
4971
}
5072

5173
private void siAssetControl1_OnPathChanged(object sender, EventArgs e)
5274
{
75+
if (_ignoreEvents)
76+
return;
77+
5378
CurrentAsset.SocialImportanceAssetSource = siAssetControl1.Path;
5479
ReloadAsset(sender, e);
80+
SetModified();
5581
}
5682

5783
private void ReloadAsset(object sender, EventArgs e)

‎tools/Batch Files/Asset Batchs/ImportLibsToUnity.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
set mode=debug
33
set assetRepositoriesFolder=..\..\AssetDev
4-
set destination=\Assets\AssetDLLs
4+
set destination=\Assets\FAtiMA\Plugins
55
SET mainExportBat=ExportDlls.bat
66

77
::----------------------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.