Exemplo n.º 1
0
 void OnUseEntity(int player, int chunkx, int chunky, int chunkz, int id)
 {
     ServerEntity e = server.GetEntity(chunkx, chunky, chunkz, id);
     if (e.sign == null)
     {
         return;
     }
     if (!server.CheckBuildPrivileges(player, (int)e.position.x, (int)e.position.z, (int)e.position.y))
     {
         return;
     }
     ManicDigger.Dialog d = new ManicDigger.Dialog();
     d.Width = 400;
     d.Height = 200;
     d.IsModal = true;
     d.Widgets = new ManicDigger.Widget[4];
     int widgetCount = 0;
     var font = new DialogFont("Verdana", 11f, DialogFontStyle.Bold);
     d.Widgets[widgetCount++] = Widget.MakeSolid(0, 0, 300, 200, Game.ColorFromArgb(255, 50, 50, 50));
     d.Widgets[widgetCount++] = Widget.MakeTextBox(e.sign.text, font, 50, 50, 200, 50, Game.ColorFromArgb(255, 0, 0, 0));
     Widget okHandler = Widget.MakeSolid(100, 100, 100, 50, Game.ColorFromArgb(255, 100, 100, 100));
     okHandler.ClickKey = (char)13;
     okHandler.Id = "UseSign_OK";
     d.Widgets[widgetCount++] = okHandler;
     d.Widgets[widgetCount++] = Widget.MakeText("OK", font, 100, 100, Game.ColorFromArgb(255, 0, 0, 0));
     ServerEntityId id_ = new ServerEntityId();
     id_.chunkx = chunkx;
     id_.chunky = chunky;
     id_.chunkz = chunkz;
     id_.id = id;
     server.clients[player].editingSign = id_;
     server.SendDialog(player, "UseSign", d);
 }
Exemplo n.º 2
0
    void OnUseEntity(int player, int chunkx, int chunky, int chunkz, int id)
    {
        ServerEntity e = server.GetEntity(chunkx, chunky, chunkz, id);

        if (e.permissionSign == null)
        {
            return;
        }
        if (!server.PlayerHasPrivilege(player, ServerClientMisc.Privilege.area_add))
        {
            server.SendMessage(player, server.colorError + server.language.Get("Server_CommandInsufficientPrivileges"));
            return;
        }
        ManicDigger.Dialog d = new ManicDigger.Dialog();
        d.Width   = 400;
        d.Height  = 400;
        d.IsModal = true;
        d.Widgets = new ManicDigger.Widget[4 + server.serverClient.Groups.Count * 2];
        int widgetCount = 0;
        var font        = new DialogFont("Verdana", 11f, DialogFontStyle.Bold);

        d.Widgets[widgetCount++] = Widget.MakeSolid(0, 0, 400, 400, Game.ColorFromArgb(255, 50, 50, 50));
        d.Widgets[widgetCount++] = Widget.MakeTextBox(e.permissionSign.name, font, 50, 50, 200, 50, Game.ColorFromArgb(255, 0, 0, 0));
        for (int i = 0; i < server.serverClient.Groups.Count; i++)
        {
            Group  g      = server.serverClient.Groups[i];
            Widget button = Widget.MakeSolid(50, 150 + i * 50, 100, 40, Game.ColorFromArgb(255, 100, 100, 100));
            button.ClickKey          = (char)13;
            button.Id                = "PermissionSignGroup" + g.Name;
            d.Widgets[widgetCount++] = button;
            d.Widgets[widgetCount++] = Widget.MakeText(g.Name, font, 50, 150 + i * 50, Game.ColorFromArgb(255, 0, 0, 0));
        }
        Widget okHandler = Widget.MakeSolid(200, 50, 100, 50, Game.ColorFromArgb(255, 100, 100, 100));

        okHandler.ClickKey       = (char)13;
        okHandler.Id             = "UsePermissionSign_OK";
        d.Widgets[widgetCount++] = okHandler;
        d.Widgets[widgetCount++] = Widget.MakeText("Set player", font, 200, 50, Game.ColorFromArgb(255, 0, 0, 0));
        ServerEntityId id_ = new ServerEntityId();

        id_.chunkx = chunkx;
        id_.chunky = chunky;
        id_.chunkz = chunkz;
        id_.id     = id;
        server.clients[player].editingSign = id_;
        server.SendDialog(player, "UseSign", d);
    }
Exemplo n.º 3
0
    void OnUseEntity(int player, int chunkx, int chunky, int chunkz, int id)
    {
        ServerEntity e = server.GetEntity(chunkx, chunky, chunkz, id);

        if (e.sign == null)
        {
            return;
        }
        if (!server.CheckBuildPrivileges(player, (int)e.position.x, (int)e.position.z, (int)e.position.y))
        {
            return;
        }
        ManicDigger.Dialog d = new ManicDigger.Dialog();
        d.Width   = 400;
        d.Height  = 200;
        d.IsModal = true;
        d.Widgets = new ManicDigger.Widget[4];
        int widgetCount = 0;
        var font        = new DialogFont("Verdana", 11f, DialogFontStyle.Bold);

        d.Widgets[widgetCount++] = Widget.MakeSolid(0, 0, 300, 200, Game.ColorFromArgb(255, 50, 50, 50));
        d.Widgets[widgetCount++] = Widget.MakeTextBox(e.sign.text, font, 50, 50, 200, 50, Game.ColorFromArgb(255, 0, 0, 0));
        Widget okHandler = Widget.MakeSolid(100, 100, 100, 50, Game.ColorFromArgb(255, 100, 100, 100));

        okHandler.ClickKey       = (char)13;
        okHandler.Id             = "UseSign_OK";
        d.Widgets[widgetCount++] = okHandler;
        d.Widgets[widgetCount++] = Widget.MakeText("OK", font, 100, 100, Game.ColorFromArgb(255, 0, 0, 0));
        ServerEntityId id_ = new ServerEntityId();

        id_.chunkx = chunkx;
        id_.chunky = chunky;
        id_.chunkz = chunkz;
        id_.id     = id;
        server.clients[player].editingSign = id_;
        server.SendDialog(player, "UseSign", d);
    }
Exemplo n.º 4
0
 public void SendDialog(int player, string id, Dialog dialog)
 {
     server.SendDialog(player, id, dialog);
 }
Exemplo n.º 5
0
 public void SendDialog(int player, string id, Dialog dialog)
 {
     server.SendDialog(player, id, dialog);
 }
Exemplo n.º 6
0
 void OnUseEntity(int player, int chunkx, int chunky, int chunkz, int id)
 {
     ServerEntity e = server.GetEntity(chunkx, chunky, chunkz, id);
     if (e.permissionSign == null)
     {
         return;
     }
     if (!server.PlayerHasPrivilege(player, ServerClientMisc.Privilege.area_add))
     {
         server.SendMessage(player, server.colorError + server.language.Get("Server_CommandInsufficientPrivileges"));
         return;
     }
     ManicDigger.Dialog d = new ManicDigger.Dialog();
     d.Width = 400;
     d.Height = 400;
     d.IsModal = true;
     d.Widgets = new ManicDigger.Widget[4 + server.serverClient.Groups.Count * 2];
     int widgetCount = 0;
     var font = new DialogFont("Verdana", 11f, DialogFontStyle.Bold);
     d.Widgets[widgetCount++] = Widget.MakeSolid(0, 0, 400, 400, Game.ColorFromArgb(255, 50, 50, 50));
     d.Widgets[widgetCount++] = Widget.MakeTextBox(e.permissionSign.name, font, 50, 50, 200, 50, Game.ColorFromArgb(255, 0, 0, 0));
     for (int i = 0; i < server.serverClient.Groups.Count; i++)
     {
         Group g = server.serverClient.Groups[i];
         Widget button = Widget.MakeSolid(50, 150 + i * 50, 100, 40, Game.ColorFromArgb(255, 100, 100, 100));
         button.ClickKey = (char)13;
         button.Id = "PermissionSignGroup" + g.Name;
         d.Widgets[widgetCount++] = button;
         d.Widgets[widgetCount++] = Widget.MakeText(g.Name, font, 50, 150 + i * 50, Game.ColorFromArgb(255, 0, 0, 0));
     }
     Widget okHandler = Widget.MakeSolid(200, 50, 100, 50, Game.ColorFromArgb(255, 100, 100, 100));
     okHandler.ClickKey = (char)13;
     okHandler.Id = "UsePermissionSign_OK";
     d.Widgets[widgetCount++] = okHandler;
     d.Widgets[widgetCount++] = Widget.MakeText("Set player", font, 200, 50, Game.ColorFromArgb(255, 0, 0, 0));
     ServerEntityId id_ = new ServerEntityId();
     id_.chunkx = chunkx;
     id_.chunky = chunky;
     id_.chunkz = chunkz;
     id_.id = id;
     server.clients[player].editingSign = id_;
     server.SendDialog(player, "UseSign", d);
 }