@@ -7,13 +7,17 @@ namespace RolePlayCharacterWF
7
7
{
8
8
public sealed partial class MainForm : BaseRPCForm
9
9
{
10
+ private bool _ignoreEvents = false ;
11
+
10
12
public MainForm ( )
11
13
{
12
14
InitializeComponent ( ) ;
13
15
}
14
16
15
17
protected override void OnAssetDataLoaded ( RolePlayCharacterAsset asset )
16
- {
18
+ {
19
+ _ignoreEvents = true ;
20
+
17
21
textBoxCharacterName . Text = asset . CharacterName ;
18
22
textBoxCharacterBody . Text = asset . BodyName ;
19
23
var ea = EditorTools . GetFieldValue < EmotionalAppraisal . EmotionalAppraisalAsset > ( asset , "_emotionalAppraisalAsset" ) ;
@@ -24,34 +28,56 @@ protected override void OnAssetDataLoaded(RolePlayCharacterAsset asset)
24
28
25
29
var si = EditorTools . GetFieldValue < SocialImportance . SocialImportanceAsset > ( asset , "_socialImportanceAsset" ) ;
26
30
siAssetControl1 . SetAsset ( si ) ;
31
+
32
+ _ignoreEvents = false ;
27
33
}
28
34
29
35
private void textBoxCharacterName_TextChanged ( object sender , EventArgs e )
30
36
{
37
+ if ( _ignoreEvents )
38
+ return ;
39
+
31
40
CurrentAsset . CharacterName = textBoxCharacterName . Text ;
41
+ SetModified ( ) ;
32
42
}
33
43
34
44
private void textBoxCharacterBody_TextChanged ( object sender , EventArgs e )
35
45
{
36
- CurrentAsset . BodyName = textBoxCharacterBody . Text ;
37
- }
46
+ if ( _ignoreEvents )
47
+ return ;
48
+
49
+ CurrentAsset . BodyName = textBoxCharacterBody . Text ;
50
+ SetModified ( ) ;
51
+ }
38
52
39
53
private void eaAssetControl1_OnPathChanged ( object sender , EventArgs e )
40
54
{
55
+ if ( _ignoreEvents )
56
+ return ;
57
+
41
58
CurrentAsset . EmotionalAppraisalAssetSource = eaAssetControl1 . Path ;
42
59
ReloadAsset ( sender , e ) ;
60
+ SetModified ( ) ;
43
61
}
44
62
45
63
private void edmAssetControl1_OnPathChanged ( object sender , EventArgs e )
46
64
{
65
+ if ( _ignoreEvents )
66
+ return ;
67
+
47
68
CurrentAsset . EmotionalDecisionMakingSource = edmAssetControl1 . Path ;
48
69
ReloadAsset ( sender , e ) ;
70
+ SetModified ( ) ;
49
71
}
50
72
51
73
private void siAssetControl1_OnPathChanged ( object sender , EventArgs e )
52
74
{
75
+ if ( _ignoreEvents )
76
+ return ;
77
+
53
78
CurrentAsset . SocialImportanceAssetSource = siAssetControl1 . Path ;
54
79
ReloadAsset ( sender , e ) ;
80
+ SetModified ( ) ;
55
81
}
56
82
57
83
private void ReloadAsset ( object sender , EventArgs e )
0 commit comments