8
8
<ls : UIWidget .ContentTemplate>
9
9
<DataTemplate DataType =" {x:Type ls:Widget}" >
10
10
<DataTemplate .Resources>
11
- <!-- MOD START - Add toggled tooltips indicator icon-->
12
- <BitmapImage x : Key =" IconSpyglass" UriSource =" pack://application:,,,/GustavNoesisGUI;component/Assets/HUD/ico_spyglass.png" />
13
- <!-- MOD END -->
11
+ <!-- MOD START - Custom animation -->
12
+ <Storyboard x : Key =" IUIScanningAnim" AutoReverse =" True" >
13
+ <DoubleAnimation Storyboard.TargetName=" SpyglassBorder" Storyboard.TargetProperty=" Opacity" To =" 0.1" Duration =" 0:0:1" />
14
+ </Storyboard >
15
+ <Storyboard x : Key =" IUIIdleAnim" >
16
+ <DoubleAnimation Storyboard.TargetName=" SpyglassBorder" Storyboard.TargetProperty=" Opacity" To =" 1" Duration =" 0:0:0.1" />
17
+ </Storyboard >
18
+ <!-- MOD END -->
14
19
<DataTemplate x : Key =" CommonTooltipTemplate" >
15
20
<Canvas >
16
21
<b : Interaction .Triggers>
80
85
</DataTemplate .Resources>
81
86
82
87
<Grid >
88
+ <!-- MOD START - show all items auto re-toggle -->
89
+ <!-- Detects mouse movement, if there are no world items listed -->
90
+ <Control x : Name =" WTCMouseInputChecker" Visibility =" Collapsed" Opacity =" 1.0" >
91
+ <Control .Template>
92
+ <ControlTemplate TargetType =" Control" >
93
+ <Border Width =" 3840" Height =" 2160" VerticalAlignment =" Center" HorizontalAlignment =" Center" Background =" Transparent" />
94
+ </ControlTemplate >
95
+ </Control .Template>
96
+ <b : Interaction .Triggers>
97
+ <b : EventTrigger EventName =" MouseEnter" >
98
+ <b : InvokeCommandAction Command =" {Binding SetShowWorldTooltipsCommand}" />
99
+ <b : ChangePropertyAction TargetName =" WTCMouseInputChecker" PropertyName =" Opacity" Value =" 0.5" />
100
+ </b : EventTrigger >
101
+ <b : PropertyChangedTrigger Binding =" {Binding ElementName=SpyglassHolder, Path=Opacity}" >
102
+ <b : Interaction .Behaviors>
103
+ <b : ConditionBehavior >
104
+ <b : ConditionalExpression >
105
+ <b : ComparisonCondition LeftOperand =" {Binding ElementName=WorldTooltipContainer, Path=HasItems}" Operator =" Equal" RightOperand =" True" />
106
+ </b : ConditionalExpression >
107
+ </b : ConditionBehavior >
108
+ </b : Interaction .Behaviors>
109
+ <b : ChangePropertyAction TargetName =" WTCMouseInputChecker" PropertyName =" Opacity" Value =" 1.0" />
110
+ </b : PropertyChangedTrigger >
111
+ </b : Interaction .Triggers>
112
+ </Control >
113
+
83
114
<!-- Show all the world tooltips for this player -->
84
115
<ItemsControl ItemsSource =" {Binding CurrentPlayer.WorldTooltips}" ItemTemplate =" {StaticResource CommonTooltipTemplate}" x : Name =" WorldTooltipContainer" IsHitTestVisible =" True" >
85
116
<ItemsControl .ItemsPanel>
101
132
</ItemsControl .ItemContainerStyle>
102
133
</ItemsControl >
103
134
104
- <!-- MOD START - Show tooltips without requiring input held down -->
105
- <Image x : Name =" IconSpyglass" Source =" {StaticResource IconSpyglass}" Visibility =" Hidden" Height =" 120" Width =" 120" Margin =" 20,0,0,0" HorizontalAlignment =" Left" VerticalAlignment =" Bottom" />
135
+ <!-- Indicates if "Show all items" is turned on, and scanning when no entries are showing -->
136
+ <Grid x : Name =" SpyglassHolder" Visibility =" Collapsed" Margin =" 20,0,0,0" HorizontalAlignment =" Left" VerticalAlignment =" Bottom" >
137
+ <Border x : Name =" SpyglassBorder" Height =" 120" Width =" 120" Background =" Transparent" Opacity =" 1" >
138
+ <Image x : Name =" IconSpyglass" Source =" pack://application:,,,/GustavNoesisGUI;component/Assets/HUD/ico_spyglass.png" Height =" 120" Width =" 120" />
139
+ </Border >
140
+ <b : Interaction .Triggers>
141
+ <b : DataTrigger Binding =" {Binding ElementName=SpyglassHolder, Path=Opacity}" Value =" 0.5" >
142
+ <b : ControlStoryboardAction Storyboard =" {StaticResource IUIScanningAnim}" ControlStoryboardOption =" Play" />
143
+ </b : DataTrigger >
144
+ <b : DataTrigger Binding =" {Binding ElementName=SpyglassHolder, Path=Opacity}" Value =" 1" >
145
+ <b : ControlStoryboardAction Storyboard =" {Binding ElementName=SpyglassHolder,Path=(b:Interaction.Triggers)[0].Actions[0].Storyboard}" ControlStoryboardOption =" Stop" />
146
+ <b : ChangePropertyAction TargetName =" SpyglassBorder" PropertyName =" Opacity" Value =" 1" />
147
+ </b : DataTrigger >
148
+ <b : StoryboardCompletedTrigger Storyboard =" {StaticResource IUIScanningAnim}" >
149
+ <b : InvokeCommandAction Command =" {Binding SetShowWorldTooltipsCommand}" />
150
+ <b : ControlStoryboardAction Storyboard =" {StaticResource IUIIdleAnim}" ControlStoryboardOption =" Play" />
151
+ </b : StoryboardCompletedTrigger >
152
+ <b : StoryboardCompletedTrigger Storyboard =" {StaticResource IUIIdleAnim}" >
153
+ <b : Interaction .Behaviors>
154
+ <b : ConditionBehavior >
155
+ <b : ConditionalExpression >
156
+ <b : ComparisonCondition LeftOperand =" {Binding ElementName=SpyglassHolder, Path=Opacity}" Operator =" Equal" RightOperand =" 0.5" />
157
+ </b : ConditionalExpression >
158
+ </b : ConditionBehavior >
159
+ </b : Interaction .Behaviors>
160
+ <b : ControlStoryboardAction Storyboard =" {StaticResource IUIScanningAnim}" ControlStoryboardOption =" Play" />
161
+ </b : StoryboardCompletedTrigger >
162
+ <b : EventTrigger EventName =" MouseEnter" >
163
+ <b : InvokeCommandAction Command =" {Binding SetShowWorldTooltipsCommand}" />
164
+ </b : EventTrigger >
165
+ </b : Interaction .Triggers>
166
+ </Grid >
106
167
107
- <ls : LSInputBinding BoundEvent =" ShowWorldTooltips" IsEnabled =" {Binding ElementName=WorldTooltipContainer, Path=IsVisible}" EatInput =" True" >
168
+ <!-- controls toggle option for both keyboard and controller -->
169
+ <ls : LSInputBinding BoundEvent =" ShowWorldTooltips" IsEnabled =" {Binding ElementName=SpyglassHolder, Path=IsVisible}" EatInput =" True" >
108
170
<b : Interaction .Triggers>
109
171
<b : EventTrigger EventName =" LSInputBindingPressed" >
172
+ <b : ChangePropertyAction TargetName =" WorldTooltipContainer" PropertyName =" Visibility" Value =" Collapsed" />
173
+ <b : ChangePropertyAction TargetName =" SpyglassHolder" PropertyName =" Visibility" Value =" Collapsed" />
110
174
<b : InvokeCommandAction Command =" {Binding SetShowWorldTooltipsCommand}" CommandParameter =" {StaticResource FalseValue}" />
111
- <b : ChangePropertyAction TargetName =" WorldTooltipContainer" PropertyName =" Visibility" Value =" Collapsed" />
112
- <b : ChangePropertyAction TargetName =" IconSpyglass" PropertyName =" Visibility" Value =" Hidden" />
113
175
</b : EventTrigger >
114
176
</b : Interaction .Triggers>
115
177
</ls : LSInputBinding >
116
-
117
- <ls : LSInputBinding BoundEvent =" ShowWorldTooltips" EatInput =" True" >
178
+ <ls : LSInputBinding BoundEvent =" ShowWorldTooltips" IsEnabled =" {Binding ElementName=SpyglassHolder, Path=IsVisible, Converter={StaticResource InvertBoolConverter}}" EatInput =" True" >
118
179
<b : Interaction .Triggers>
119
180
<b : EventTrigger EventName =" LSInputBindingPressed" >
181
+ <b : ChangePropertyAction TargetName =" WorldTooltipContainer" PropertyName =" Visibility" Value =" Visible" />
182
+ <b : ChangePropertyAction TargetName =" SpyglassHolder" PropertyName =" Visibility" Value =" Visible" />
120
183
<b : InvokeCommandAction Command =" {Binding SetShowWorldTooltipsCommand}" />
121
- <b : ChangePropertyAction TargetName =" WorldTooltipContainer" PropertyName =" Visibility" Value =" Visible" />
122
- <b : ChangePropertyAction TargetName =" IconSpyglass" PropertyName =" Visibility" Value =" Visible" />
123
184
</b : EventTrigger >
124
185
</b : Interaction .Triggers>
125
186
</ls : LSInputBinding >
126
- <!-- MOD END -->
127
187
</Grid >
128
- <DataTemplate .Triggers>
129
- <DataTrigger Binding =" {Binding CurrentPlayer.WorldTooltips.Count}" Value =" 0" >
130
- <Setter TargetName =" WorldTooltipContainer" Property =" IsHitTestVisible" Value =" False" />
131
- </DataTrigger >
132
- </DataTemplate .Triggers>
188
+ <DataTemplate .Triggers>
189
+ <!-- Enables/disables the mouse or zero item checks in place -->
190
+ <DataTrigger Binding =" {Binding ElementName=SpyglassHolder, Path=IsVisible}" Value =" False" >
191
+ <Setter TargetName =" WTCMouseInputChecker" Property =" Visibility" Value =" Collapsed" />
192
+ </DataTrigger >
193
+ <MultiDataTrigger >
194
+ <MultiDataTrigger .Conditions>
195
+ <Condition Binding =" {Binding ElementName=SpyglassHolder, Path=IsVisible}" Value =" True" />
196
+ <Condition Binding =" {Binding ElementName=WorldTooltipContainer, Path=HasItems}" Value =" False" />
197
+ <Condition Binding =" {Binding ElementName=WTCMouseInputChecker, Path=Opacity}" Value =" 0.5" />
198
+ </MultiDataTrigger .Conditions>
199
+ <MultiDataTrigger .Setters>
200
+ <Setter TargetName =" SpyglassHolder" Property =" Opacity" Value =" 0.5" />
201
+ <Setter TargetName =" WTCMouseInputChecker" Property =" Visibility" Value =" Collapsed" />
202
+ </MultiDataTrigger .Setters>
203
+ </MultiDataTrigger >
204
+ <MultiDataTrigger >
205
+ <MultiDataTrigger .Conditions>
206
+ <Condition Binding =" {Binding ElementName=SpyglassHolder, Path=IsVisible}" Value =" True" />
207
+ <Condition Binding =" {Binding ElementName=WorldTooltipContainer, Path=HasItems}" Value =" False" />
208
+ <Condition Binding =" {Binding ElementName=WTCMouseInputChecker, Path=Opacity}" Value =" 1.0" />
209
+ </MultiDataTrigger .Conditions>
210
+ <Setter TargetName =" WTCMouseInputChecker" Property =" Visibility" Value =" Visible" />
211
+ </MultiDataTrigger >
212
+ <MultiDataTrigger >
213
+ <MultiDataTrigger .Conditions>
214
+ <Condition Binding =" {Binding ElementName=WorldTooltipContainer, Path=HasItems}" Value =" True" />
215
+ <Condition Binding =" {Binding ElementName=SpyglassHolder, Path=IsVisible}" Value =" True" />
216
+ </MultiDataTrigger .Conditions>
217
+ <MultiDataTrigger .Setters>
218
+ <Setter TargetName =" WTCMouseInputChecker" Property =" Visibility" Value =" Collapsed" />
219
+ <Setter TargetName =" SpyglassHolder" Property =" Opacity" Value =" 1.0" />
220
+ </MultiDataTrigger .Setters>
221
+ </MultiDataTrigger >
222
+ </DataTemplate .Triggers>
133
223
</DataTemplate >
134
224
</ls : UIWidget .ContentTemplate>
135
- <!-- MOD START - Show tooltips when UI changes -->
136
- <!-- <b:Interaction.Triggers>
137
- <b:PropertyChangedTrigger Binding="{Binding CurrentPlayer.UIData.ActiveState}">
138
- <b:InvokeCommandAction Command="{Binding SetShowWorldTooltipsCommand}" CommandParameter="{StaticResource FalseValue}"/>
139
- </b:PropertyChangedTrigger>
140
- </b:Interaction.Triggers> -->
141
225
<!-- MOD END -->
142
- </ls : UIWidget >
226
+ </ls : UIWidget >
0 commit comments