Skip to content

Commit f8c1368

Browse files
author
DarkCoder15
committed
создал netmp
1 parent ed2b1da commit f8c1368

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5632
-2273
lines changed

Minecraft2D.sln

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.1259
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31019.35
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft2D", "Minecraft2D\Minecraft2D.csproj", "{76C8D3B3-2185-0E07-088D-5183EE91D9D1}"
77
EndProject
@@ -29,7 +29,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetcraftCore", "NetcraftCor
2929
EndProject
3030
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DarkCoderConsoleBox", "..\..\source\repos\DarkCoderConsoleBox\DarkCoderConsoleBox\DarkCoderConsoleBox.vbproj", "{EC617472-1255-4827-B4E6-8EA6F73DF031}"
3131
EndProject
32-
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ExamplePlugin1", "ExamplePlugin1\ExamplePlugin1.vbproj", "{4E9080B7-9216-473F-AAFA-11FB08A92AD7}"
32+
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ExamplePlugin1", "ExamplePlugin1\ExamplePlugin1.vbproj", "{4E9080B7-9216-473F-AAFA-11FB08A92AD7}"
33+
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebConsole", "WebConsole\WebConsole.csproj", "{6F90DD9E-DF3F-4FD6-B756-CE6016A8798E}"
35+
EndProject
36+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetcraftRooms", "NetcraftRooms\NetcraftRooms.csproj", "{185D88F0-A2C7-4253-BFC6-FC30284793E8}"
3337
EndProject
3438
Global
3539
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -93,6 +97,14 @@ Global
9397
{4E9080B7-9216-473F-AAFA-11FB08A92AD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
9498
{4E9080B7-9216-473F-AAFA-11FB08A92AD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
9599
{4E9080B7-9216-473F-AAFA-11FB08A92AD7}.Release|Any CPU.Build.0 = Release|Any CPU
100+
{6F90DD9E-DF3F-4FD6-B756-CE6016A8798E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
101+
{6F90DD9E-DF3F-4FD6-B756-CE6016A8798E}.Debug|Any CPU.Build.0 = Debug|Any CPU
102+
{6F90DD9E-DF3F-4FD6-B756-CE6016A8798E}.Release|Any CPU.ActiveCfg = Release|Any CPU
103+
{6F90DD9E-DF3F-4FD6-B756-CE6016A8798E}.Release|Any CPU.Build.0 = Release|Any CPU
104+
{185D88F0-A2C7-4253-BFC6-FC30284793E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105+
{185D88F0-A2C7-4253-BFC6-FC30284793E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
106+
{185D88F0-A2C7-4253-BFC6-FC30284793E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
107+
{185D88F0-A2C7-4253-BFC6-FC30284793E8}.Release|Any CPU.Build.0 = Release|Any CPU
96108
EndGlobalSection
97109
GlobalSection(SolutionProperties) = preSolution
98110
HideSolutionNode = FALSE

Minecraft2D/ChestWindow.Designer.cs

Lines changed: 22 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Minecraft2D/ChestWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,10 @@ private void ChestWindow_Load(object sender, EventArgs e)
6363
{
6464
listBox1.Items.AddRange(Form1.GetInstance().ListBox1.Items);
6565
}
66+
67+
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
68+
{
69+
70+
}
6671
}
6772
}

Minecraft2D/CommandButton.cs

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Diagnostics;
7+
using System.Globalization;
8+
using System.IO;
9+
using System.Reflection;
10+
using System.Runtime.CompilerServices;
11+
using System.Security;
12+
using Microsoft.VisualBasic;
13+
using System.Windows.Forms;
14+
using System.ComponentModel;
15+
using System.Runtime.InteropServices;
16+
17+
namespace Minecraft2D
18+
{
19+
20+
public class CommandButton : Button
21+
{
22+
private bool _commandLink;
23+
private string _commandLinkNote;
24+
25+
public CommandButton() : base()
26+
{
27+
// Set default property values on the base class to avoid the Obsolete warning
28+
base.FlatStyle = FlatStyle.System;
29+
}
30+
31+
[Category("Appearance")]
32+
[DefaultValue(false)]
33+
[Description("Specifies this button should use the command link style. " + "(Only applies under Windows Vista and later.)")]
34+
public bool CommandLink
35+
{
36+
get
37+
{
38+
return _commandLink;
39+
}
40+
set
41+
{
42+
if (_commandLink != value)
43+
{
44+
_commandLink = value;
45+
this.UpdateCommandLink();
46+
}
47+
}
48+
}
49+
50+
[Category("Appearance")]
51+
[DefaultValue("")]
52+
[Description("Sets the description text for a command link button. " + "(Only applies under Windows Vista and later.)")]
53+
public string CommandLinkNote
54+
{
55+
get
56+
{
57+
return _commandLinkNote;
58+
}
59+
set
60+
{
61+
if (_commandLinkNote != value)
62+
{
63+
_commandLinkNote = value;
64+
this.UpdateCommandLink();
65+
}
66+
}
67+
}
68+
69+
[Browsable(false)]
70+
[EditorBrowsable(EditorBrowsableState.Never)]
71+
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
72+
[Obsolete("This property is not supported on the ButtonEx control.")]
73+
[DefaultValue(typeof(FlatStyle), "System")]
74+
public new FlatStyle FlatStyle
75+
{
76+
// Set the default flat style to "System", and hide this property because
77+
// none of the custom properties will work without it set to "System"
78+
get
79+
{
80+
return base.FlatStyle;
81+
}
82+
set
83+
{
84+
base.FlatStyle = value;
85+
}
86+
}
87+
88+
private const int BS_COMMANDLINK = 0xE;
89+
private const int BCM_SETNOTE = 0x1609;
90+
91+
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = false)]
92+
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
93+
94+
private void UpdateCommandLink()
95+
{
96+
this.RecreateHandle();
97+
SendMessage(this.Handle, BCM_SETNOTE, IntPtr.Zero, _commandLinkNote);
98+
}
99+
100+
protected override CreateParams CreateParams
101+
{
102+
get
103+
{
104+
CreateParams cp = base.CreateParams;
105+
106+
if (this.CommandLink)
107+
cp.Style = cp.Style | BS_COMMANDLINK;
108+
109+
return cp;
110+
}
111+
}
112+
}
113+
114+
}

Minecraft2D/Entity/EntityPlayer.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class EntityPlayer
1616
public Image ItemImageFlipped { get; set; }
1717
public Image Sprite { get; set; } = My.MyProject.Forms.Form1.playerSkin;
1818
public Point Location { get; set; }
19-
public TransparentPicBox R1 { get; set; }
19+
public TransparentPicBox HandItem { get; set; }
2020
public int LastWalk { get; set; } = 0;
2121

2222
private TransparentPicBox _Render;
@@ -51,13 +51,13 @@ public EntityPlayer(string arg0, string arg1, Point arg2, TransparentPicBox arg3
5151
UUID = arg1;
5252
Location = arg2;
5353
Render = arg3;
54-
R1 = new TransparentPicBox()
54+
HandItem = new TransparentPicBox()
5555
{
5656
Name = "Testrender",
5757
BackColor = Color.Transparent,
5858
SizeMode = PictureBoxSizeMode.StretchImage
5959
};
60-
My.MyProject.Forms.Form1.Controls.Add(R1);
60+
My.MyProject.Forms.Form1.Controls.Add(HandItem);
6161
}
6262

6363
private void Test()
@@ -75,52 +75,52 @@ private void Test()
7575
{
7676
if (Information.IsNothing(ItemImageFlipped))
7777
{
78-
R1.Hide();
78+
HandItem.Hide();
7979
return;
8080
}
8181

8282
if (Information.IsNothing(ItemImage))
8383
{
84-
R1.Hide();
84+
HandItem.Hide();
8585
return;
8686
}
8787

88-
R1.Show();
88+
HandItem.Show();
8989
var lc = Render.Location;
9090
if (ItemImage.Equals(null))
9191
return;
9292
if (LastWalk == 1)
9393
{
9494
lc.X += Render.Width - 5;
95-
R1.Image = ItemImage;
95+
HandItem.Image = ItemImage;
9696
}
9797
else
9898
{
99-
lc.X -= R1.Width - 5;
100-
R1.Image = ItemImageFlipped;
99+
lc.X -= HandItem.Width - 5;
100+
HandItem.Image = ItemImageFlipped;
101101
}
102102

103-
lc.Y = (int)(lc.Y + (45d - R1.Height / 2d));
104-
R1.Size = new Size(24, 24);
105-
R1.SizeMode = PictureBoxSizeMode.StretchImage;
106-
R1.BringToFront();
107-
R1.Location = lc;
103+
lc.Y = (int)(lc.Y + (45d - HandItem.Height / 2d));
104+
HandItem.Size = new Size(24, 24);
105+
HandItem.SizeMode = PictureBoxSizeMode.StretchImage;
106+
HandItem.BringToFront();
107+
HandItem.Location = lc;
108108
}
109109
catch (Exception)
110110
{
111-
R1.Hide();
111+
HandItem.Hide();
112112
}
113113
}
114114

115115
public async Task SetItemInHand(Image i, Image iflipped, string str)
116116
{
117117
if (!Information.IsNothing(i))
118-
R1.Image = i;
118+
HandItem.Image = i;
119119
ItemImage = i;
120120
ItemImageFlipped = iflipped;
121121
ItemInHand = str;
122122
Render.Update();
123-
R1.Update();
123+
HandItem.Update();
124124
}
125125

126126
public void Remove()
@@ -131,7 +131,7 @@ public void Remove()
131131
}
132132
else
133133
{
134-
My.MyProject.Forms.Form1.Controls.Remove(R1);
134+
My.MyProject.Forms.Form1.Controls.Remove(HandItem);
135135
}
136136
}
137137
}

Minecraft2D/FancyForm.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)