mirror of
https://e.coding.net/circlecloud/CTZLauncher.git
synced 2024-11-14 00:48:48 +00:00
Updata...
This commit is contained in:
parent
af5d9e3ec7
commit
1b86b02383
@ -5,7 +5,7 @@
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EC25362D-5BA7-4CB3-BDA2-C575B9318086}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CTZLauncher</RootNamespace>
|
||||
<AssemblyName>CTZLauncher</AssemblyName>
|
||||
|
@ -4,8 +4,7 @@
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="CTZLauncher.MainWindow"
|
||||
ResizeMode = "NoResize"
|
||||
MouseMove="Window_MouseMove"
|
||||
Title="MainWindow" Height="600" Width="800" Background="#FF3A3A3A" AllowsTransparency="True" WindowStyle="None" Visibility="Visible" HorizontalContentAlignment="Center" HorizontalAlignment="Center" Icon="ico.ico" VerticalAlignment="Center" VerticalContentAlignment="Center" WindowStartupLocation="CenterScreen" Initialized="Window_Initialized" Loaded="Window_Loaded" FontFamily="Microsoft YaHei">
|
||||
Title="MainWindow" Height="600" Width="800" Background="#FF3A3A3A" AllowsTransparency="True" WindowStyle="None" Visibility="Visible" HorizontalContentAlignment="Center" HorizontalAlignment="Center" Icon="ico.ico" VerticalAlignment="Center" VerticalContentAlignment="Center" WindowStartupLocation="CenterScreen" Initialized="Window_Initialized" FontFamily="Microsoft YaHei" Loaded="s">
|
||||
|
||||
<Window.Resources>
|
||||
<!-- s:Double表示了变量类型 x:key表示了变量名 -->
|
||||
@ -55,9 +54,9 @@
|
||||
<Grid Margin="0,20,20,0" HorizontalAlignment="Right" Width="300">
|
||||
<Grid>
|
||||
<Grid Margin="10,10,10,0" Height="174" VerticalAlignment="Top">
|
||||
<Label Content="————— XX XX 帐 号 —————" VerticalAlignment="Top" Margin="10,0" HorizontalContentAlignment="Center" FontSize="15"/>
|
||||
<Label Content="————— 游 戏 帐 号 —————" VerticalAlignment="Top" Margin="10,0" HorizontalContentAlignment="Center" FontSize="15"/>
|
||||
<TextBox x:Name="username" Template="{StaticResource CornerTextBox}" Height="34" TextWrapping="Wrap" Text="" VerticalAlignment="Top" HorizontalContentAlignment="Center" FontFamily="微软雅黑" FontSize="20" Margin="30,30,30,0" />
|
||||
<Label Content="————— XX XX 密 码 —————" VerticalAlignment="Top" Margin="10,69,10,0" HorizontalContentAlignment="Center" FontSize="15"/>
|
||||
<Label Content="————— 游 戏 密 码 —————" VerticalAlignment="Top" Margin="10,69,10,0" HorizontalContentAlignment="Center" FontSize="15"/>
|
||||
<TextBox x:Name="password" Template="{StaticResource CornerTextBox}" TextWrapping="Wrap" HorizontalContentAlignment="Center" FontFamily="微软雅黑" FontSize="20" Margin="30,104,30,0" Height="34" VerticalAlignment="Top" />
|
||||
<Button Margin="217,106,33,0" Template="{StaticResource CornerButton}" Height="30" Content="?" VerticalAlignment="Top" />
|
||||
</Grid>
|
||||
|
@ -19,6 +19,7 @@ using KMCCC.Modules.JVersion;
|
||||
using CityCraft;
|
||||
using System.IO;
|
||||
using System.Windows.Threading;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
namespace CTZLauncher
|
||||
{
|
||||
@ -28,6 +29,7 @@ namespace CTZLauncher
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
LauncherCore launcher = null;
|
||||
int serverport = 25580;
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -42,16 +44,6 @@ namespace CTZLauncher
|
||||
launcher = LauncherCore.Create(".minecraft");
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Window_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void barclick_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Label bar = (Label)sender;
|
||||
@ -79,11 +71,16 @@ namespace CTZLauncher
|
||||
|
||||
private void Login_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (username.Text.Length == 0 || password.Text.Length == 0)
|
||||
{
|
||||
MessageBox.Show("请输入账号密码!");
|
||||
return;
|
||||
}
|
||||
Login.IsEnabled = false;
|
||||
CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "127.0.0.1", 2000);
|
||||
CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "citycraft.cn", serverport);
|
||||
if (auth.isLogin())
|
||||
{
|
||||
MessageBox.Show("当前玩家已登录!");
|
||||
MessageBox.Show("当前玩家已登录服务器!");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -97,6 +94,12 @@ namespace CTZLauncher
|
||||
else
|
||||
{
|
||||
ServerWindow.Visibility = System.Windows.Visibility.Visible;
|
||||
RotateTransform rtf = new RotateTransform();
|
||||
ServerWindow.RenderTransform = rtf;
|
||||
LoginWindow.RenderTransform = rtf;
|
||||
DoubleAnimation dbAscending = new DoubleAnimation(0, 360, new Duration(TimeSpan.FromSeconds(0.75)));
|
||||
dbAscending.RepeatBehavior = new RepeatBehavior(1);
|
||||
rtf.BeginAnimation(RotateTransform.AngleProperty, dbAscending);
|
||||
}
|
||||
}
|
||||
Login.IsEnabled = true;
|
||||
@ -172,7 +175,7 @@ namespace CTZLauncher
|
||||
MessageBox.Show("请输入账号密码!");
|
||||
return;
|
||||
}
|
||||
CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "127.0.0.1", 2000);
|
||||
CTZAuthenticator auth = new CTZAuthenticator(username.Text, password.Text, "citycraft.cn", serverport);
|
||||
if (auth.isRegistered())
|
||||
{
|
||||
MessageBox.Show("该用户名已注册 请更换用户名!");
|
||||
@ -187,5 +190,10 @@ namespace CTZLauncher
|
||||
else
|
||||
MessageBox.Show("注册失败!");
|
||||
}
|
||||
|
||||
private void s(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user