加了一堆东西 推送!!
This commit is contained in:
-94
@@ -1,94 +0,0 @@
|
||||
namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
{
|
||||
partial class Audio_player
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
sp_Button = new PictureBox();
|
||||
last = new PictureBox();
|
||||
next = new PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)sp_Button).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)last).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)next).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// sp_Button
|
||||
//
|
||||
sp_Button.Image = Properties.Resources.pause;
|
||||
sp_Button.Location = new Point(368, 114);
|
||||
sp_Button.Name = "sp_Button";
|
||||
sp_Button.Size = new Size(70, 70);
|
||||
sp_Button.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
sp_Button.TabIndex = 0;
|
||||
sp_Button.TabStop = false;
|
||||
sp_Button.Click += sp_Button_Click;
|
||||
//
|
||||
// last
|
||||
//
|
||||
last.Image = Properties.Resources.last;
|
||||
last.Location = new Point(199, 114);
|
||||
last.Name = "last";
|
||||
last.Size = new Size(70, 70);
|
||||
last.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
last.TabIndex = 1;
|
||||
last.TabStop = false;
|
||||
last.Click += last_Click;
|
||||
//
|
||||
// next
|
||||
//
|
||||
next.Image = Properties.Resources.next;
|
||||
next.Location = new Point(536, 114);
|
||||
next.Name = "next";
|
||||
next.Size = new Size(70, 70);
|
||||
next.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
next.TabIndex = 2;
|
||||
next.TabStop = false;
|
||||
next.Click += next_Click;
|
||||
//
|
||||
// Audio_player
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(11F, 24F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.White;
|
||||
Controls.Add(next);
|
||||
Controls.Add(last);
|
||||
Controls.Add(sp_Button);
|
||||
Name = "Audio_player";
|
||||
Size = new Size(873, 323);
|
||||
((System.ComponentModel.ISupportInitialize)sp_Button).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)last).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)next).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private PictureBox sp_Button;
|
||||
private PictureBox last;
|
||||
private PictureBox next;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
using CDSAE3_Lian_Lian_Kan;
|
||||
using CDSAE3_Lian_Lian_Kan.Properties;
|
||||
using NAudio.Wave;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
|
||||
|
||||
namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
{
|
||||
public partial class Audio_player : UserControl
|
||||
{
|
||||
public Audio_player()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
bool play_state = false;
|
||||
private void sp_Button_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!play_state)
|
||||
play();
|
||||
else
|
||||
pause();
|
||||
play_state = !play_state;
|
||||
}
|
||||
private void play()
|
||||
{
|
||||
Settings.audio_Processer.resume_song();
|
||||
sp_Button.Image = Resources.pause;
|
||||
}
|
||||
private void pause()
|
||||
{
|
||||
Settings.audio_Processer.pause_song();
|
||||
sp_Button.Image = Resources.play_buttton;
|
||||
}
|
||||
|
||||
private void last_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.audio_Processer.last_song();
|
||||
play();
|
||||
}
|
||||
|
||||
private void next_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.audio_Processer.next_song();
|
||||
play();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -24,27 +24,26 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
public GameControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
board.make_board();
|
||||
Settings.game_form = this;
|
||||
playPanel_set();
|
||||
iGameMode = Settings.game_mode_form;
|
||||
|
||||
Etcs.game_form = this;
|
||||
playPanel_set(board.make_board());
|
||||
iGameMode = Etcs.game_mode_form;
|
||||
}
|
||||
void playPanel_set()
|
||||
void playPanel_set(int[,]bd)
|
||||
{
|
||||
int[,] bd = board.Bd;
|
||||
playPanel_size_change();
|
||||
for (int i = 0; i < playPanel.RowCount; i++)
|
||||
for (int j = 0; j < playPanel.ColumnCount; j++)
|
||||
{
|
||||
if (bd[i, j] == -1)
|
||||
{
|
||||
var x = new Single_Block(Settings.trans_Image, (j, i));
|
||||
var x = new Single_Block(Etcs.trans_Image, (j, i));
|
||||
x.Dock = DockStyle.Fill;
|
||||
playPanel.Controls.Add(x, j, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
var x = new Single_Block(bd[i, j], Settings.def_Color, Settings.sel_Color, (j, i));
|
||||
var x = new Single_Block(bd[i, j], Etcs.def_Color, Etcs.sel_Color, (j, i));
|
||||
x.Dock = DockStyle.Fill;
|
||||
playPanel.Controls.Add(x, j, i);
|
||||
}
|
||||
@@ -56,18 +55,18 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
/// <param name="from">起始点</param>
|
||||
/// <param name="to">终点</param>
|
||||
/// <returns></returns>
|
||||
Settings.Direction get_Direction((int, int) from, (int, int) to) //x,y
|
||||
Etcs.Direction get_Direction((int, int) from, (int, int) to) //x,y
|
||||
{
|
||||
if (from.Item1 == to.Item1)
|
||||
if (from.Item2 > to.Item2)
|
||||
return Settings.Direction.up;
|
||||
return Etcs.Direction.up;
|
||||
else
|
||||
return Settings.Direction.down;
|
||||
return Etcs.Direction.down;
|
||||
else
|
||||
if (from.Item1 > to.Item1)
|
||||
return Settings.Direction.left;
|
||||
return Etcs.Direction.left;
|
||||
else
|
||||
return Settings.Direction.right;
|
||||
return Etcs.Direction.right;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置单个点方向
|
||||
@@ -77,7 +76,7 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
/// <param name="blocks"></param>
|
||||
/// <param name="decrease"></param>
|
||||
/// <returns></returns>
|
||||
async Task set_PathAsync((int, int) point, Settings.Direction direction, List<Single_Block> blocks, int wait_time,bool is_hint)
|
||||
async Task set_PathAsync((int, int) point, Etcs.Direction direction, List<Single_Block> blocks, int wait_time,bool is_hint)
|
||||
{
|
||||
|
||||
if (wait_time != 0)
|
||||
@@ -92,31 +91,31 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
blocks.Add(single_Block);
|
||||
}
|
||||
}
|
||||
async Task to_path((int, int) from, (int, int) to, bool include_end, Settings.Direction extra_Direction, List<Single_Block> blocks, int wait_time, bool is_hint)
|
||||
async Task to_path((int, int) from, (int, int) to, bool include_end, Etcs.Direction extra_Direction, List<Single_Block> blocks, int wait_time, bool is_hint)
|
||||
{
|
||||
var direction = get_Direction(from, to);
|
||||
switch (direction)
|
||||
{
|
||||
case Settings.Direction.up:
|
||||
case Etcs.Direction.up:
|
||||
for (int i = from.Item2 - 1; i != to.Item2; i--)
|
||||
await set_PathAsync((from.Item1, i), Settings.Direction.up_down, blocks, wait_time,is_hint);
|
||||
await set_PathAsync((from.Item1, i), Etcs.Direction.up_down, blocks, wait_time,is_hint);
|
||||
break;
|
||||
case Settings.Direction.down:
|
||||
case Etcs.Direction.down:
|
||||
for (int i = from.Item2 + 1; i != to.Item2; i++)
|
||||
await set_PathAsync((from.Item1, i), Settings.Direction.up_down, blocks, wait_time,is_hint);
|
||||
await set_PathAsync((from.Item1, i), Etcs.Direction.up_down, blocks, wait_time,is_hint);
|
||||
break;
|
||||
case Settings.Direction.right:
|
||||
case Etcs.Direction.right:
|
||||
for (int i = from.Item1 + 1; i != to.Item1; i++)
|
||||
await set_PathAsync((i, from.Item2), Settings.Direction.left_right, blocks, wait_time,is_hint);
|
||||
await set_PathAsync((i, from.Item2), Etcs.Direction.left_right, blocks, wait_time,is_hint);
|
||||
break;
|
||||
case Settings.Direction.left:
|
||||
case Etcs.Direction.left:
|
||||
for (int i = from.Item1 - 1; i != to.Item1; i--)
|
||||
await set_PathAsync((i, from.Item2), Settings.Direction.left_right, blocks, wait_time,is_hint);
|
||||
await set_PathAsync((i, from.Item2), Etcs.Direction.left_right, blocks, wait_time,is_hint);
|
||||
break;
|
||||
}
|
||||
if (include_end)
|
||||
{
|
||||
direction = ((int)direction & 3) > 0 ? (Settings.Direction)((int)direction << 2) : (Settings.Direction)((int)direction >> 2);
|
||||
direction = ((int)direction & 3) > 0 ? (Etcs.Direction)((int)direction << 2) : (Etcs.Direction)((int)direction >> 2);
|
||||
direction = direction | extra_Direction;
|
||||
await set_PathAsync(to, direction, blocks, wait_time,is_hint);
|
||||
}
|
||||
@@ -126,18 +125,18 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
switch (path.Count)
|
||||
{
|
||||
case 2:
|
||||
await to_path(path[0], path[1], false, Settings.Direction.none, blocks, wait_time,is_hint);
|
||||
await to_path(path[0], path[1], false, Etcs.Direction.none, blocks, wait_time,is_hint);
|
||||
break;
|
||||
case 3:
|
||||
var extra_direction = get_Direction(path[1], path[2]);
|
||||
await to_path(path[0], path[1], true, extra_direction, blocks, wait_time,is_hint);
|
||||
await to_path(path[1], path[2], false, Settings.Direction.none, blocks, wait_time,is_hint);
|
||||
await to_path(path[1], path[2], false, Etcs.Direction.none, blocks, wait_time,is_hint);
|
||||
break;
|
||||
case 4:
|
||||
Settings.Direction extra_directionA = get_Direction(path[1], path[2]), extra_directionB = get_Direction(path[2], path[3]);
|
||||
Etcs.Direction extra_directionA = get_Direction(path[1], path[2]), extra_directionB = get_Direction(path[2], path[3]);
|
||||
await to_path(path[0], path[1], true, extra_directionA, blocks, wait_time,is_hint);
|
||||
await to_path(path[1], path[2], true, extra_directionB, blocks, wait_time,is_hint);
|
||||
await to_path(path[2], path[3], false, Settings.Direction.none, blocks, wait_time,is_hint);
|
||||
await to_path(path[2], path[3], false, Etcs.Direction.none, blocks, wait_time,is_hint);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -225,6 +224,7 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
return;
|
||||
await path_drawerAsync(path, 20, blocks, false);
|
||||
Control? controlA = playPanel.GetControlFromPosition(path[0].Item1, path[0].Item2), controlB = playPanel.GetControlFromPosition(path.Last().Item1, path.Last().Item2);
|
||||
Etcs.info_Audio_Processer.play_random_break_soundScape();
|
||||
if (controlA != null && controlB != null && controlA is Single_Block single_BlockA && controlB is Single_Block single_BlockB)
|
||||
{
|
||||
single_BlockA.destroyAsync();
|
||||
@@ -250,8 +250,7 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
}
|
||||
public void Exchange_Handler(object? sender, EventArgs e)
|
||||
{
|
||||
board.remake_board();
|
||||
int[,] bd = board.Bd;
|
||||
int[,] bd = board.remake_board();
|
||||
for (int i = 0; i < bd.GetLength(0); i++)
|
||||
for (int j = 0; j < bd.GetLength(1); j++)
|
||||
if (bd[i, j] == -1)
|
||||
|
||||
+15
@@ -39,6 +39,7 @@
|
||||
sp_button = new PictureBox();
|
||||
search = new PictureBox();
|
||||
exchange = new PictureBox();
|
||||
search_time = new Label();
|
||||
game_Panel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)back).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)sp_button).BeginInit();
|
||||
@@ -164,12 +165,25 @@
|
||||
exchange.TabStop = false;
|
||||
exchange.Click += exchange_Click;
|
||||
//
|
||||
// search_time
|
||||
//
|
||||
search_time.AutoSize = true;
|
||||
search_time.BackColor = Color.FromArgb(249, 211, 171);
|
||||
search_time.Font = new Font("Microsoft YaHei UI", 10F);
|
||||
search_time.Location = new Point(413, 18);
|
||||
search_time.Name = "search_time";
|
||||
search_time.Size = new Size(36, 27);
|
||||
search_time.TabIndex = 11;
|
||||
search_time.Text = "00";
|
||||
search_time.Visible = false;
|
||||
//
|
||||
// Leisure_Mode
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(11F, 24F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.FromArgb(249, 211, 171);
|
||||
ClientSize = new Size(1439, 960);
|
||||
Controls.Add(search_time);
|
||||
Controls.Add(exchange);
|
||||
Controls.Add(search);
|
||||
Controls.Add(sp_button);
|
||||
@@ -205,5 +219,6 @@
|
||||
private PictureBox search;
|
||||
private PictureBox exchange;
|
||||
private GameControl gameControl;
|
||||
private Label search_time;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
{
|
||||
public Leisure_Mode()
|
||||
{
|
||||
Settings.game_mode_form = this;
|
||||
Etcs.game_mode_form = this;
|
||||
InitializeComponent();
|
||||
timer = new System.Timers.Timer();
|
||||
timer.Enabled = false;
|
||||
@@ -24,14 +24,14 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
time.Text = (left_time / 60).ToString().PadLeft(2, '0') + ":" + (left_time % 60).ToString().PadLeft(2, '0');
|
||||
}
|
||||
System.Timers.Timer timer;
|
||||
int left_time = Settings.left_time;
|
||||
int left_time = Etcs.left_time;
|
||||
bool is_pause = true;
|
||||
int cur_score = 0;
|
||||
int factor_val = 1;
|
||||
int current_base = 0;
|
||||
int search_left_time = 0;
|
||||
bool search_mode = false;
|
||||
Dictionary<int, double> decrease_per_level = Settings.decrease_per_level;
|
||||
Dictionary<int, double> decrease_per_level = Etcs.decrease_per_level;
|
||||
|
||||
private void Timer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
@@ -42,9 +42,11 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
search_left_time--;
|
||||
if (search_left_time < 0)
|
||||
{
|
||||
BeginInvoke(() => search_time.Visible = false);
|
||||
search_mode = false;
|
||||
gameControl.Search_Handler(this, new SearchEventArgs { set_search = false });
|
||||
}
|
||||
BeginInvoke(() => search_time.Text = search_left_time.ToString().PadLeft(2, '0'));
|
||||
}
|
||||
if (current_base <= 0)
|
||||
{
|
||||
@@ -129,10 +131,10 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
|
||||
private void back_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
Dispose();
|
||||
Close();
|
||||
timer.Close();
|
||||
Settings.form?.change_form(new Leisure_Mode_MenuForm());
|
||||
Etcs.form?.change_form(new Leisure_Mode_MenuForm());
|
||||
}
|
||||
|
||||
private void exchange_Click(object sender, EventArgs e)
|
||||
@@ -144,7 +146,9 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
{
|
||||
gameControl.Search_Handler(this, new SearchEventArgs { set_search = true});
|
||||
search_mode = true;
|
||||
search_left_time = Settings.search_left_time;
|
||||
search_left_time = Etcs.search_left_time;
|
||||
search_time.Text = search_left_time.ToString().PadLeft(2, '0');
|
||||
search_time.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ namespace CDSAE3_Lian_Lian_Kan.Forms
|
||||
public Leisure_Mode_MenuForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
Settings.audio_Processer.next_song();
|
||||
Settings.audio_Processer.resume_song();
|
||||
Etcs.song_Audio_Processer.set_albums("C418");
|
||||
Etcs.song_Audio_Processer.set_song(Etcs.song_Audio_Processer.get_next_song());
|
||||
}
|
||||
|
||||
private void start_Game_Click(object sender, EventArgs e)
|
||||
{
|
||||
Settings.form?.change_form(new Leisure_Mode());
|
||||
Etcs.form?.change_form(new Leisure_Mode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -46,6 +46,7 @@
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(1440, 960);
|
||||
Controls.Add(MainPanel);
|
||||
DoubleBuffered = true;
|
||||
MaximumSize = new Size(1462, 1016);
|
||||
MinimumSize = new Size(1462, 1016);
|
||||
Name = "LianLianKan";
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
InitializeComponent();
|
||||
current_form = this;
|
||||
change_form(new Leisure_Mode_MenuForm());
|
||||
Settings.form = this;
|
||||
Etcs.form = this;
|
||||
}
|
||||
Form current_form;
|
||||
public void change_form(Form form)
|
||||
@@ -21,8 +21,8 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
form.TopLevel = false;
|
||||
form.Dock = DockStyle.Fill;
|
||||
MainPanel.Controls.Add(form);
|
||||
GC.Collect();
|
||||
form.Show();
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
picture.TabIndex = 0;
|
||||
picture.TabStop = false;
|
||||
picture.Click += picture_Click;
|
||||
picture.MouseEnter += picture_MouseEnter;
|
||||
picture.MouseLeave += picture_MouseLeave;
|
||||
//
|
||||
// Single_Block
|
||||
//
|
||||
|
||||
@@ -17,24 +17,24 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
public Single_Block()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Settings.game_form == null)
|
||||
if (Etcs.game_form == null)
|
||||
throw new Exception("game_form is null but try to make a new Single_Block");
|
||||
Selected += Settings.game_form.Selected_Handler;
|
||||
Selected += Etcs.game_form.Selected_Handler;
|
||||
}
|
||||
public Single_Block(int image, Color default_backColor, Color select_Color, (int, int) pos)
|
||||
{
|
||||
block_id = image;
|
||||
position = pos;
|
||||
InitializeComponent();
|
||||
Image_change(Settings.get_block_Image(image));
|
||||
Image_change(Etcs.get_block_Image(image));
|
||||
picture.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
nor_color = default_backColor;
|
||||
sel_color = select_Color;
|
||||
BackColor = default_backColor;
|
||||
picture.BackColor = default_backColor;
|
||||
if (Settings.game_form == null)
|
||||
if (Etcs.game_form == null)
|
||||
throw new Exception("game_form is null but try to make a new Single_Block");
|
||||
Selected += Settings.game_form.Selected_Handler;
|
||||
Selected += Etcs.game_form.Selected_Handler;
|
||||
|
||||
}
|
||||
public Single_Block(Image image, (int, int) pos)
|
||||
@@ -44,13 +44,16 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
picture.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
BackColor = Color.FromArgb(0, 0, 0, 0);
|
||||
can_be_selected = false;
|
||||
if (Settings.game_form == null)
|
||||
if (Etcs.game_form == null)
|
||||
throw new Exception("game_form is null but try to make a new Single_Block");
|
||||
Selected += Settings.game_form.Selected_Handler;
|
||||
Selected += Etcs.game_form.Selected_Handler;
|
||||
|
||||
|
||||
}
|
||||
int block_id;
|
||||
Color nor_color;
|
||||
Color sel_color;
|
||||
Color mouse_upper_color = Etcs.mouse_upper_color;
|
||||
public bool selected { get; set; } = false;
|
||||
bool can_be_selected = true;
|
||||
public (int, int) position { get; set; }//height,width
|
||||
@@ -79,26 +82,26 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
selected = false;
|
||||
BackColor = nor_color;
|
||||
}
|
||||
Settings.Direction direction = Settings.Direction.none;
|
||||
public void hint_path(Settings.Direction direction)
|
||||
Etcs.Direction direction = Etcs.Direction.none;
|
||||
public void hint_path(Etcs.Direction direction)
|
||||
{
|
||||
this.direction |= direction;
|
||||
Image_change(Settings.get_tip_direction_Image(this.direction));
|
||||
Image_change(Etcs.get_tip_direction_Image(this.direction));
|
||||
}
|
||||
public void to_path(Settings.Direction direction)
|
||||
public void to_path(Etcs.Direction direction)
|
||||
{
|
||||
Image_change(Settings.get_direction_Image(direction));
|
||||
direction = Settings.Direction.none;
|
||||
Image_change(Etcs.get_direction_Image(direction));
|
||||
direction = Etcs.Direction.none;
|
||||
}
|
||||
public void de_path()
|
||||
{
|
||||
Image_change(Settings.trans_Image);
|
||||
direction = Settings.Direction.none;
|
||||
Image_change(Etcs.trans_Image);
|
||||
direction = Etcs.Direction.none;
|
||||
}
|
||||
System.Timers.Timer? timer = null;
|
||||
public void destroyAsync()
|
||||
{
|
||||
Image_change(Settings.get_disappear_Images(block_id));
|
||||
Image_change(Etcs.get_disappear_Images(block_id));
|
||||
BackColor = Color.FromArgb(0, 0, 0, 0);
|
||||
can_be_selected = false;
|
||||
timer = new System.Timers.Timer();
|
||||
@@ -110,20 +113,24 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
public void Image_Clear(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
timer?.Stop();
|
||||
Image_change(Settings.trans_Image);
|
||||
Image_change(Etcs.trans_Image);
|
||||
}
|
||||
public void Image_change(Image new_image)
|
||||
{
|
||||
|
||||
}
|
||||
private void Image_set(Image image)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (locker)
|
||||
{
|
||||
picture.Image = new_image;
|
||||
picture.Image = image;
|
||||
}
|
||||
}
|
||||
catch(Exception)
|
||||
catch (Exception)
|
||||
{
|
||||
Image_change(new_image);
|
||||
Image_change(image);
|
||||
}
|
||||
}
|
||||
public void Re_create(int image, Color? default_backColor, Color? select_Color, (int, int)? pos)
|
||||
@@ -131,14 +138,29 @@ namespace CDSAE3_Lian_Lian_Kan
|
||||
if (block_id == image)
|
||||
return;
|
||||
block_id = image;
|
||||
Image_change(Settings.get_block_Image(image));
|
||||
Image_change(Etcs.get_block_Image(image));
|
||||
if (default_backColor != null)
|
||||
nor_color = (Color)default_backColor;
|
||||
if(select_Color != null)
|
||||
if (select_Color != null)
|
||||
sel_color = (Color)select_Color;
|
||||
if (pos != null)
|
||||
position = ((int, int))pos;
|
||||
}
|
||||
|
||||
private void picture_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
if(!can_be_selected || selected)
|
||||
return;
|
||||
BackColor = mouse_upper_color;
|
||||
}
|
||||
|
||||
private void picture_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
if (!can_be_selected || selected)
|
||||
return;
|
||||
BackColor = nor_color;
|
||||
}
|
||||
|
||||
public event SelectedEventHandler Selected;
|
||||
}
|
||||
public class SelectedEventArgs : EventArgs
|
||||
|
||||
Reference in New Issue
Block a user