Skip to content

Commit

Permalink
Merge pull request #5 from SCKorea/Aquila
Browse files Browse the repository at this point in the history
Aquila
  • Loading branch information
marona42 authored Mar 10, 2021
2 parents 102ae4d + 8592806 commit e9dc5bf
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 133 deletions.
34 changes: 5 additions & 29 deletions SCTools/SCTool_Redesigned/Pages/mainNotes.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,16 @@
mc:Ignorable="d"
d:DesignHeight="480" d:DesignWidth="480"
Title="mainNotes">
<Page.Background>
<SolidColorBrush Opacity="0.8" Color="{StaticResource BackgroundColor}"/>
</Page.Background>

<FrameworkElement.CommandBindings>
<CommandBinding Command="{x:Static markdig:Commands.Hyperlink}" Executed="OpenHyperlink" />
</FrameworkElement.CommandBindings>

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<TextBlock x:Name="Menu_patchnote" Grid.Row="1" Grid.Column="0"
Text="{x:Static lang:Resources.UI_Tab_Main_ReleaseNote}" FontSize="16" FontWeight="DemiBold" Foreground="{StaticResource TextBrush}" FontFamily="{StaticResource SCDream5}" VerticalAlignment="Center" TextAlignment="Center" PreviewMouseLeftButtonDown="Menu_patchnote_PreviewMouseLeftButtonDown"
/>
<TextBlock x:Name="Menu_qna" Grid.Row="1" Grid.Column="1"
Text="{x:Static lang:Resources.UI_Tab_Main_Qna}" FontSize="16" FontWeight="DemiBold" Foreground="{StaticResource TextBrush}" FontFamily="{StaticResource SCDream5}" VerticalAlignment="Center" TextAlignment="Center" PreviewMouseLeftButtonDown="Menu_qna_PreviewMouseLeftButtonDown"
/>
<TextBlock x:Name="Menu_credit" Grid.Row="1" Grid.Column="2"
Text="{x:Static lang:Resources.UI_Tab_Main_Credit}" FontSize="16" FontWeight="DemiBold" Foreground="{StaticResource TextBrush}" FontFamily="{StaticResource SCDream5}" VerticalAlignment="Center" TextAlignment="Center" PreviewMouseLeftButtonDown="Menu_credit_PreviewMouseLeftButtonDown"
/>
<Image x:Name="Community_link1" Grid.Row="1" Grid.Column="4" PreviewMouseLeftButtonUp="Open_Community_1" Cursor="Hand" />
<Image x:Name="Community_link2" Grid.Row="1" Grid.Column="5" PreviewMouseLeftButtonUp="Open_Community_2" Cursor="Hand" />

<FlowDocumentScrollViewer x:Name="NoteBlock" Grid.Row="2" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="-14,0,-14,0" Grid.ColumnSpan="6" TextOptions.TextFormattingMode="Display" IsTabStop="False" Focusable="False"/>
<Grid>
<FlowDocumentScrollViewer x:Name="NoteBlock" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="15,20" TextOptions.TextFormattingMode="Display" IsTabStop="False" Focusable="False"/>
</Grid>

</Page>
84 changes: 16 additions & 68 deletions SCTools/SCTool_Redesigned/Pages/mainNotes.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,73 +34,41 @@ public partial class mainNotes : Page
{
internal static mainNotes UI;

public mainNotes()
public mainNotes(int idx)
{
UI = this;

InitializeComponent();

set_note(0);
set_link(App.Settings.GameLanguage);

set_note(idx);
GoogleAnalytics.Hit(App.Settings.UUID, "/main", "Program Main");
}

private void set_link(string language)
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(delegate
{
Community_link1.Source = Base64ToImage(Properties.Resources.UI_Button_Image_Community_1).Source;
Community_link1.ToolTip = Properties.Resources.UI_Button_Tooltip_Community_1;
Community_link2.Source = Base64ToImage(Properties.Resources.UI_Button_Image_Community_2).Source;
Community_link2.ToolTip = Properties.Resources.UI_Button_Tooltip_Community_2;
}));
}
private void set_note(int idx)
public void set_note(int idx)
{

switch (idx)
{
case 0: //patchnote
Menu_patchnote.Foreground = (SolidColorBrush)App.Current.Resources["KeyPointBrush"];
Menu_credit.Foreground = (SolidColorBrush)App.Current.Resources["TextBrush"];
Menu_qna.Foreground = (SolidColorBrush)App.Current.Resources["TextBrush"];
ShowReleasesNote();
break;

case 1: //qna
Menu_patchnote.Foreground = (SolidColorBrush)App.Current.Resources["TextBrush"];
Menu_credit.Foreground = (SolidColorBrush)App.Current.Resources["TextBrush"];
Menu_qna.Foreground = (SolidColorBrush)App.Current.Resources["KeyPointBrush"];

ShowMarkdownDocument("QNA.md");
break;
case 2: //credit
Menu_patchnote.Foreground = (SolidColorBrush)App.Current.Resources["TextBrush"];
Menu_credit.Foreground = (SolidColorBrush)App.Current.Resources["KeyPointBrush"];
Menu_qna.Foreground = (SolidColorBrush)App.Current.Resources["TextBrush"];

ShowMarkdownDocument("CREDIT.md");
break;
default:
throw new ArgumentException("invalid note index " + idx.ToString());
}
}
private void Menu_patchnote_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
set_note(0);
}
private void Menu_qna_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
set_note(1);
}
private void Menu_credit_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
set_note(2);
}

private void OpenHyperlink(object sender, ExecutedRoutedEventArgs e)
{
var link = e.Parameter.ToString();
if(!link.StartsWith("http://") && !link.StartsWith("https://"))
if (!link.StartsWith("http://") && !link.StartsWith("https://"))
{
link = "https://" + link;
}
Expand All @@ -112,7 +80,7 @@ private void OpenHyperlink(object sender, ExecutedRoutedEventArgs e)
}
catch (Exception ex)
{
MessageBox.Show(Properties.Resources.MSG_Decs_CannotOpenLink+"\n"+ex.Message, Properties.Resources.MSG_Title_CannotOpenLink);
MessageBox.Show(Properties.Resources.MSG_Decs_CannotOpenLink + "\n" + ex.Message, Properties.Resources.MSG_Title_CannotOpenLink);
}
}

Expand Down Expand Up @@ -166,40 +134,20 @@ private void ShowFlowDocument(string name, string markdown)
}));
}

private void Open_Community_1(object sender, MouseButtonEventArgs e) => Process.Start(Properties.Resources.UI_Button_Link_Community_1);

private void Open_Community_2(object sender, MouseButtonEventArgs e) => Process.Start(Properties.Resources.UI_Button_Link_Community_2);

private Image Base64ToImage(string image)
class MyXamlSchemaContext : XamlSchemaContext
{
Image img = new Image();
byte[] binaryData = Convert.FromBase64String(image);
BitmapImage bi = new BitmapImage();

bi.BeginInit();
using (bi.StreamSource = new MemoryStream(binaryData))
public override bool TryGetCompatibleXamlNamespace(string xamlNamespace, out string compatibleNamespace)
{
bi.CacheOption = BitmapCacheOption.OnLoad;
bi.EndInit();

img.Source = bi;
}

return img;
}
}

class MyXamlSchemaContext : XamlSchemaContext
{
public override bool TryGetCompatibleXamlNamespace(string xamlNamespace, out string compatibleNamespace)
{
if (xamlNamespace.Equals("clr-namespace:Markdig.Wpf", StringComparison.Ordinal))
{
//compatibleNamespace = $"clr-namespace:Markdig.Wpf;assembly={Assembly.GetAssembly(typeof(Markdig.Wpf.Styles)).FullName}";
compatibleNamespace = "";
return true;
if (xamlNamespace.Equals("clr-namespace:Markdig.Wpf", StringComparison.Ordinal))
{
//compatibleNamespace = $"clr-namespace:Markdig.Wpf;assembly={Assembly.GetAssembly(typeof(Markdig.Wpf.Styles)).FullName}";
compatibleNamespace = "";
return true;
}
return base.TryGetCompatibleXamlNamespace(xamlNamespace, out compatibleNamespace);
}
return base.TryGetCompatibleXamlNamespace(xamlNamespace, out compatibleNamespace);
}
}
}
6 changes: 3 additions & 3 deletions SCTools/SCTool_Redesigned/Pages/selectPatchLang.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<Grid>
<Label Content="{x:Static lang:Resources.UI_Title_ChooseLocalization}" FontSize="24" Foreground="{StaticResource TextBrush}" FontFamily="{StaticResource SCDream5}" HorizontalContentAlignment="Center"
HorizontalAlignment="Center" Height="48" Margin="0,-110,0,0" VerticalAlignment="Center" Width="480"/>
<ComboBox x:Name="LocalizationListBox" HorizontalAlignment="Center" Height="26" Margin="0,0,0,0" VerticalAlignment="Center" Width="210" FontSize="15" SelectionChanged="LocalizationListBox_SelectionChanged"/>
<Button x:Name="applyBtn" Content="{x:Static lang:Resources.UI_Button_Select}" FontSize="18" HorizontalAlignment="center" Height="35" Margin="0,90,0,0" VerticalAlignment="Center" Width="100" Click="applyBtn_Click"/>
HorizontalAlignment="Center" Height="48" Margin="0,100,0,0" VerticalAlignment="Center" Width="480"/>
<ComboBox x:Name="LocalizationListBox" HorizontalAlignment="Center" Height="26" Margin="0,160,0,0" VerticalAlignment="Center" Width="210" FontSize="15" SelectionChanged="LocalizationListBox_SelectionChanged"/>
<Button x:Name="applyBtn" Content="{x:Static lang:Resources.UI_Button_Select}" FontSize="18" HorizontalAlignment="center" Height="35" Margin="0,240,0,0" VerticalAlignment="Center" Width="100" Click="applyBtn_Click"/>

</Grid>
</Page>
4 changes: 2 additions & 2 deletions SCTools/SCTool_Redesigned/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
2 changes: 1 addition & 1 deletion SCTools/SCTool_Redesigned/Properties/Resources.ko-KR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
<value>런처 업데이트 중</value>
</data>
<data name="UI_Desc_Welcome" xml:space="preserve">
<value>환영합니다.</value>
<value>환영합니다</value>
</data>
<data name="UI_Tab_Main_Credit" xml:space="preserve">
<value>라이센스</value>
Expand Down
Binary file added SCTools/SCTool_Redesigned/Resources/BG0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SCTools/SCTool_Redesigned/Resources/BG1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed SCTools/SCTool_Redesigned/Resources/Discord-Logo.png
Binary file not shown.
Binary file removed SCTools/SCTool_Redesigned/Resources/Ncafe-Logo.png
Binary file not shown.
8 changes: 4 additions & 4 deletions SCTools/SCTool_Redesigned/SCTool_Redesigned.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Discord-Logo.png" />
<Resource Include="Resources\Discord-Logo2.png" />
<Resource Include="Resources\Ncafe-Logo2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Ncafe-Logo.png" />
<Resource Include="Resources\BG0.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Discord-Logo2.png" />
<Resource Include="Resources\Ncafe-Logo2.png" />
<Resource Include="Resources\BG1.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.6.3.0\build\Fody.targets" Condition="Exists('..\packages\Fody.6.3.0\build\Fody.targets')" />
Expand Down
Loading

0 comments on commit e9dc5bf

Please sign in to comment.