Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
ADD NEXUS SOLO MODE AND MUTATORS.
Browse files Browse the repository at this point in the history
  • Loading branch information
B1ackSand committed Oct 17, 2023
1 parent 2b4dc1c commit bd9c0d2
Show file tree
Hide file tree
Showing 24 changed files with 1,418 additions and 54 deletions.
22 changes: 20 additions & 2 deletions LiaoTian_Cup/Dictionary/I18n/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions LiaoTian_Cup/Dictionary/I18n/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
<value>RandMap:</value>
</data>
<data name="BanTip" xml:space="preserve">
<value>Right click to ban a mutator</value>
<value>Right click to ban</value>
</data>
<data name="HasBanMutators" xml:space="preserve">
<value>Banned mutators:</value>
Expand Down Expand Up @@ -370,7 +370,7 @@
<value>6 mutators mode</value>
</data>
<data name="BraveMode" xml:space="preserve">
<value>Brave mode</value>
<value>Vincent's Game</value>
</data>
<data name="决战塔桑尼斯" xml:space="preserve">
<value>Tarsonis</value>
Expand All @@ -393,4 +393,10 @@
<data name="FreeMutatorsWarn4" xml:space="preserve">
<value>6 mutators mode will need you pick 4 free choice mutators</value>
</data>
<data name="HubSoloMode" xml:space="preserve">
<value>Nexus solo mode</value>
</data>
<data name="铁甲钢拳" xml:space="preserve">
<value>Real Steel</value>
</data>
</root>
8 changes: 7 additions & 1 deletion LiaoTian_Cup/Dictionary/I18n/Lang.zh.resx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<value>正常单刷模式</value>
</data>
<data name="About" xml:space="preserve">
<value>关于</value>
<value>关于我</value>
</data>
<data name="PlayerName" xml:space="preserve">
<value>选手名称:</value>
Expand Down Expand Up @@ -393,4 +393,10 @@
<data name="FreeMutatorsWarn4" xml:space="preserve">
<value>6因子模式需要至少自选4个因子</value>
</data>
<data name="HubSoloMode" xml:space="preserve">
<value>枢纽单刷模式</value>
</data>
<data name="铁甲钢拳" xml:space="preserve">
<value>铁甲钢拳</value>
</data>
</root>
24 changes: 24 additions & 0 deletions LiaoTian_Cup/Helper/DbHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,28 @@ public static List<string[]> GetListData(string tableName,int columnCount, List<
connection.Close();
return list;
}

public static List<string[]> GetCostListData(string tableName, int columnCount, List<string[]> list)
{
using var connection = new SqliteConnection("Data Source=./Resources/database.db");
connection.Open();

var command = connection.CreateCommand();
command.CommandText = $"SELECT * FROM {tableName} ORDER BY \"group\" DESC";

using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
string[] rowStrings = new string[columnCount];
for (int i = 0; i < columnCount; i++)
{
rowStrings[i] = Convert.ToString(reader[i]);
}
list.Add(rowStrings);
}
}
connection.Close();
return list;
}
}
9 changes: 7 additions & 2 deletions LiaoTian_Cup/Helper/FileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ public class FileData
public static List<string> hubNegativeFactorInfo = new List<string>();
public static List<string> hubMultiFactorInfo = new List<string>();
public static List<string> hubFactorList = new List<string>();
public static List<string[]> hubFactorCostList = new List<string[]>();
public static List<string> hubBeforeCommanderInfo = new List<string>();
public static List<string> hubAfterCommanderInfo = new List<string>();
public static List<string> braveMapsInfo = new List<string>();

//存放地图数据
public static List<string> hubMapsInfo = new List<string>();
public static List<string> braveMapsInfo = new List<string>();
public static List<string> mapsInfo = new List<string>();

public FileData()
Expand All @@ -56,7 +58,9 @@ public FileData()
private void ReadDataBase()
{
DbHelper.GetListData("global_weeklymutations", 5, mutationList);
DbHelper.GetListData("group_MutatorList_Cost", 3, scoreFactorList);
DbHelper.GetCostListData("group_MutatorList_Cost", 3, scoreFactorList);
DbHelper.GetCostListData("hub_MutatorList_Cost", 3, hubFactorCostList);


DbHelper.GetColumnData("global_mutatorlist", mutationFactorList);
DbHelper.GetColumnData("global_cmdroldlist", beforeCommanderInfo);
Expand All @@ -79,6 +83,7 @@ private void ReadDataBase()
DbHelper.GetColumnData("hub_cmdroldlist", hubBeforeCommanderInfo);
DbHelper.GetColumnData("hub_cmdrnewlist", hubAfterCommanderInfo);
DbHelper.GetColumnData("hub_bravemap", braveMapsInfo);
DbHelper.GetColumnData("hub_splmaplist", hubMapsInfo);
}
}
}
12 changes: 12 additions & 0 deletions LiaoTian_Cup/LiaoTian_Cup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<None Remove="Resources\commander\阿纳拉克.png" />
<None Remove="Resources\commander\雷诺.png" />
<None Remove="Resources\database.db" />
<None Remove="Resources\factor\nexusbattlefield.png" />
<None Remove="Resources\factor\万钧皇权.png" />
<None Remove="Resources\factor\不给糖果就捣蛋.png" />
<None Remove="Resources\factor\丧尸大战.png" />
Expand Down Expand Up @@ -109,6 +110,7 @@
<None Remove="Resources\factor\撕裂现实.png" />
<None Remove="Resources\factor\无边恐惧.png" />
<None Remove="Resources\factor\时空力场.png" />
<None Remove="Resources\factor\时空战场.png" />
<None Remove="Resources\factor\时空立场.png" />
<None Remove="Resources\factor\时间扭曲.png" />
<None Remove="Resources\factor\晶矿护盾.png" />
Expand Down Expand Up @@ -195,6 +197,7 @@
<None Remove="Resources\maps\虚空降临.png" />
<None Remove="Resources\maps\融火危机.png" />
<None Remove="Resources\maps\重返亡灵之城.png" />
<None Remove="Resources\maps\铁甲钢拳.png" />
<None Remove="Resources\maps\黑暗杀星.png" />
<None Remove="Resources\R-C-16-9.jpg" />
<None Remove="Resources\R-C.jpg" />
Expand Down Expand Up @@ -260,6 +263,9 @@
<Resource Include="Resources\commander\赛兰蒂斯.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\factor\nexusbattlefield.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\factor\万钧皇权.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down Expand Up @@ -290,6 +296,9 @@
<Resource Include="Resources\factor\撕裂现实.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\factor\时空战场.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\factor\此面向敌.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down Expand Up @@ -693,6 +702,9 @@
<Resource Include="Resources\maps\重返亡灵之城.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\maps\铁甲钢拳.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\maps\黑暗杀星.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
Expand Down
78 changes: 56 additions & 22 deletions LiaoTian_Cup/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,76 @@
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Row="0" Grid.ColumnSpan="3">
<Image
HorizontalAlignment="Center"
VerticalAlignment="Top"
Source="/LiaoTian_Cup;component/Resources/Logo/聊天杯标题.png" />
</Grid>

<Grid Grid.Row="1">
<Grid Grid.Row="1" Grid.Column="0">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="300" />
<Setter Property="Height" Value="60" />
<Setter Property="Margin" Value="20,20,0,0" />
<Setter Property="Margin" Value="0,20,0,0" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
</Style>
</StackPanel.Resources>

<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Button
Margin="20,20,0,0"
Click="Button_RandomMutation_Click"
Content="{Binding [RandMutationsMode], Source={x:Static local:LanguageManager.Instance}}" />
<StackPanel HorizontalAlignment="Center" Orientation="Vertical">
<Button Click="Button_RandomMutation_Click" Content="{Binding [RandMutationsMode], Source={x:Static local:LanguageManager.Instance}}" />
<Button Click="Button_Negative_Click" Content="{Binding [NegativeMutatorsMode], Source={x:Static local:LanguageManager.Instance}}" />
</StackPanel>
<StackPanel
Margin="0,20,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button Click="Button_Doubles_Click" Content="{Binding [DoublesMode], Source={x:Static local:LanguageManager.Instance}}" />
<Button Click="Button_Single_Click" Content="{Binding [SingleMode], Source={x:Static local:LanguageManager.Instance}}" />
<Button Click="Button_Doubles_Click" Content="{Binding [DoublesMode], Source={x:Static local:LanguageManager.Instance}}" />
</StackPanel>
<StackPanel
Margin="0,20,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button Click="Button_USuck_Click" Content="{Binding [USuckMode], Source={x:Static local:LanguageManager.Instance}}" />
<Button Click="Button_Hub_Click" Content="{Binding [HubMode], Source={x:Static local:LanguageManager.Instance}}" />
</StackPanel>
</StackPanel>
</Grid>

<Grid Grid.Row="2">
<Grid Grid.Row="1" Grid.Column="1">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="300" />
<Setter Property="Height" Value="60" />
<Setter Property="Margin" Value="0,20,0,0" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
</Style>
</StackPanel.Resources>

<Button Click="Button_SoloHub_Click" Content="{Binding [HubSoloMode], Source={x:Static local:LanguageManager.Instance}}" />
<Button Click="Button_Hub_Click" Content="{Binding [HubMode], Source={x:Static local:LanguageManager.Instance}}" />
</StackPanel>
</Grid>

<Grid Grid.Row="1" Grid.Column="2">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top">
<StackPanel.Resources>
<Style TargetType="Button">
<Setter Property="Width" Value="300" />
<Setter Property="Height" Value="60" />
<Setter Property="Margin" Value="0,20,0,0" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
</Style>
</StackPanel.Resources>

<Button Click="Button_USuck_Click" Content="{Binding [USuckMode], Source={x:Static local:LanguageManager.Instance}}" />
</StackPanel>
</Grid>

<Grid Grid.Row="2" Grid.ColumnSpan="3">
<StackPanel>
<Button
Width="120"
Expand All @@ -80,6 +105,15 @@
Content="{Binding [LangBtn], Source={x:Static local:LanguageManager.Instance}}"
FontSize="15" />
</StackPanel>
<Button
Width="200"
Height="40"
Margin="0,0,15,10"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="AddGroupBtn"
Content="聊天杯赛事群:437813472"
FontSize="15" />
</Grid>
</Grid>
</Page>
25 changes: 15 additions & 10 deletions LiaoTian_Cup/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ public MainPage()
/// <param name="e"></param>
private void I18nBtn(object sender, RoutedEventArgs e)
{
if((sender as Button).Content.ToString().Equals("English"))
{
LanguageManager.Instance.ChangeLanguage(new CultureInfo("en-US"));
}
else
{
LanguageManager.Instance.ChangeLanguage(new CultureInfo("zh-CN"));
}

LanguageManager.Instance.ChangeLanguage((sender as Button).Content.ToString().Equals("English")
? new CultureInfo("en-US")
: new CultureInfo("zh-CN"));
}

private void Button_RandomMutation_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -65,9 +59,20 @@ private void Button_Hub_Click(object sender, RoutedEventArgs e)
this.NavigationService.Navigate(new Uri("/LiaoTian_Cup;component/Mode/HubModeWindow.xaml", UriKind.Relative));
}

private void Button_SoloHub_Click(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Uri("/LiaoTian_Cup;component/Mode/HubSoloModeWindow.xaml", UriKind.Relative));
}

private void AboutMeBtn(object sender, RoutedEventArgs e)
{
string url = "https://github.com/B1ackSand";
var url = "https://github.com/B1ackSand";
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
}

private void AddGroupBtn(object sender, RoutedEventArgs e)
{
string url = "https://qm.qq.com/q/nS395vkauA";
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
}
}
Expand Down
2 changes: 2 additions & 0 deletions LiaoTian_Cup/Mode/DoublesModeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void ResetFunc()
{
Warn.Text = "";
ModeBox.IsEnabled = true;
RandStartBtn.IsEnabled = true;
SetRandMapEnable(true);
SetBaseFactorEnable(true);

Expand Down Expand Up @@ -132,6 +133,7 @@ public void ResetFunc()
private void Button_Random_Click(object sender, RoutedEventArgs e)
{
ModeBox.IsEnabled = false;
RandStartBtn.IsEnabled = false;
ShowRandomMaps();
}

Expand Down
1 change: 1 addition & 0 deletions LiaoTian_Cup/Mode/HubModeWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
<Image x:Name="NegativeFactor3" />
<Image x:Name="NegativeFactor4" />
<Image x:Name="NegativeFactor5" />
<Image x:Name="NegativeFactor15" />
</StackPanel>
</Grid>
<Grid Margin="0,15,0,0" Row="1">
Expand Down
Loading

0 comments on commit bd9c0d2

Please sign in to comment.