Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Commit 1f3e425

Browse files
author
maxensas
committed
Rocket indicator : WIP
1 parent ad14a34 commit 1f3e425

File tree

8 files changed

+216
-9
lines changed

8 files changed

+216
-9
lines changed

Lastgarriz/Assets/Data/Config.json

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,71 @@
1-
{"options":{"language":0,"check_updates":true,"disable_startup_message":false,"devmode":false,"inverted_mouse":false,"opacity":0.7},"shortcuts":[{"enable":true,"modifier":2,"fonction":"artillery_usger","keycode":97,"value":"nomater"},{"enable":true,"modifier":2,"fonction":"artillery_ru","keycode":98,"value":"nomater"},{"enable":false,"modifier":2,"fonction":"autoqueue","keycode":123,"value":"nomater"},{"enable":false,"modifier":2,"fonction":"browser","keycode":122,"value":"nomater"},{"enable":true,"modifier":2,"fonction":"config","keycode":99,"value":"nomater"},{"enable":true,"modifier":0,"fonction":"artillery_validate","keycode":163,"value":"keylog"},{"enable":true,"modifier":0,"fonction":"rocket_start","keycode":100,"value":"keylog"},{"enable":true,"modifier":2,"fonction":"rocket_enable","keycode":100,"value":"nomater"}]}
1+
{
2+
"options": {
3+
"language": 0,
4+
"check_updates": true,
5+
"disable_startup_message": false,
6+
"devmode": false,
7+
"inverted_mouse": false,
8+
"steady_aim": false,
9+
"schreck_zook": true,
10+
"convert_indicator": false,
11+
"opacity": 0.7
12+
},
13+
"shortcuts": [
14+
{
15+
"enable": true,
16+
"modifier": 2,
17+
"fonction": "artillery_usger",
18+
"keycode": 97,
19+
"value": "nomater"
20+
},
21+
{
22+
"enable": true,
23+
"modifier": 2,
24+
"fonction": "artillery_ru",
25+
"keycode": 98,
26+
"value": "nomater"
27+
},
28+
{
29+
"enable": false,
30+
"modifier": 2,
31+
"fonction": "autoqueue",
32+
"keycode": 123,
33+
"value": "nomater"
34+
},
35+
{
36+
"enable": false,
37+
"modifier": 2,
38+
"fonction": "browser",
39+
"keycode": 122,
40+
"value": "nomater"
41+
},
42+
{
43+
"enable": true,
44+
"modifier": 2,
45+
"fonction": "config",
46+
"keycode": 99,
47+
"value": "nomater"
48+
},
49+
{
50+
"enable": true,
51+
"modifier": 0,
52+
"fonction": "artillery_validate",
53+
"keycode": 163,
54+
"value": "keylog"
55+
},
56+
{
57+
"enable": true,
58+
"modifier": 0,
59+
"fonction": "rocket_start",
60+
"keycode": 100,
61+
"value": "keylog"
62+
},
63+
{
64+
"enable": true,
65+
"modifier": 2,
66+
"fonction": "rocket_enable",
67+
"keycode": 100,
68+
"value": "nomater"
69+
}
70+
]
71+
}
Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,71 @@
1-
{"options":{"language":0,"check_updates":true,"disable_startup_message":false,"devmode":false,"inverted_mouse":false,"opacity":0.7},"shortcuts":[{"enable":true,"modifier":2,"fonction":"artillery_usger","keycode":97,"value":"nomater"},{"enable":true,"modifier":2,"fonction":"artillery_ru","keycode":98,"value":"nomater"},{"enable":false,"modifier":2,"fonction":"autoqueue","keycode":123,"value":"nomater"},{"enable":false,"modifier":2,"fonction":"browser","keycode":122,"value":"nomater"},{"enable":true,"modifier":2,"fonction":"config","keycode":99,"value":"nomater"},{"enable":true,"modifier":0,"fonction":"artillery_validate","keycode":163,"value":"keylog"},{"enable":true,"modifier":0,"fonction":"rocket_start","keycode":100,"value":"keylog"},{"enable":true,"modifier":2,"fonction":"rocket_enable","keycode":100,"value":"nomater"}]}
1+
{
2+
"options": {
3+
"language": 0,
4+
"check_updates": true,
5+
"disable_startup_message": false,
6+
"devmode": false,
7+
"inverted_mouse": false,
8+
"steady_aim": false,
9+
"schreck_zook": true,
10+
"convert_indicator": false,
11+
"opacity": 0.7
12+
},
13+
"shortcuts": [
14+
{
15+
"enable": true,
16+
"modifier": 2,
17+
"fonction": "artillery_usger",
18+
"keycode": 97,
19+
"value": "nomater"
20+
},
21+
{
22+
"enable": true,
23+
"modifier": 2,
24+
"fonction": "artillery_ru",
25+
"keycode": 98,
26+
"value": "nomater"
27+
},
28+
{
29+
"enable": false,
30+
"modifier": 2,
31+
"fonction": "autoqueue",
32+
"keycode": 123,
33+
"value": "nomater"
34+
},
35+
{
36+
"enable": false,
37+
"modifier": 2,
38+
"fonction": "browser",
39+
"keycode": 122,
40+
"value": "nomater"
41+
},
42+
{
43+
"enable": true,
44+
"modifier": 2,
45+
"fonction": "config",
46+
"keycode": 99,
47+
"value": "nomater"
48+
},
49+
{
50+
"enable": true,
51+
"modifier": 0,
52+
"fonction": "artillery_validate",
53+
"keycode": 163,
54+
"value": "keylog"
55+
},
56+
{
57+
"enable": true,
58+
"modifier": 0,
59+
"fonction": "rocket_start",
60+
"keycode": 100,
61+
"value": "keylog"
62+
},
63+
{
64+
"enable": true,
65+
"modifier": 2,
66+
"fonction": "rocket_enable",
67+
"keycode": 100,
68+
"value": "nomater"
69+
}
70+
]
71+
}

Lastgarriz/Models/Serializable/ConfigOption.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ internal sealed class ConfigOption
2020
[DataMember(Name = "inverted_mouse")]
2121
internal bool InvertedMouse { get; set; } = false;
2222

23+
[DataMember(Name = "steady_aim")]
24+
internal bool SteadyAim { get; set; } = false;
25+
26+
[DataMember(Name = "schreck_zook")]
27+
internal bool SchreckZook { get; set; } = false;
28+
29+
[DataMember(Name = "convert_indicator")]
30+
internal bool ConvertIndicator { get; set; } = false;
31+
2332
[DataMember(Name = "opacity")]
2433
internal double Opacity { get; set; } = 100;
2534
}

Lastgarriz/Util/Common.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,32 @@ internal static bool IsMiddleButtonMousePushedOnce()
9090

9191
internal static string ConvertCursorPositionToRocketIndicator(int ordinate, int multiplier)
9292
{
93-
int refVal = 1000; // add to globals
9493
double calc = ordinate;
95-
calc = (calc / Global.HalfScreenHeight) * refVal;
96-
int val = (Convert.ToInt32(calc) - refVal) + refVal * multiplier;
94+
calc = (calc / Global.HalfScreenHeight) * Global.SCALING_VALUE;
95+
int val = (Convert.ToInt32(calc) - Global.SCALING_VALUE) + Global.SCALING_VALUE * multiplier;
9796
//Trace.WriteLine(val);
9897
if (val == 0)
9998
{
10099
return "target";
101100
}
102101
val = Global.DataJson.Config.Options.InvertedMouse ? val : val * -1;
102+
103+
if(Global.DataJson.Config.Options.ConvertIndicator)
104+
{
105+
double convValue = val;
106+
if (!Global.DataJson.Config.Options.SteadyAim)
107+
{
108+
convValue *= Global.RATIO_WITHOUT_STEADY;
109+
}
110+
convValue = Global.DataJson.Config.Options.SchreckZook ?
111+
convValue * Global.RATIO_PANZERSCHRECK : convValue * Global.RATIO_BAZOOKA;
112+
113+
val = Convert.ToInt32(convValue);
114+
115+
return Global.DataJson.Config.Options.SchreckZook ?
116+
val.ToString() + "m [schreck]" : val.ToString() + "m [bazooka]";
117+
}
118+
103119
return val.ToString();
104120
}
105121

Lastgarriz/Util/Global.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ namespace Lastgarriz.Util
99
internal static class Global
1010
{
1111
internal static readonly bool DEBUG_TIMERS = false;
12+
internal static readonly int SCALING_VALUE = 1000; // GOOD - DO NOT CHANGE
13+
internal static readonly double RATIO_BAZOOKA = 0.358; // TO CHECK & MODIFY
14+
internal static readonly double RATIO_PANZERSCHRECK = 0.3428; // TO CHECK & MODIFY
15+
internal static readonly double RATIO_WITHOUT_STEADY = 0.777; // TO CHECK & MODIFY
16+
17+
/*
18+
-INGAME READINGS- - not precise enough : TO REDO-
19+
20+
PANZERSCHRECK :
21+
960m - 3000 (0.32)
22+
840m - 2525 (0.33267)
23+
720m - 2115 (0.3404)
24+
600m - 1750 (0.342857)
25+
480m - 1420 (0.3380)
26+
360m - 1050 (0.3428)
27+
240m - 700 (0.3428)
28+
120m - 350 (0.3428)
29+
30+
BAZOOKA :
31+
720m - 2080 (0.34615)
32+
600m - 1730 (0.34682)
33+
480m - 1340 (0.35820)
34+
360m - 1025 (0.35122)
35+
240m - 670 (0.35821)
36+
120m - 320 (0.375)
37+
*/
1238

1339
internal static bool Terminate { get; set; }
1440
internal static bool IsHotKey { get; set; }

Lastgarriz/ViewModels/ConfigViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ public sealed class ConfigViewModel : BaseViewModel
1515
private bool disableStartup;
1616
private bool devMode;
1717
private bool invertedMouse;
18+
private bool steadyAim;
19+
private bool schreckZook;
20+
private bool convertIndicator;
1821
private FeaturesViewModel features = new();
1922

2023
public bool DisableStartup { get => disableStartup; set => SetProperty(ref disableStartup, value); }
2124
public bool DevMode { get => devMode; set => SetProperty(ref devMode, value); }
2225
public bool InvertedMouse { get => invertedMouse; set => SetProperty(ref invertedMouse, value); }
26+
public bool SteadyAim { get => steadyAim; set => SetProperty(ref steadyAim, value); }
27+
public bool SchreckZook { get => schreckZook; set => SetProperty(ref schreckZook, value); }
28+
public bool ConvertIndicator { get => convertIndicator; set => SetProperty(ref convertIndicator, value); }
2329
public FeaturesViewModel Features { get => features; set => SetProperty(ref features, value); }
2430

2531
public ConfigCommand Commands { get; private set; }
@@ -82,6 +88,9 @@ private void InitConfig()
8288
DisableStartup = Config.Options.DisableStartupMessage;
8389
DevMode = Config.Options.DevMode;
8490
InvertedMouse = Config.Options.InvertedMouse;
91+
SteadyAim = Config.Options.SteadyAim;
92+
SchreckZook = Config.Options.SchreckZook;
93+
ConvertIndicator = Config.Options.ConvertIndicator;
8594

8695
foreach (var item in Config.Shortcuts)
8796
{
@@ -135,6 +144,9 @@ internal void SaveConfig()
135144
Config.Options.DisableStartupMessage = DisableStartup;
136145
Config.Options.DevMode = DevMode;
137146
Config.Options.InvertedMouse = InvertedMouse;
147+
Config.Options.SteadyAim = SteadyAim;
148+
Config.Options.SchreckZook = SchreckZook;
149+
Config.Options.ConvertIndicator = ConvertIndicator;
138150
//Config.Options.CheckUpdates = true;
139151

140152
//Thread.CurrentThread.CurrentUICulture = new CultureInfo(Strings.Culture[Config.Options.Language]);

Lastgarriz/Views/ConfigWindow.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@
6868
<CheckBox HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" RenderTransformOrigin="0.357,1.269" Margin="2,0,0,0" ToolTip="Developer mode : can use features without launching HLL instance." IsChecked="{Binding DevMode}"/>
6969
</Grid>
7070
<CheckBox Margin="9,32,264,205" RenderTransformOrigin="0.357,1.269" Content="Disable startup message" ToolTip="Disable startup message" Foreground="{DynamicResource MaterialDesignBodyLight}" IsChecked="{Binding DisableStartup}"/>
71-
<CheckBox Margin="9,65,255,172" RenderTransformOrigin="0.357,1.269" Content="Mouse Y Axis inverted in-game" IsChecked="{Binding InvertedMouse}" ToolTip="Enable or disable to convert rocket distance value according to your in-game settings." Foreground="{DynamicResource MaterialDesignBodyLight}"/>
71+
<CheckBox Margin="9,130,255,107" RenderTransformOrigin="0.357,1.269" Content="Mouse Y Axis inverted in-game" IsChecked="{Binding InvertedMouse}" ToolTip="Enable or disable to convert rocket distance value according to your in-game settings." Foreground="{DynamicResource MaterialDesignBodyLight}"/>
72+
<TextBlock Text="Rocket indicator : WIP" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold" Foreground="{DynamicResource MaterialDesignDarkForeground}" Margin="0,98,0,0"/>
73+
<CheckBox Margin="9,163,72,74" RenderTransformOrigin="0.357,1.269" Content="Convert indicator value to meters (approximate value)" IsChecked="{Binding ConvertIndicator}" ToolTip="Enable if you want to convert indicator value to approximate meters.&#x0a;&#x0a;The conversion allows to obtain the distance if the Z axis position (3D-Game)&#x0a;of the source and the target are ideally identical but this can never be always the case in game." Foreground="{DynamicResource MaterialDesignBodyLight}"/>
74+
<CheckBox Margin="9,196,255,41" RenderTransformOrigin="0.357,1.269" Content="Steady aim values" IsChecked="{Binding SteadyAim}" IsEnabled="{Binding ConvertIndicator}" ToolTip="Enable or disable if you are using or not steady aim shortcut in-game with rocket indicator feature." Foreground="{DynamicResource MaterialDesignBodyLight}"/>
75+
<CheckBox Margin="9,229,34,8" RenderTransformOrigin="0.357,1.269" Content="Panzerschreck (enable) / Bazooka (disable)" IsChecked="{Binding SchreckZook}" IsEnabled="{Binding ConvertIndicator}" ToolTip="Switch to display values if you are using panzerschreck (enable) or bazooka (disable)" Foreground="{DynamicResource MaterialDesignBodyLight}"/>
7276
</Grid>
7377
</materialDesign:Card>
7478
</Grid>

Lastgarriz/Views/RocketWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
<SolidColorBrush Opacity="0"/>
2323
</Window.Background>
2424
<Grid Width="240" Height="40" Visibility="{Binding ShowWindow, Converter={StaticResource BooleanToVisibilityConverter}}">
25-
<Border Height="40" Width="70" d:Visibility="Visible" Visibility="{Binding ShowDisclaimer, Converter={StaticResource InverseBoolToVisConverter}}" Background="Transparent" BorderThickness="2" CornerRadius="3">
25+
<Border Height="40" Width="230" d:Visibility="Visible" Visibility="{Binding ShowDisclaimer, Converter={StaticResource InverseBoolToVisConverter}}" Background="Transparent" BorderThickness="2" CornerRadius="3">
2626
<Border.BorderBrush>
27-
<SolidColorBrush Color="Lime" Opacity="0.5"/>
27+
<SolidColorBrush Color="Lime" Opacity="0"/>
2828
</Border.BorderBrush>
2929
<Grid>
30-
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-3,0,0" FontSize="18" d:Text="value" Text="{Binding Indicator}" FontWeight="Bold" Foreground="White" FontFamily="Consolas"/>
30+
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-3,0,0" FontSize="18" d:Text="value" Text="{Binding Indicator}" FontWeight="Bold" Foreground="Red" FontFamily="Consolas"/>
3131
</Grid>
3232
</Border>
3333
<Grid Height="40" d:Visibility="Hidden" Visibility="{Binding ShowDisclaimer, Converter={StaticResource BooleanToVisibilityConverter}}">

0 commit comments

Comments
 (0)