Skip to content

Commit bc4b227

Browse files
committedSep 8, 2022
Add project files.
1 parent 01d05b8 commit bc4b227

12 files changed

+307
-0
lines changed
 

‎VRCOSC.sln

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32112.339
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRCOSC", "VRCOSC\VRCOSC.csproj", "{2527E43D-AB5B-4283-BE28-E79749293113}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{2527E43D-AB5B-4283-BE28-E79749293113}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{2527E43D-AB5B-4283-BE28-E79749293113}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{2527E43D-AB5B-4283-BE28-E79749293113}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{2527E43D-AB5B-4283-BE28-E79749293113}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {7ECB3BE7-575E-4A6E-BDB0-2550ED086D9C}
24+
EndGlobalSection
25+
EndGlobal

‎VRCOSC/App.xaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="VRCOSC.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:VRCOSC"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

‎VRCOSC/App.xaml.cs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace VRCOSC
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

‎VRCOSC/AssemblyInfo.cs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]

‎VRCOSC/Assets/1024.ico

6.55 KB
Binary file not shown.

‎VRCOSC/Assets/1024.png

134 KB
Loading

‎VRCOSC/MainWindow.xaml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<Window x:Class="VRCOSC.MainWindow"
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:local="clr-namespace:VRCOSC"
7+
mc:Ignorable="d"
8+
Title="VRC OSC Chatbox v0.1" Height="450" Width="800">
9+
<Grid Background="#222222">
10+
<Grid.ColumnDefinitions>
11+
<ColumnDefinition />
12+
<ColumnDefinition />
13+
<ColumnDefinition />
14+
</Grid.ColumnDefinitions>
15+
<Grid.RowDefinitions>
16+
<RowDefinition Height="*"/>
17+
<RowDefinition Height="2*"/>
18+
<RowDefinition Height="4*"/>
19+
<RowDefinition Height="*"/>
20+
<RowDefinition Height="2*"/>
21+
<RowDefinition Height="*"/>
22+
</Grid.RowDefinitions>
23+
24+
<TextBlock Text="VRC OSC Chatbox"
25+
Foreground="White"
26+
Grid.Column="1"
27+
Grid.Row="1"
28+
HorizontalAlignment="Center"
29+
VerticalAlignment="Center"
30+
31+
FontSize="24"
32+
/>
33+
34+
<TextBox Name="ChatBox"
35+
Text="{Binding Path=CurrentText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
36+
KeyDown="TextBoxKeyDown"
37+
TextChanged="TextChanged"
38+
Grid.Column="0"
39+
Grid.ColumnSpan="3"
40+
Grid.Row="2"
41+
HorizontalAlignment="Stretch"
42+
VerticalAlignment="Center"
43+
Margin="48,0,48,0"
44+
TextWrapping="Wrap"
45+
FontSize="20"
46+
MaxLength="144"
47+
Height="128"
48+
/>
49+
<TextBlock Name="NumberLetter"
50+
Grid.Row="3"
51+
Grid.Column="2"
52+
Foreground="White"
53+
HorizontalAlignment="Right"
54+
FontSize="16" Margin="0,0,48,0"
55+
/>
56+
<Button Name="Send"
57+
Grid.Column="1"
58+
Grid.Row="4"
59+
Click="SendClick"
60+
FontSize="24"
61+
Height="Auto"
62+
HorizontalAlignment="Stretch"
63+
VerticalAlignment="Stretch"
64+
Margin="16,16,16,16"
65+
>Send</Button>
66+
<TextBlock Text="By Dbqt"
67+
Foreground="White"
68+
HorizontalAlignment="Right"
69+
VerticalAlignment="Bottom"
70+
Grid.Column="2"
71+
Grid.Row="5" Margin="8,8,8,8"/>
72+
</Grid>
73+
</Window>

‎VRCOSC/MainWindow.xaml.cs

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+

2+
using System;
3+
using System.Collections.Generic;
4+
using System.ComponentModel;
5+
using System.Linq;
6+
using System.Net;
7+
using System.Windows;
8+
using System.Windows.Documents;
9+
using System.Windows.Input;
10+
11+
namespace VRCOSC
12+
{
13+
/// <summary>
14+
/// Interaction logic for MainWindow.xaml
15+
/// </summary>
16+
public partial class MainWindow : Window
17+
{
18+
private string vrcAddress = "127.0.0.1";
19+
private int vrcPort = 9000;
20+
21+
private string currentText = string.Empty;
22+
23+
24+
public string CurrentText {
25+
get
26+
{
27+
return currentText;
28+
}
29+
set
30+
{
31+
currentText = value;
32+
OnPropertyChanged(nameof(CurrentText));
33+
}
34+
}
35+
36+
public event PropertyChangedEventHandler PropertyChanged;
37+
protected void OnPropertyChanged(string propertyName)
38+
{
39+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
40+
}
41+
42+
public MainWindow()
43+
{
44+
InitializeComponent();
45+
DataContext = this;
46+
UpdateCharacterCount();
47+
}
48+
49+
public void SendOSCMessage()
50+
{
51+
// /chatbox/input s b
52+
var message = new SharpOSC.OscMessage("/chatbox/input", CurrentText, true);
53+
var sender = new SharpOSC.UDPSender(vrcAddress, vrcPort);
54+
sender.Send(message);
55+
}
56+
57+
private void ClearMessage()
58+
{
59+
ChatBox.Text = string.Empty;
60+
}
61+
62+
private void UpdateCharacterCount()
63+
{
64+
NumberLetter.Text = $"({ChatBox.Text.Length}/144)";
65+
}
66+
67+
private void SendClick(object sender, RoutedEventArgs e)
68+
{
69+
SendOSCMessage();
70+
ClearMessage();
71+
}
72+
73+
private void TextBoxKeyDown(object sender, KeyEventArgs e)
74+
{
75+
if (e.Key == Key.Return)
76+
{
77+
SendOSCMessage();
78+
ClearMessage();
79+
}
80+
}
81+
82+
private void TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
83+
{
84+
UpdateCharacterCount();
85+
}
86+
}
87+
}

‎VRCOSC/Plugins/SharpOSC.dll

19.5 KB
Binary file not shown.

‎VRCOSC/Properties/Settings.Designer.cs

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎VRCOSC/Properties/Settings.settings

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
3+
<Profiles>
4+
<Profile Name="(Default)" />
5+
</Profiles>
6+
</SettingsFile>

‎VRCOSC/VRCOSC.csproj

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net6.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<UseWPF>true</UseWPF>
8+
<StartupObject>VRCOSC.App</StartupObject>
9+
<ApplicationIcon>Assets\1024.ico</ApplicationIcon>
10+
<AssemblyName>VRCOSCChatBox</AssemblyName>
11+
<Authors>Dbqt</Authors>
12+
<Copyright>2022</Copyright>
13+
<Description>Simple app that sends messages to VRC chatbox via VRC OSC.</Description>
14+
<PackageIcon>1024.png</PackageIcon>
15+
<AssemblyVersion>0.1.0.0</AssemblyVersion>
16+
<FileVersion>0.1.0.0</FileVersion>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<Content Include="Assets\1024.ico">
21+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
22+
</Content>
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<Reference Include="SharpOSC">
27+
<HintPath>..\..\OSCTest\OSCTest\OSCTest\Plugins\SharpOSC.dll</HintPath>
28+
</Reference>
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<Compile Update="Properties\Settings.Designer.cs">
33+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
34+
<AutoGen>True</AutoGen>
35+
<DependentUpon>Settings.settings</DependentUpon>
36+
</Compile>
37+
</ItemGroup>
38+
39+
<ItemGroup>
40+
<None Update="Assets\1024.png">
41+
<Pack>True</Pack>
42+
<PackagePath>\</PackagePath>
43+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
44+
</None>
45+
<None Update="Plugins\SharpOSC.dll">
46+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
47+
</None>
48+
<None Update="Properties\Settings.settings">
49+
<Generator>SettingsSingleFileGenerator</Generator>
50+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
51+
</None>
52+
</ItemGroup>
53+
54+
</Project>

0 commit comments

Comments
 (0)
Please sign in to comment.