Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.

Commit 5db372a

Browse files
authored
Add files via upload
1 parent 25dae52 commit 5db372a

File tree

9 files changed

+255
-48
lines changed

9 files changed

+255
-48
lines changed

ActorConsole/ActorConsole.csproj.user

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
</ApplicationDefinition>
1010
</ItemGroup>
1111
<ItemGroup>
12+
<Compile Update="FakeActorView.xaml.cs">
13+
<SubType>Code</SubType>
14+
</Compile>
15+
</ItemGroup>
16+
<ItemGroup>
17+
<Page Update="FakeActorView.xaml">
18+
<SubType>Designer</SubType>
19+
</Page>
1220
<Page Update="MainWindow.xaml">
1321
<SubType>Designer</SubType>
1422
</Page>

ActorConsole/Classes/MemoryFuncs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal static class MemoryFuncs
99

1010
public static string GetCurrentMap()
1111
{
12-
string mapIn = "";
12+
string mapIn = "Could Not Find Current Map";
1313

1414

1515
Process[] processes = Process.GetProcesses();

ActorConsole/Classes/ProcessFuncs.cs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using System.Diagnostics;
2+
3+
namespace ActorConsole.Classes
4+
{
5+
internal static class ProcessFuncs
6+
{
7+
public static bool IsConsoleAlreadyRunning()
8+
{
9+
Process currentP = Process.GetCurrentProcess();
10+
Process[] allP = Process.GetProcesses();
11+
int i = 0;
12+
foreach (Process p in allP)
13+
{
14+
if (currentP.ProcessName == p.ProcessName)
15+
{
16+
i++;
17+
if (i >= 2)
18+
{
19+
currentP.Dispose();
20+
p.Dispose();
21+
return true;
22+
}
23+
else
24+
{
25+
p.Dispose();
26+
}
27+
}
28+
else
29+
{
30+
p.Dispose();
31+
}
32+
}
33+
currentP.Dispose();
34+
return false;
35+
36+
}
37+
public static bool IsGameConnected()
38+
{
39+
Process[] processesiw4x = Process.GetProcessesByName("iw4x");
40+
Process[] processesiw4m = Process.GetProcessesByName("iw4m");
41+
if (processesiw4m.Length == 0)
42+
{
43+
if (processesiw4x.Length > 0)
44+
{
45+
DisposeArray(processesiw4x);
46+
DisposeArray(processesiw4m);
47+
return true;
48+
}
49+
else
50+
{
51+
DisposeArray(processesiw4x);
52+
DisposeArray(processesiw4m);
53+
return false;
54+
}
55+
}
56+
else
57+
{
58+
DisposeArray(processesiw4x);
59+
DisposeArray(processesiw4m);
60+
return true;
61+
}
62+
63+
void DisposeArray(Process[] array)
64+
{
65+
try
66+
{
67+
foreach (Process p in array)
68+
{
69+
p.Dispose();
70+
}
71+
}
72+
catch
73+
{
74+
75+
}
76+
}
77+
78+
}
79+
}
80+
}

ActorConsole/FakeActorView.xaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Window x:Class="ActorConsole.FakeActorView"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:ui="http://schemas.modernwpf.com/2019"
7+
ui:WindowHelper.UseModernWindowStyle="True"
8+
xmlns:local="clr-namespace:ActorConsole"
9+
mc:Ignorable="d"
10+
Title="FakeActorView" Height="350" Width="550" Loaded="Window_Loaded">
11+
<Grid>
12+
<Grid.ColumnDefinitions>
13+
<ColumnDefinition Width="10"></ColumnDefinition>
14+
<ColumnDefinition Width="*"></ColumnDefinition>
15+
<ColumnDefinition Width="*"></ColumnDefinition>
16+
<ColumnDefinition Width="10"></ColumnDefinition>
17+
</Grid.ColumnDefinitions>
18+
<Grid.RowDefinitions>
19+
<RowDefinition Height="20"></RowDefinition>
20+
<RowDefinition Height="*"></RowDefinition>
21+
<RowDefinition Height="10"></RowDefinition>
22+
</Grid.RowDefinitions>
23+
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="1">Warning: This is for artificially adding actors to the global list that were not created with the 'Create' button.</TextBlock>
24+
<Rectangle Fill="#FFE7E700" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
25+
<Rectangle.Effect>
26+
<DropShadowEffect BlurRadius="10" ShadowDepth="1" Opacity="15"/>
27+
</Rectangle.Effect>
28+
</Rectangle>
29+
<ListBox x:Name="allActorBoxFake" Grid.Row="1" Grid.Column="2" Margin="15,15,15,15"></ListBox>
30+
</Grid>
31+
</Window>

ActorConsole/FakeActorView.xaml.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Windows;
2+
3+
namespace ActorConsole
4+
{
5+
/// <summary>
6+
/// Interaction logic for FakeActorView.xaml
7+
/// </summary>
8+
public partial class FakeActorView : Window
9+
{
10+
public FakeActorView()
11+
{
12+
InitializeComponent();
13+
}
14+
15+
private void Window_Loaded(object sender, RoutedEventArgs e)
16+
{
17+
}
18+
}
19+
}

ActorConsole/MainWindow.xaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@
1919
<Grid.ColumnDefinitions>
2020
<ColumnDefinition Width="20"></ColumnDefinition>
2121
<ColumnDefinition Width="*"></ColumnDefinition>
22+
<ColumnDefinition Width="*"></ColumnDefinition>
2223
<ColumnDefinition Width="20"></ColumnDefinition>
2324
</Grid.ColumnDefinitions>
2425
<Grid.RowDefinitions>
2526
<RowDefinition Height="20"></RowDefinition>
2627
<RowDefinition Height="*"></RowDefinition>
2728
<RowDefinition Height="35"></RowDefinition>
2829
</Grid.RowDefinitions>
29-
<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="48" Margin="0,10,0,0" >Hello!</TextBlock>
30-
<Button x:Name="precacheBtn" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="14" Margin="0,80,0,0" Click="precacheBtn_Click">Select Your Precache</Button>
31-
<Image Width="200" Grid.Column="1" Grid.Row="1" Source="Resources/mvm.png" HorizontalAlignment="Right" VerticalAlignment="Bottom" Stretch="Uniform" Opacity="0.25" RenderTransformOrigin="0.5,0.5">
30+
<TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Opacity="0.5" Margin="-16,0,0,-15" >v0.0.2</TextBlock>
31+
<TextBlock Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="48" Margin="0,10,0,0" >Hello!</TextBlock>
32+
<Button x:Name="precacheBtn" Grid.ColumnSpan="2" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="14" Margin="0,80,0,0" Click="precacheBtn_Click">Select Your Precache</Button>
33+
<Image Width="200" Grid.Column="2" Grid.Row="1" Source="Resources/mvm.png" HorizontalAlignment="Right" VerticalAlignment="Bottom" Stretch="Uniform" Opacity="0.25" RenderTransformOrigin="0.5,0.5">
3234
<Image.RenderTransform>
3335
<TransformGroup>
3436
<ScaleTransform/>
@@ -38,7 +40,7 @@
3840
</TransformGroup>
3941
</Image.RenderTransform>
4042
</Image>
41-
<Image Width="90" Grid.Column="1" Grid.Row="1" Source="Resources/mg.png" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,95,0" RenderTransformOrigin="0.5,0.5" Opacity="0.25">
43+
<Image Width="90" Grid.Column="2" Grid.Row="1" Source="Resources/mg.png" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,95,0" RenderTransformOrigin="0.5,0.5" Opacity="0.25">
4244
<Image.RenderTransform>
4345
<TransformGroup>
4446
<ScaleTransform/>
@@ -150,6 +152,7 @@
150152
</ComboBox>
151153
<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,125" Opacity="0.5">Attachments Coming Soon</TextBlock>
152154
<Button x:Name="sendWeaponsBtn" Grid.Column="1" Grid.Row="1" Panel.ZIndex="5" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="10,0,0,10" Click="sendWeaponsBtn_Click" IsEnabled="False">Apply Weapons</Button>
155+
<Button x:Name="removeWeaponsBtn" Grid.Column="1" Grid.Row="1" Panel.ZIndex="5" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="133,0,0,10" Click="removeWeaponsBtn_Click" IsEnabled="False">Remove Weapon</Button>
153156
<TabControl Grid.Row="1" Grid.Column="1">
154157
<TabItem Header="Assault Rifles">
155158
<Grid>
@@ -553,14 +556,20 @@
553556
<RowDefinition Height="75"></RowDefinition>
554557
<RowDefinition Height="5"></RowDefinition>
555558
</Grid.RowDefinitions>
556-
<TextBox x:Name="cfgTextBox" AcceptsReturn="True" TextWrapping="NoWrap" AcceptsTab="True" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Margin="10,50,10,0"></TextBox>
559+
<ScrollViewer>
560+
561+
</ScrollViewer>
562+
<TextBox x:Name="cfgTextBox" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" AcceptsReturn="True" TextWrapping="NoWrap" AcceptsTab="True" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Margin="10,50,10,0"></TextBox>
557563
<Button x:Name="sendSingleBtn" Grid.Column="2" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="10,10,10,0" Click="sendSingleBtn_Click">Send Single Dvar</Button>
558564
<TextBox x:Name="singleSendBox" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Top" Margin="10,10,140,0"></TextBox>
559565
<Button x:Name="sendCfgBtn" Grid.Column="1" Grid.Row="2" Margin="10,10,10,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="sendCfgBtn_Click">Send Config</Button>
560566
<Button x:Name="loadCfgBtn" Grid.Column="2" Grid.Row="2" Margin="10,10,10,10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="loadCfgBtn_Click">Load Config</Button>
561567

562568
</Grid>
563569

570+
</TabItem>
571+
<TabItem Header="Demos">
572+
564573
</TabItem>
565574
<TabItem Header="Sun And Fog">
566575

@@ -570,21 +579,24 @@
570579
</TabItem>
571580
<TabItem Header="Weapons">
572581

573-
</TabItem>
574-
<TabItem Header="Misc">
575-
576582
</TabItem>
577583
</TabControl>
578584
</Grid>
579585
</TabItem>
580586
</TabControl>
581587
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5,0,0,253" Width="67" FontSize="9.5" >Selected Actor:</TextBlock>
582-
<ComboBox x:Name="ComboActorNum" VerticalAlignment="Bottom" Margin="5,0,0,232" Width="67" IsEnabled="False" FontSize="8.5" Height="22" />
588+
<ComboBox x:Name="ComboActorNum" VerticalAlignment="Bottom" Margin="5,0,0,232" Width="67" IsEnabled="False" FontSize="8.5" Height="22" SelectionChanged="ComboActorNum_SelectionChanged">
589+
<ComboBox.ContextMenu>
590+
<ContextMenu Name="cm" StaysOpen="true">
591+
<MenuItem x:Name="artActorMenuBtn" Header="Open Artificial Actor Menu" Click="artActorMenuBtn_Click"></MenuItem>
592+
</ContextMenu>
593+
</ComboBox.ContextMenu>
594+
</ComboBox>
583595
<Button x:Name="createActorBtn" VerticalAlignment="Bottom" Margin="5,0,0,175" Height="55" Width="67" Content="Create" IsEnabled="False" Click="createActorBtn_Click" />
584596
<Button x:Name="deleteActorBtn" VerticalAlignment="Bottom" Margin="5,0,0,144" Width="67" Content="Delete" IsEnabled="False" Click="deleteActorBtn_Click" FontSize="12"/>
585597
<Button x:Name="sendAllActorBtn" VerticalAlignment="Bottom" Margin="5,0,0,112" Width="67" Content="Apply All" IsEnabled="False" FontSize="12" Click="sendAllActorBtn_Click"/>
586598
<Button x:Name="teleportActorBtn" VerticalAlignment="Bottom" Margin="5,0,0,53" Width="67" Content="Move" IsEnabled="False" Click="teleportActorBtn_click" FontSize="10"/>
587-
<Button x:Name="backActorBtn" VerticalAlignment="Bottom" Margin="5,0,0,24" Width="67" Content="Reset" IsEnabled="False" FontSize="10"/>
599+
<Button x:Name="backActorBtn" VerticalAlignment="Bottom" Margin="5,0,0,24" Width="67" Content="Reset" IsEnabled="False" FontSize="10" Click="backActorBtn_Click"/>
588600
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="26,0,0,90" Width="67" FontSize="9.5" Grid.ColumnSpan="2" >Auto Apply</TextBlock>
589601
<TextBlock x:Name="StatusText" VerticalAlignment="Bottom" Panel.ZIndex="1" Foreground="White" Margin="3,0,0,0" HorizontalAlignment="Left" Grid.ColumnSpan="2" MouseRightButtonDown="StatusText_MouseRightButtonDown">Status: Waiting For Game...</TextBlock>
590602
<TextBlock x:Name="precacheBox" VerticalAlignment="Bottom" Panel.ZIndex="1" Foreground="White" Margin="0,0,3,0" HorizontalAlignment="Right" Grid.ColumnSpan="2" MouseRightButtonDown="precacheBox_MouseRightButtonDown" >No Precache Selected</TextBlock>

0 commit comments

Comments
 (0)