[Committed] sendBlinkPanel

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

[Committed] sendBlinkPanel

Postby Are » Tue Apr 06, 2010 9:01 pm

Hey,

as shown here, this is the patch file to make UI blinking possible. The enum is a copy of the Packet Converter Source, someone did the work for us before ;).

And this is a small script to test the blinking ingame:

Code: Select all
/*
 * DAWN OF LIGHT - The first free open source DAoC server emulator
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
using System;
using DOL.GS.PacketHandler;

namespace DOL.GS.Commands
{
   [CmdAttribute(
      "&blink",
      ePrivLevel.GM,
      "make me blink",
      "/blink")]
   public class BlinkCommandHandler : ICommandHandler
   {
      public void OnCommand(GameClient client, string[] args)
      {
            GamePlayer player = client.Player;

            if (args.Length > 1)
            {
                byte value;
                if (byte.TryParse(args[1].ToLower(), out value))
                {
                    if (Enum.IsDefined(typeof(ePanel), value))
                    {
                        client.Out.SendMessage("Start blinking UI part: " + Enum.GetName(typeof(ePanel), value), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        player.Out.SendBlinkPanel(player, value);
                    }
                }
            }
            else
            {
                Usage(client);
            }
      }

        private void Usage(GameClient client)
        {
            String visualEffectList = "";

            visualEffectList += "You must specify a value!\nID: Name\n";

            int count = 0;

            foreach (string panelID in Enum.GetNames(typeof(ePanel)))
            {
                visualEffectList += count + ": " + panelID + "\n";
                count++;
            }
            client.Out.SendMessage(visualEffectList, eChatType.CT_System, eChatLoc.CL_SystemWindow);
        }
   }
}
Attachments
uiblink.patch
sendBlinkPanel Method and enum from PacketConverter Source
(2.99 KiB) Downloaded 10 times
User avatar
Are
DOL Acolyte
 
Posts: 106
Joined: Mon Mar 26, 2007 7:43 pm
Location: Germany

Re: sendBlinkPanel

Postby Graveen » Tue Apr 06, 2010 9:09 pm

Accepted, soon in SVN. Thank you !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: [Committed] sendBlinkPanel

Postby Are » Tue Apr 20, 2010 5:29 pm

Update on this:

- Moved sendBlinkPanel from PacketLib168 to PacketLib193 (Tutorial zone was invented)
- sendBlinkPanel only needs a value, not a gameplayer
Code: Select all
SendBlinkPanel(GamePlayer player, byte flag)

to
Code: Select all
SendBlinkPanel(byte flag)

- updated /blink command to make yourself or your target blink
- added comments and method description

Are
Attachments
blinkupdate.patch
Updated /blink command an method
(5.88 KiB) Downloaded 9 times
User avatar
Are
DOL Acolyte
 
Posts: 106
Joined: Mon Mar 26, 2007 7:43 pm
Location: Germany

Re: [Committed] sendBlinkPanel

Postby Tolakram » Tue Apr 20, 2010 7:08 pm

Excellent Are.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: [Committed] sendBlinkPanel

Postby Are » Wed Apr 21, 2010 6:12 am

Thx :)
User avatar
Are
DOL Acolyte
 
Posts: 106
Joined: Mon Mar 26, 2007 7:43 pm
Location: Germany

Re: [Committed] sendBlinkPanel

Postby Graveen » Wed Apr 21, 2010 7:49 am

nice, thank you !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: [Committed] sendBlinkPanel

Postby Graveen » Thu Apr 22, 2010 8:43 pm

Committed you last changes, thank you !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest