mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-13 01:06:46 -04:00
Start work on redesigned players tab.
This commit is contained in:
parent
e281cac43c
commit
f705e7fce7
@ -21,34 +21,53 @@ using System.ComponentModel;
|
|||||||
namespace MCGalaxy.Gui {
|
namespace MCGalaxy.Gui {
|
||||||
public sealed class PlayerProperties {
|
public sealed class PlayerProperties {
|
||||||
readonly Player player;
|
readonly Player player;
|
||||||
|
string inMsg, outMsg;
|
||||||
|
|
||||||
public PlayerProperties(Player player) {
|
public PlayerProperties(Player player) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
|
inMsg = PlayerDB.GetLoginMessage(player);
|
||||||
|
outMsg = PlayerDB.GetLogoutMessage(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Description("Whether the player is frozen or not.")]
|
[Category("Properties")]
|
||||||
|
[DisplayName("Login message")]
|
||||||
|
public string LoginMsg { get { return inMsg; } set { inMsg = DoCmd("loginmessage", value); } }
|
||||||
|
|
||||||
|
[Category("Properties")]
|
||||||
|
[DisplayName("Logout message")]
|
||||||
|
public string LogoutMsg { get { return outMsg; } set { outMsg = DoCmd("logoutmessage", value); } }
|
||||||
|
|
||||||
|
|
||||||
[Category("Status")]
|
[Category("Status")]
|
||||||
[DisplayName("Frozen")]
|
[DisplayName("Frozen")]
|
||||||
public bool Frozen { get { return player.frozen; } set { DoCommand("freeze"); } }
|
public bool Frozen { get { return player.frozen; } set { DoCmd("freeze"); } }
|
||||||
|
|
||||||
[Description("Whether the player is hidden or not.")]
|
|
||||||
[Category("Status")]
|
[Category("Status")]
|
||||||
[DisplayName("Hidden")]
|
[DisplayName("Hidden")]
|
||||||
public bool Hidden { get { return player.hidden; } set { DoCommand("ohide"); } }
|
public bool Hidden { get { return player.hidden; } set { DoCmd("ohide"); } }
|
||||||
|
|
||||||
[Description("Whether the player is muted or not.")]
|
|
||||||
[Category("Status")]
|
[Category("Status")]
|
||||||
[DisplayName("Muted")]
|
[DisplayName("Muted")]
|
||||||
public bool Muted { get { return player.hidden; } set { DoCommand("mute"); } }
|
public bool Muted { get { return player.muted; } set { DoCmd("mute"); } }
|
||||||
|
|
||||||
void DoCommand(string cmd) {
|
[Category("Status")]
|
||||||
|
[DisplayName("Voiced")]
|
||||||
|
public bool Voiced { get { return player.voice; } set { DoCmd("voice"); } }
|
||||||
|
|
||||||
|
void DoCmd(string cmd) { DoCmd(cmd, ""); }
|
||||||
|
|
||||||
|
string DoCmd(string cmd, string args) {
|
||||||
|
// Is the player still on the server?
|
||||||
Player p = PlayerInfo.FindExact(player.name);
|
Player p = PlayerInfo.FindExact(player.name);
|
||||||
if (p == null) return;
|
if (p == null) return args;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Command.all.Find(cmd).Use(null, p.name);
|
string cmdArgs = args == "" ? p.name : p.name + " " + args;
|
||||||
|
Command.all.Find(cmd).Use(null, cmdArgs);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Server.ErrorLog(ex);
|
Server.ErrorLog(ex);
|
||||||
}
|
}
|
||||||
|
return args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
831
GUI/Window.Designer.cs
generated
831
GUI/Window.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -477,12 +477,14 @@ namespace MCGalaxy.Gui {
|
|||||||
void demoteToolStripMenuItem_Click(object sender, EventArgs e) {
|
void demoteToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||||
PlayerCmd("rank", "-down ", "");
|
PlayerCmd("rank", "-down ", "");
|
||||||
}
|
}
|
||||||
|
PlayerProperties playerProps;
|
||||||
|
|
||||||
#region Tabs
|
#region Tabs
|
||||||
#region playersTab
|
#region playersTab
|
||||||
void LoadPLayerTabDetails(object sender, EventArgs e) {
|
void LoadPLayerTabDetails(object sender, EventArgs e) {
|
||||||
Player p = PlayerInfo.Find(PlyersListBox.Text);
|
Player p = PlayerInfo.Find(PlyersListBox.Text);
|
||||||
if (p == null) return;
|
if (p == null) return;
|
||||||
|
|
||||||
PlayersTextBox.AppendTextAndScroll("==" + p.name + "==");
|
PlayersTextBox.AppendTextAndScroll("==" + p.name + "==");
|
||||||
//Top Stuff
|
//Top Stuff
|
||||||
curPlayer = p;
|
curPlayer = p;
|
||||||
@ -511,6 +513,9 @@ namespace MCGalaxy.Gui {
|
|||||||
pl_txtTitle.Text = p.title;
|
pl_txtTitle.Text = p.title;
|
||||||
pl_cmbColor.SelectedText = Colors.Name(p.color).Capitalize();
|
pl_cmbColor.SelectedText = Colors.Name(p.color).Capitalize();
|
||||||
|
|
||||||
|
playerProps = new PlayerProperties(p);
|
||||||
|
pgPlayers.SelectedObject = playerProps;
|
||||||
|
|
||||||
//Map
|
//Map
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
|
@ -118,16 +118,19 @@
|
|||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<metadata name="mapsStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="mapsStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>456, 17</value>
|
<value>318, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="playerStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="playerStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>346, 17</value>
|
<value>213, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="iconContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="iconContext.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>229, 17</value>
|
<value>102, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="txtLogMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="txtLogMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>562, 17</value>
|
<value>420, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>65</value>
|
<value>65</value>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user