Commit 319885f7 authored by 花桃白音's avatar 花桃白音

test

parent f30b86c7
No preview for this file type
namespace cardvisa
using System.Windows.Forms;
namespace cardvisa
{
partial class Form1
{
......@@ -74,13 +76,17 @@
//
// listBox1
//
this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.listBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
this.listBox1.Font = new System.Drawing.Font("宋体", 12F);
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(12, 12);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(237, 468);
this.listBox1.Size = new System.Drawing.Size(237, 458);
this.listBox1.TabIndex = 3;
this.listBox1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.listBox1_DrawItem);
this.listBox1.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.listBox1_MeasureItem);
this.listBox1.SelectedValueChanged += new System.EventHandler(this.listBox1_SelectedValueChanged);
this.listBox1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseDoubleClick);
this.listBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseDown);
......
......@@ -50,6 +50,12 @@ namespace cardvisa
public SettingData settings;
public CDBTableHelper cdbh = new CDBTableHelper();
public PicViewer picViewer = new PicViewer();
public MyListBox myListBox = new MyListBox();
Brush myBrush = Brushes.Black;
SolidBrush mySBrush = new SolidBrush(Color.White);
Rectangle myRect = new Rectangle(0,0,0,0);
int lockobj = 0;
List<string> filelist = new List<string> { "0禁止.jpg", "1限制.jpg", "2准限.jpg", "3通过.png", "4回退.jpg" };
public List<string> zipcdblist { get; set; } = new List<string>();
public int cardindex = 0;
public int cardcounts { get; set; } = 0;
......@@ -173,6 +179,12 @@ namespace cardvisa
if (picViewer.IsDisposed) { picViewer = new PicViewer(); }
picViewer.Show();
picViewer.Location = new Point(Location.X + Size.Width, Location.Y);
/*
if (myListBox.IsDisposed) { myListBox = new MyListBox(); }
myListBox.Show();
myListBox.Location = new Point(Location.X - myListBox.Size.Width , Location.Y);
*/
}
}
private void button4_Click(object sender, EventArgs e)
......@@ -247,9 +259,58 @@ namespace cardvisa
}
else
{
//richTextBox1.Text = CommonHandler.GetMD5(Application.StartupPath + "\\checkin\\c4270019.lua");
PicViewer pv = new PicViewer();
pv.Show();
List<string> cardlist = new List<string>();
Dictionary<long,string> cardict = new Dictionary<long, string>();
string path = Application.StartupPath + "\\checkout\\lflist.conf";
if (!File.Exists(path))
{
using (StreamWriter sw = new StreamWriter(path, false, (new UTF8Encoding(false)))) { sw.Write(""); }
}
else
{
string[] strsets = File.ReadAllLines(path);
string reg = "(?<id>\\d{1,10})\\s(?<lf>\\d).*(?<=[-]{2})(?<name>.*)";
List<long> templist = new List<long>();
foreach (var str in strsets)
{
Match mt = Regex.Match(str, reg);
if (mt.Success)
{
long cid = long.Parse(mt.Groups["id"].Value);
if (!templist.Contains(cid)) {
templist.Add(cid);
}
if (cardict.ContainsKey(cid)) {
cardict[cid] = str;
}
else
{
cardict.Add(cid, str);
}
}
else
{
templist.Sort();
for (int i = 0; i < templist.Count; i++)
{
long code = templist[i];
cardlist.Add(cardict[code]);
}
cardlist.Add(str);
templist.Clear();
}
}
}
//output
string content = "";
for (int i = 0; i < cardlist.Count; i++)
{
content += cardlist[i].ToString() + "\n";
}
using (StreamWriter sw = new StreamWriter(Application.StartupPath + "\\checkout\\" + "\\lflist.txt", false, (new UTF8Encoding(false))))
{
sw.Write(content.Replace("\r\n", "\n"));
}
}
}
private void button6_Click(object sender, EventArgs e)
......@@ -888,8 +949,8 @@ namespace cardvisa
break;
}
}
public long GetCardFromListID() {
var id = listBox1.SelectedIndex;
public long GetCardFromListID(int index = -1) {
var id = index > 0 ? index : listBox1.SelectedIndex;
if(id>0 &&id <= 20)
{
int cid = cardindex * 20 + id - 1;
......@@ -899,10 +960,58 @@ namespace cardvisa
}
return 0;
}
private void listBox1_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = 20;
}
//该代码会不断重复循环DrawItem
private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index < 0) return;
if (lockobj == 1) return;
if (button7.Text == "开灯")
{
myBrush = Brushes.White;
mySBrush.Color = Color.Black;
}
myRect.X = e.Bounds.X;
myRect.Y = e.Bounds.Y;
myRect.Width = e.Bounds.Width;
myRect.Height = e.Bounds.Height;
e.Graphics.FillRectangle(mySBrush,myRect);//罪魁祸首
/*
if (cdbh.cmds.Count > 0)
{
var id = e.Index > 0 ? (e.Index < 20 ? e.Index : 19) : 2;
sqldata sqd = cdbh.cmds[GetCardFromListID(id)];
switch (sqd.LFState)
{
case LFStates.死刑:
myBrush = Brushes.Red;
break;
case LFStates.Limited:
myBrush = Brushes.Orange;
break;
case LFStates.SubLimited:
myBrush = Brushes.Blue;
break;
default:
myBrush = button7.Text == "关灯" ? Brushes.Black : Brushes.White;
break;
}
}*/
if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
{
e.Graphics.FillRectangle(new SolidBrush(Color.LightBlue),myRect);//罪魁祸首
}
e.Graphics.DrawString(listBox1.Items[e.Index].ToString(), listBox1.Font, myBrush,myRect, StringFormat.GenericDefault);
e.DrawFocusRectangle();
}
private void listBox1_SelectedValueChanged(object sender, EventArgs e)
{
if (button3.Text == "关闭库")
{
var id = listBox1.SelectedIndex;
if (id > 0 && id <= 20)
{
......@@ -915,12 +1024,13 @@ namespace cardvisa
richTextBox1.Text = "";
try
{
List<string> list = new List<string> {"0禁止.jpg","1限制.jpg","2准限.jpg","3通过.png","4回退.jpg"};
string imgpath = Application.StartupPath + "\\res\\" + list[(int)sqd.LFState];
string imgpath = Application.StartupPath + "\\res\\" + filelist[(int)sqd.LFState];
if (File.Exists(imgpath))
{
Image img = Image.FromFile(imgpath);
pictureBox1.Image = img;
using (Image img = Image.FromFile(imgpath))
{
pictureBox1.Image = new Bitmap(img);
}
button6.Text = "×";
pictureBox1.Visible = true;
}
......@@ -1070,7 +1180,6 @@ namespace cardvisa
}
}
}
private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (button3.Text == "关闭库")
......@@ -1094,6 +1203,7 @@ namespace cardvisa
private void Form1_Move(object sender, EventArgs e)
{
picViewer.Location = new Point(Location.X + Size.Width, Location.Y);
myListBox.Location = new Point(Location.X - myListBox.Width, Location.Y);
}
......@@ -1418,6 +1528,7 @@ namespace cardvisa
public class sqldata
{
public long code;
public string name;
public DateTime time;
public texts cmdt { get; set; }
public datas cmdd { get; set; }
......@@ -1426,6 +1537,12 @@ namespace cardvisa
{
code = c; time = dt; cmdt = cdt; cmdd = packDIY ? cdd : CheckDatas(cdd, true); LFState = LFStates.UnLimited;
}
public sqldata(long code, LFStates lFState , string name)
{
this.code = code;
LFState = lFState;
this.name = name;
}
public datas CheckDatas(datas cdd, bool packDIY)
{
if (packDIY) { cdd.ot = 4; }
......
namespace cardvisa
{
partial class MyListBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// MyListBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 511);
this.Name = "MyListBox";
this.Text = "ListBox";
this.Load += new System.EventHandler(this.MyListBox_Load);
this.ResumeLayout(false);
}
#endregion
}
}
\ No newline at end of file
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;
namespace cardvisa
{
public partial class MyListBox : Form
{
public MyListBox()
{
InitializeComponent();
}
private void MyListBox_Load(object sender, EventArgs e)
{
MyCheckTable cb = new MyCheckTable();
cb.Location = new Point(5, 30);
cb.Visible = true;
Controls.Add(cb);
}
}
public class MyCheckTable:Panel
{
public List<MyCheckBoxRow> myCheckBoxRows{ get; set; } = new List<MyCheckBoxRow>();
public List<Label> myLabels { get; set; } = new List<Label>();
public MyCheckTable(){
Width = 400;
Height = 550;
for(int i = 0; i < 20; i++)
{
MyCheckBoxRow mbr = new MyCheckBoxRow();
mbr.Location = new Point(5, i * 20);
mbr.Visible = true;
mbr.Height = 20;
myCheckBoxRows.Add(mbr);
}
FillAllData();
}
public void FillAllData()
{
myCheckBoxRows.ForEach(x => Controls.Add(x));
}
}
public class MyCheckBoxRow:Panel {
public MyCheckBoxCell myCheckBoxCell { get; set; } =new MyCheckBoxCell();
public MyCheckBoxRow()
{
Width = 400;
Label lb = new Label();
lb.Text = "厨王标记:";
lb.Size = new Size(65, 20);
lb.Location = new Point(5 , 5);
lb.Visible = true;
Controls.Add(lb);
for (int i = 0;i < 7;i++)
{
CheckBox cbc = new CheckBox();
cbc.Size = new Size(20, 20);
cbc.Location = new Point(70 + i * 25,2);
cbc.Visible = true;
Controls.Add(cbc);
}
}
}
public class MyCheckBoxCell:CheckBox {
//打点
//抗性
//解场
//无效
//封锁
//特招
//检索
//回收
//二速
}
}
<?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>
\ No newline at end of file
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
......@@ -19,8 +20,14 @@ namespace cardvisa
public void FillPic(string path)
{
if(File.Exists(path)) {
pictureBox1.Image = Image.FromFile(path);
}
else
{
pictureBox1.Image = null;
}
}
public void SetImage(Bitmap bmp)
{
pictureBox1.Image = bmp;
......
This diff is collapsed.
This diff is collapsed.
{"ygopath":"E:\\MyCardLibrary\\ygopro\\ygopro222.exe","pathcheck":false,"packDIY":true,"regs":null}
\ No newline at end of file
{"ygopath":"E:\\MyCardLibrary\\ygopro\\ygopro.exe","pathcheck":false,"packDIY":true,"regs":null}
\ No newline at end of file
......@@ -128,6 +128,12 @@
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="MyListBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MyListBox.Designer.cs">
<DependentUpon>MyListBox.cs</DependentUpon>
</Compile>
<Compile Include="LuaTask.cs" />
<Compile Include="PicViewer.cs">
<SubType>Form</SubType>
......@@ -146,6 +152,9 @@
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MyListBox.resx">
<DependentUpon>MyListBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PicViewer.resx">
<DependentUpon>PicViewer.cs</DependentUpon>
</EmbeddedResource>
......
11d8a6c81bf023b013372db283fc0eabd2d9dd57
6eed85acb0b2cbb3d5797a801f4b74efa08f41cf
......@@ -54,3 +54,4 @@ C:\Users\Administrator\source\repos\cardvisa\cardvisa\bin\Debug\cardvisa.pdb
E:\project\visa\cardvisa\cardvisa\obj\Debug\cardvisa.PicViewer.resources
C:\Users\Administrator\source\repos\cardvisa\cardvisa\obj\Debug\cardvisa.PicViewer.resources
E:\project\visa\cardvisa\cardvisa\obj\Debug\cardvisa.PuzzleGame.resources
E:\project\visa\cardvisa\cardvisa\obj\Debug\cardvisa.MyListBox.resources
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment