add notifications widget
MODIFY
HunterPie.Core/HunterPie.Core.csproj
HunterPie.Core/HunterPie.Core.csproj
<Compile Include="Native\Connection\Packets\Definitions.cs" />
<Compile Include="Native\Connection\Packets\Opcodes.cs" />
<Compile Include="Native\Injector.cs" />
+ <Compile Include="Notifications\INotificationsService.cs" />
+ <Compile Include="Notifications\NotificationModel.cs" />
+ <Compile Include="Notifications\NotificationService.cs" />
+ <Compile Include="Notifications\NotificationsServiceExtensions.cs" />
<Compile Include="Plugins\IPlugin.cs" />
<Compile Include="Plugins\PluginInformation.cs" />
<Compile Include="Plugins\PluginPackage.cs" />

MODIFY
HunterPie.UI/GUI/Overlay.cs
HunterPie.UI/GUI/Overlay.cs
@@ -6,8 +6,8 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
-using System.Windows.Threading;
using HunterPie.Core;
+using HunterPie.GUI.Widgets;
using HunterPie.Logger;
using HunterPie.Memory;
@@ -163,6 +163,12 @@ namespace HunterPie.GUI
counter++;
}
+ if (OverlaySettings.NotificationsWidget.Initialize)
+ {
+ RegisterWidget(new NotificationsWidget());
+ counter++;
+ }
+
Debugger.Warn($"Initialized overlay with {counter} widgets!");
} else
{

MODIFY
HunterPie.UI/GUIControls/NewSettingsWindow.xaml
HunterPie.UI/GUIControls/NewSettingsWindow.xaml
</StackPanel>
</ScrollViewer>
</TabItem>
+ <TabItem>
+ <TabItem.Header>
+ <Canvas>
+ <Image Source="{StaticResource ICON_NOTIFICATIONS}" Width="15" Height="15" Canvas.Top="6" Canvas.Left="2"/>
+ <TextBlock Height="21" Width="181" Canvas.Left="20" FontWeight="Medium" Canvas.Top="2" Text="{strings:Settings NOTIFICATIONS_TEXT}" />
+ </Canvas>
+ </TabItem.Header>
+ <ScrollViewer>
+ <StackPanel>
+ <custom:Switcher x:Name="switchNotificationsInitialize" Text="{strings:Settings ENABLE_INITIALIZE_NOTIFICATIONS}" RestartVisibility="Visible" ToolTip="{strings:Settings ENABLE_INITIALIZE_NOTIFICATIONS_DESC}"/>
+ <custom:Switcher x:Name="switchEnableNotifications" Text="{strings:Settings ENABLE_NOTIFICATIONS}" Margin="10,0,10,5" ToolTip="{strings:Settings ENABLE_NOTIFICATIONS_DESC}" RestartVisibility="Collapsed"/>
+ <custom:MinimalSlider x:Name="NotificationsWidgetOpacity" Text="{strings:Settings STATIC_OPACITY}" MinChange="0.01" MinValue="0" MaxValue="1" ValueText="{Binding Value, RelativeSource={RelativeSource Self}, StringFormat=\{0:P\}}" Foreground="WhiteSmoke" FontFamily="Segoe UI Light" Margin="10,0,10,5" />
+ <custom:Switcher Margin="10,0,10,5" x:Name="switchNotificationStreamerMode" Text="{strings:Settings ENABLE_STREAMER_MODE}" ToolTip="{strings:Settings ENABLE_STREAMER_MODE_DESC}" RestartVisibility="Visible"/>
+ </StackPanel>
+ </ScrollViewer>
+ </TabItem>
+
<TabItem>
<TabItem.Header>
<Canvas>

MODIFY
HunterPie/Languages/en-us.xml
HunterPie/Languages/en-us.xml
<String ID="ENABLE_LIGHTBOWGUN_HELPER" Name="Enable Light Bowgun Helper"/>
<String ID="ENABLE_LIGHTBOWGUN_HELPER_DESC" Name="If enabled, the Light Bowgun helper will be visible whenever you equip a Light Bowgun."/>
<String ID="STATIC_CLASSES_BETA_WARNING" Name="Attention: Class helpers are still in development and more classes will be supported in the future. Each class helper has it's own settings, so you can have different positions for this widget depending on the class. Use the Design Mode feature to scale and move this widget."/>
+
+ <!-- Notifications Widget -->
+ <String ID="NOTIFICATIONS_TEXT" Name="Notifications"/>
+
+ <String ID="ENABLE_NOTIFICATIONS" Name="Enable Notifications Widget"/>
+ <String ID="ENABLE_NOTIFICATIONS_DESC" Name="If enabled notifications will be shown"/>
+
+ <String ID="ENABLE_INITIALIZE_NOTIFICATIONS" Name="Initialize Notifications Widget"/>
+ <String ID="ENABLE_INITIALIZE_NOTIFICATIONS_DESC" Name="If disabled, the notifications widget won't be initialized at all."/>
+
<!-- Links -->
<String ID="STATIC_HUNTERPIE_WIKI" Name="Documentation"/>
<String ID="STATIC_HUNTERPIE_WIKI_DESC" Name="HunterPie official documentation."/>

MODIFY
HunterPie/Resources/DefaultTheme.xaml
HunterPie/Resources/DefaultTheme.xaml
xmlns:Overlay="clr-namespace:HunterPie.GUI;assembly=HunterPie.UI"
xmlns:PlayerHud="clr-namespace:HunterPie.GUI.Widgets.HealthWidget;assembly=HunterPie.UI"
xmlns:PlayerHealthParts="clr-namespace:HunterPie.GUI.Widgets.HealthWidget.Parts;assembly=HunterPie.UI"
- >
+ xmlns:notifications="clr-namespace:HunterPie.GUI.Widgets.Notifications;assembly=HunterPie.UI">
<SolidColorBrush x:Key="NoteColor0" Color="#FF724CC5"/>
<SolidColorBrush x:Key="NoteColor1" Color="#FFDC2F35"/>
<SolidColorBrush x:Key="NoteColor2" Color="#FFFF8000"/>
</Style.Triggers>
</Style>
+ <!--Notifications-->
+ <Color x:Key="NOTIFICATION_BKG_COLOR_1">#ff087cac</Color>
+ <Color x:Key="NOTIFICATION_BKG_COLOR_2">#00087cac</Color>
+ <Color x:Key="NOTIFICATION_HEADER_COLOR">#ee9833</Color>
+ <Color x:Key="NOTIFICATION_TEXT_COLOR">#ffffff</Color>
+ <sys:Int32 x:Key="NOTIFICATION_HIDE_DELAY">300</sys:Int32>
+
+ <SolidColorBrush x:Key="NOTIFICATION_BKG_BRUSH_1" Color="{StaticResource NOTIFICATION_BKG_COLOR_1}" />
+ <SolidColorBrush x:Key="NOTIFICATION_HEADER_BRUSH" Color="{StaticResource NOTIFICATION_HEADER_COLOR}" />
+ <SolidColorBrush x:Key="NOTIFICATION_TEXT_BRUSH" Color="{StaticResource NOTIFICATION_TEXT_COLOR}" />
+
+ <LinearGradientBrush x:Key="NOTIFICATION_BKG" StartPoint="0,0" EndPoint="1,1">
+ <GradientStop Color="{StaticResource NOTIFICATION_BKG_COLOR_2}" Offset="0" />
+ <GradientStop Color="{StaticResource NOTIFICATION_BKG_COLOR_1}" Offset="0.5"/>
+ <GradientStop Color="{StaticResource NOTIFICATION_BKG_COLOR_2}" Offset="1"/>
+ </LinearGradientBrush>
+
+ <LinearGradientBrush x:Key="NOTIFICATION_BORDER_BKG" StartPoint="0,0" EndPoint="1,1">
+ <GradientStop Color="{StaticResource NOTIFICATION_BKG_COLOR_1}" Offset="0.6" />
+ <GradientStop Color="{StaticResource NOTIFICATION_BKG_COLOR_2}" Offset="1"/>
+ </LinearGradientBrush>
+
+ <ControlTemplate x:Key="NOTIFICATION_BKG_TEMPLATE">
+ <Grid>
+ <Rectangle Fill="{StaticResource NOTIFICATION_BKG}" Margin="0,6"/>
+
+ <Line Stroke="{StaticResource NOTIFICATION_BKG_BRUSH_1}" X1="0" Y2="1" X2="11" Y1="10" StrokeThickness="3" />
+ <Line Stroke="{StaticResource NOTIFICATION_BKG_BRUSH_1}" X1="0" Y1="1" X2="11" Y2="10" StrokeThickness="3" VerticalAlignment="Bottom" />
+
+ <Grid Margin="10,0,0,0">
+ <Rectangle Height="3" VerticalAlignment="Top" Fill="{StaticResource NOTIFICATION_BORDER_BKG}"/>
+ <Rectangle Height="3" VerticalAlignment="Bottom" Fill="{StaticResource NOTIFICATION_BORDER_BKG}"/>
+ </Grid>
+ </Grid>
+ </ControlTemplate>
+
+ <Style TargetType="Grid" x:Key="NOTIFICATION_CONTROL_STYLE">
+ <Setter Property="Margin" Value="0, 10,0,0"/>
+ </Style>
+
+ <Style TargetType="Grid" x:Key="NOTIFICATION_BODY_STYLE">
+ <Setter Property="Margin" Value="15, 10,15,8"/>
+ </Style>
+
+ <Style TargetType="TextBlock" x:Key="NOTIFICATION_BASE_TEXTBLOCK_STYLE">
+ <Setter Property="Effect">
+ <Setter.Value>
+ <DropShadowEffect BlurRadius="7" Color="Black" RenderingBias="Performance" Opacity="1" Direction="-30" ShadowDepth="4" />
+ </Setter.Value>
+ </Setter>
+
+ <Setter Property="FontSize" Value="20"/>
+ <Setter Property="FontFamily" Value="Roboto"/>
+ <Setter Property="FontWeight" Value="Bold"/>
+ <Setter Property="VerticalAlignment" Value="Center"/>
+ </Style>
+
+ <Style TargetType="TextBlock" x:Key="NOTIFICATION_HEADER_TEXTBLOCK_STYLE" BasedOn="{StaticResource NOTIFICATION_BASE_TEXTBLOCK_STYLE}">
+ <Setter Property="Foreground" Value="{StaticResource NOTIFICATION_HEADER_BRUSH}"/>
+ </Style>
+
+ <Style TargetType="TextBlock" x:Key="NOTIFICATION_TEXT_TEXTBLOCK_STYLE" BasedOn="{StaticResource NOTIFICATION_BASE_TEXTBLOCK_STYLE}">
+ <Setter Property="Foreground" Value="{StaticResource NOTIFICATION_TEXT_BRUSH}"/>
+ </Style>
+
+ <Style TargetType="UserControl" x:Key="NOTIFICATION_STYLE">
+ <Setter Property="Margin" Value="0,10,0,0"/>
+
+ <Style.Triggers>
+ <Trigger Property="notifications:Notification.ShouldBeShown" Value="True">
+ <Trigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="(UserControl.RenderTransform).(TranslateTransform.X)" From="300" To="0" Duration="0:0:0.2">
+ <DoubleAnimation.EasingFunction>
+ <PowerEase EasingMode="EaseOut" />
+ </DoubleAnimation.EasingFunction>
+ </DoubleAnimation>
+ <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.2"/>
+ </Storyboard>
+ </BeginStoryboard>
+ </Trigger.EnterActions>
+
+ <Trigger.ExitActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="(UserControl.RenderTransform).(TranslateTransform.X)" From="0" To="300" Duration="0:0:0.2">
+ <DoubleAnimation.EasingFunction>
+ <PowerEase EasingMode="EaseOut" />
+ </DoubleAnimation.EasingFunction>
+ </DoubleAnimation>
+ <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.2"/>
+ </Storyboard>
+ </BeginStoryboard>
+ </Trigger.ExitActions>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+
</ResourceDictionary>

add notifications widget