EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Client popup window (like in the tutorial zone) (https://www.eqemulator.org/forums/showthread.php?t=26312)

Angelox 10-23-2008 08:27 PM

The pop-up that is used for Bot tracking was made by Derision, since it was impossible to pull up the Ranger-Bot window (blocked by client). Currently, it just displays the mobs in the zone; haven't figured out how to track what you see yet, but I have thought of a few things - one is manipulating the 'Find NPC' window (if it's not client blocked too).
Anyways, I find just seeing whats in the zone usefull, thought it might help a GM.

Anybody figured out how to downsize a ship? if you do, we can make a running, ridable ship from BB > OTT > FP and back for PEQ. I can't now because the only one I can use is too big for OOT piers and won't even fit near the FP piers.

Angelox 10-23-2008 08:28 PM

Dang! THREE first page posts in a row! who will top that?

AndMetal 10-27-2008 03:07 PM

Quote:

Originally Posted by Angelox (Post 158952)
Currently, it just displays the mobs in the zone
...
Anyways, I find just seeing whats in the zone usefull, thought it might help a GM.

I agree, using #listnpcs is somewhat painful, and a window would be much nicer.

If we put this somewhere else (outside of the #ifdef EQBOTS section in zone/botAI.cpp), we can very easily call it from zone/command.cpp:

Code:

void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {

        const char *WindowTitle = "Bot Tracking Window";

        string WindowText;
        int LastCon = -1;
        int CurrentCon = 0;
       
        int32 array_counter = 0;
       
        LinkedListIterator<Mob*> iterator(mob_list);
        iterator.Reset();

        while(iterator.MoreElements())
        {
                if (iterator.GetData() && (iterator.GetData()->DistNoZ(*client)<=Distance))
                {
                        if(iterator.GetData()->IsTrackable()) {
                                Mob* cur_entity = iterator.GetData();

                                if(NamedOnly) {
                                        if(!strncasecmp(cur_entity->GetName(), "a_", 2) ||
                                          !strncasecmp(cur_entity->GetName(), "an_", 3)) {

                                                iterator.Advance();
                                                  continue;
                                        }
                                }


                                CurrentCon = client->GetLevelCon(cur_entity->GetLevel());

                                if(CurrentCon != LastCon) {

                                        if(LastCon != -1)
                                                WindowText += "</c>";

                                        LastCon = CurrentCon;

                                        switch(CurrentCon) {

                                                case CON_GREEN: {
                                                        WindowText += "<c \"#00FF00\">";
                                                        break;
                                                }

                                                case CON_LIGHTBLUE: {
                                                        WindowText += "<c \"#8080FF\">";
                                                        break;
                                                }
                                                case CON_BLUE: {
                                                        WindowText += "<c \"#2020FF\">";
                                                        break;
                                                }

                                                case CON_YELLOW: {
                                                        WindowText += "<c \"#FFFF00\">";
                                                        break;
                                                }
                                                case CON_RED: {
                                                        WindowText += "<c \"#FF0000\">";
                                                        break;
                                                }
                                                default: {
                                                        WindowText += "<c \"#FFFFFF\">";
                                                        break;
                                                }
                                        }
                                }

                                WindowText += cur_entity->GetCleanName();
                                WindowText += "<br>";

                                if(strlen(WindowText.c_str()) > 4000) {
                                        // Popup window is limited to 4096 characters.
                                        WindowText += "</c><br><br>List truncated ... too many mobs to display";
                                        break;
                                }
                        }
                }

                iterator.Advance();
        }
        WindowText += "</c>";

        client->SendPopupToClient(WindowTitle, WindowText.c_str());

        return;
}

However, I think it might be better to make it a new function so that we can utilize a search string if we want to filter results.

Congdar 10-27-2008 03:37 PM

I havn't tried this new bot tracking yet, but a player on my server said that it just lists npc, doesn't give tracking direction. is this the case?


All times are GMT -4. The time now is 02:37 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.