Skip to content

Commit

Permalink
Merge pull request #9 from nukora/feature/#8
Browse files Browse the repository at this point in the history
Feature/#8
  • Loading branch information
nukora authored Mar 7, 2021
2 parents e474a30 + 095fdd9 commit 5b515ba
Show file tree
Hide file tree
Showing 45 changed files with 2,700 additions and 1,345 deletions.
8 changes: 7 additions & 1 deletion VRChatActivityLogViewer/VRChatActivityLogViewer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29503.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRChatActivityLogViewer", "VRChatActivityLogViewer\VRChatActivityLogViewer.csproj", "{2A0D35BA-6621-4B75-BF8D-C37D9858FED0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VRChatActivityLogViewer", "VRChatActivityLogViewer\VRChatActivityLogViewer.csproj", "{2A0D35BA-6621-4B75-BF8D-C37D9858FED0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VRChatActivityToolsShared", "..\VRChatActivityToolsShared\VRChatActivityToolsShared\VRChatActivityToolsShared.csproj", "{87F7193A-DFB6-4E46-9434-842E70E50472}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,6 +17,10 @@ Global
{2A0D35BA-6621-4B75-BF8D-C37D9858FED0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0D35BA-6621-4B75-BF8D-C37D9858FED0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A0D35BA-6621-4B75-BF8D-C37D9858FED0}.Release|Any CPU.Build.0 = Release|Any CPU
{87F7193A-DFB6-4E46-9434-842E70E50472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87F7193A-DFB6-4E46-9434-842E70E50472}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87F7193A-DFB6-4E46-9434-842E70E50472}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87F7193A-DFB6-4E46-9434-842E70E50472}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
30 changes: 30 additions & 0 deletions VRChatActivityLogViewer/VRChatActivityLogViewer/AboutDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Window x:Class="VRChatActivityLogViewer.AboutDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VRChatActivityLogViewer"
mc:Ignorable="d"
Title="About" Height="260" Width="500" WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="16,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<Image Source="icon.ico" Width="50" Height="50" Margin="5"/>
<TextBlock FontSize="32" VerticalAlignment="Center">VRChatActivityViewer</TextBlock>
</StackPanel>
<TextBlock x:Name="versionText" Margin="5">v0.0.0</TextBlock>
<TextBlock Margin="5,5,5,5">Copyright (c) 2019 nukora</TextBlock>
<TextBlock Margin="5,5,5,0">GitHub: <Hyperlink NavigateUri="https://github.com/nukora/VRChatActivityTools" RequestNavigate="Hyperlink_RequestNavigate">https://github.com/nukora/VRChatActivityTools</Hyperlink></TextBlock>
<TextBlock Margin="5,0,5,5">Booth: <Hyperlink NavigateUri="https://nukora.booth.pm/items/1690568" RequestNavigate="Hyperlink_RequestNavigate">https://nukora.booth.pm/items/1690568</Hyperlink></TextBlock>
<TextBlock Margin="5,5,5,5">Twitter: <Hyperlink NavigateUri="https://twitter.com/ilove_kemomimi" RequestNavigate="Hyperlink_RequestNavigate">@ilove_kemomimi</Hyperlink></TextBlock>
</StackPanel>
<Grid Grid.Row="1" />
<Grid Grid.Row="1" Margin="16,8">
<Button Content="OK" VerticalAlignment="Center" HorizontalAlignment="Right" Width="70" Click="closeButton_Click" />
</Grid>
</Grid>
</Window>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace VRChatActivityLogViewer
{
/// <summary>
/// AboutDialog.xaml の相互作用ロジック
/// </summary>
public partial class AboutDialog : Window
{
public AboutDialog()
{
InitializeComponent();

var version = Assembly.GetExecutingAssembly().GetName().Version;

versionText.Text = $"v{version.Major}.{version.Minor}.{version.Build}";
}

private void closeButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}

private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo("cmd", $"/c start {e.Uri}") { CreateNoWindow = true });
}
}
}
43 changes: 0 additions & 43 deletions VRChatActivityLogViewer/VRChatActivityLogViewer/ActivityLog.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,50 +1,67 @@
using System;
using VRChatActivityToolsShared.Database;

namespace VRChatActivityLogViewer
{
/// <summary>
/// DataGridに表示するモデル
/// </summary>
class ActivityLogGridModel
public class ActivityLogGridModel
{
/// <summary>タイムスタンプ</summary>
public DateTime TimeStamp { get; set; }
public DateTime TimeStamp { get; }

/// <summary>アクティビティの種類の名前</summary>
public string ActivityName { get; set; }
public string ActivityName { get; }

/// <summary>アクティビティの種類</summary>
public ActivityType Type { get; set; }
public ActivityType Type { get; }

/// <summary>アクティビティの内容</summary>
public string Content { get; set; }
public string Content { get; }

/// <summary>ワールドIDがコピーできるか</summary>
public bool IsCopyableWorldID { get; set; } = false;
public bool IsCopyableWorldID { get; } = false;

/// <summary>ユーザIDがコピーできるか</summary>
public bool IsCopyableUserID { get; set; } = false;
public bool IsCopyableUserID { get; } = false;

/// <summary>詳細画面が有効かどうか</summary>
public bool IsDetailWindowEnabled { get; } = false;

/// <summary>ワールドID</summary>
public string WorldID { get; set; }
public string WorldID { get; }

/// <summary>ユーザID</summary>
public string UserID { get; set; }
public string UserID { get; }

/// <summary>元データ</summary>
public ActivityLog Source { get; }

/// <summary>
/// コンストラクタ
/// </summary>
/// <param name="activityLog"></param>
public ActivityLogGridModel(ActivityLog activityLog)
{
Source = activityLog;

Type = activityLog.ActivityType;
TimeStamp = activityLog.Timestamp ?? default;

var addIcon = string.Empty;
if (activityLog.Message != null || activityLog.Url != null)
{
addIcon += "";
}

if (activityLog.ActivityType == ActivityType.JoinedRoom)
{
ActivityName = "Join";
Content = activityLog.WorldName;
WorldID = activityLog.WorldID;
IsCopyableWorldID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.MetPlayer)
{
Expand All @@ -54,53 +71,76 @@ public ActivityLogGridModel(ActivityLog activityLog)
if (activityLog.ActivityType == ActivityType.SendInvite)
{
ActivityName = "Send Invite";
Content = activityLog.WorldName;
Content = addIcon + activityLog.WorldName;
WorldID = activityLog.WorldID;
IsCopyableWorldID = true;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.ReceivedInvite)
{
ActivityName = "Received Invite";
Content = activityLog.UserName + " -> " + activityLog.WorldName;
Content = addIcon + activityLog.UserName + " -> " + activityLog.WorldName;
WorldID = activityLog.WorldID;
IsCopyableWorldID = true;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.SendRequestInvite)
{
ActivityName = "Send RequestInvite";
UserID = activityLog.UserID;
UserID = addIcon + activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.ReceivedRequestInvite)
{
ActivityName = "Received RequestInvite";
Content = activityLog.UserName;
Content = addIcon + activityLog.UserName;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.SendFriendRequest)
{
ActivityName = "Send FriendRequest";
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.ReceivedFriendRequest)
{
ActivityName = "Received FriendRequest";
Content = activityLog.UserName;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.AcceptFriendRequest)
{
ActivityName = "Accept FriendRequest";
Content = activityLog.UserName;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.ReceivedInviteResponse)
{
ActivityName = "Received InviteResponse";
Content = addIcon + activityLog.UserName;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
if (activityLog.ActivityType == ActivityType.ReceivedRequestInviteResponse)
{
ActivityName = "Received RequestInviteResponse";
Content = addIcon + activityLog.UserName;
UserID = activityLog.UserID;
IsCopyableUserID = true;
IsDetailWindowEnabled = true;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ class ActivityLogSearchParameter

/// <summary>検索する期間の終わり</summary>
public DateTime? UntilDateTime { get; set; } = null;

/// <summary>inviteへの返信を受け取った履歴を含める</summary>
public bool IsReceivedInviteResponse { get; set; } = true;

/// <summary>reqInvへの返信を受け取った履歴を含める</summary>
public bool IsReceivedRequestInviteResponse { get; set; } = true;
}
}
35 changes: 0 additions & 35 deletions VRChatActivityLogViewer/VRChatActivityLogViewer/ActivityType.cs

This file was deleted.

3 changes: 2 additions & 1 deletion VRChatActivityLogViewer/VRChatActivityLogViewer/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VRChatActivityLogViewer"
StartupUri="MainWindow.xaml">
StartupUri="MainWindow.xaml"
ShutdownMode="OnMainWindowClose">
<Application.Resources>

</Application.Resources>
Expand Down
32 changes: 0 additions & 32 deletions VRChatActivityLogViewer/VRChatActivityLogViewer/DatabaseContext.cs

This file was deleted.

Loading

0 comments on commit 5b515ba

Please sign in to comment.