Ejemplo n.º 1
0
// shutdown sequence
void ISXEQMap::Shutdown()
{
	Update = false;

	RemoveDetour(CMapViewWnd__CMapViewWnd);

	MapClear();
	CMyMapViewWnd::RestoreVFTable();
	RemoveMQ2Benchmark(bmMapRefresh);

	pISInterface->RemoveCommand("MapHide");
	pISInterface->RemoveCommand("MapShow");
	pISInterface->RemoveCommand("MapFilter");
	pISInterface->RemoveCommand("Highlight");
	pISInterface->RemoveCommand("MapNames");
	pISInterface->RemoveCommand("MapClick");

	pISInterface->UnloadSettings("ISXEQMap.xml");

	DisconnectServices();

	UnRegisterServices();
	UnRegisterTopLevelObjects();
	UnRegisterDataTypes();
	UnRegisterAliases();
	UnRegisterCommands();
}
Ejemplo n.º 2
0
VOID MapActiveLayerCmd(PSPAWNINFO pChar, PCHAR szLine)
{
	CHAR szBuffer[MAX_STRING] = { 0 };
	bRunNextCommand = TRUE;
	int newActiveLayer = atoi(szLine);
	if (szLine == 0 || szLine[0] == 0 || newActiveLayer < 0 || newActiveLayer > 3)
	{
		SyntaxError("Usage: /mapactivelayer [0|1|2|3]");
		return;
	};

	activeLayer = newActiveLayer;
	
	sprintf_s(szBuffer, "Map Active Layer: %d", activeLayer);
	WriteChatColor(szBuffer);

	// Write setting to file
	char szTest[5];
	sprintf_s(szTest, "%d", activeLayer);
	WritePrivateProfileString("Map Filters", "ActiveLayer", szTest, INIFileName);

	// refresh map
	MapClear();
	MapGenerate();
}
Ejemplo n.º 3
0
void __cdecl EQGamestateService(bool Broadcast, unsigned int MSG, void *lpData)
{
#define GameState ((unsigned int)lpData)
	if (MSG == GAMESTATESERVICE_CHANGED)
	{
		if (GameState == 3)
		{
			MapClear();
		}
	}
#undef GameState
}
Ejemplo n.º 4
0
int CMD_MapShow(int argc, char *argv[])
{
    if (argc<2)
    {
        WriteChatf("Syntax: %s <spawnfilter>|reset",argv[0]);
        return 0;
    };
    if (!stricmp(argv[1],"reset"))
    {
        MapClear();
        MapGenerate();
        WriteChatf("Map spawns regenerated");
        return 0;
    }
    if (PCHARINFO pCharInfo=GetCharInfo())
    {
        SEARCHSPAWN ssShow;
        ClearSearchSpawn(&ssShow);
        ParseSearchSpawn(1,argc,argv,ssShow);
        WriteChatf("%d previously hidden spawns shown",MapShow(ssShow));
    }
    return 0;
}
Ejemplo n.º 5
0
int CMD_MapHide(int argc, char *argv[])
{
    if (argc<2)
    {
        WriteChatf("Syntax: %s <spawnfilter>|reset",argv[0]);
        return 0;
    };
    if (!stricmp(argv[1],"reset"))
    {
        MapClear();
        MapGenerate();
        WriteChatColor("Map spawns regenerated",USERCOLOR_DEFAULT);
        return 0;
    }
    if (PCHARINFO pCharInfo=GetCharInfo())
    {
        SEARCHSPAWN ssHide;
        ClearSearchSpawn(&ssHide);
        ParseSearchSpawn(1,argc,argv,ssHide);
        WriteChatf("%d mapped spawns hidden",MapHide(ssHide));
    }
    return 0;
}
Ejemplo n.º 6
0
void ListClear(ListNode *ListStart, LIST_ITEM_DESTROY_FUNC ItemDestroyer)
{
    ListNode *Curr,*Next;

    if (! ListStart) return;
    if (ListStart->Flags & LIST_FLAG_MAP_HEAD) MapClear(ListStart, ItemDestroyer);

    Curr=ListStart->Next;
    while (Curr)
    {
        Next=Curr->Next;
        if (ItemDestroyer && Curr->Item) ItemDestroyer(Curr->Item);
        DestroyString(Curr->Tag);
        if (Curr->Stats) free(Curr->Stats);
        free(Curr);
        Curr=Next;
    }

    ListStart->Next=NULL;
    ListStart->Head=ListStart;
    ListStart->Prev=ListStart;
    ListSetNoOfItems(ListStart,0);
}
Ejemplo n.º 7
0
void SetClear(Set *set)
{
    MapClear(set);
}
Ejemplo n.º 8
0
int CMD_MapFilter(int argc, char *argv[])
{
    // Display settings
    if (argc<2) 
    {
        WriteChatColor("Map filtering settings:",USERCOLOR_DEFAULT);
        WriteChatColor("-----------------------",USERCOLOR_DEFAULT);
        for (DWORD i=0;MapFilterOptions[i].szName!=NULL;i++) 
            if (RequirementsMet(i))
                MapFilterSetting(i,argc,argc,argv);

        return 0;
    } 

    if (!stricmp(argv[1],"help")) 
    {
        // Display Help
        WriteChatColor("Map filtering options:",USERCOLOR_DEFAULT);
        for (DWORD i=0;MapFilterOptions[i].szName!=NULL;i++) 
        {
            WriteChatf("%s%s: %s",MapFilterOptions[i].szName,(MapFilterOptions[i].bIsToggle)?"":" #",MapFilterOptions[i].szHelpString);
        }
        WriteChatColor("'option' color [r g b]: Set display color for 'option' (Omit to reset to default)",USERCOLOR_DEFAULT);
        return 0;
    } 

    // Set option
    for (DWORD i=0;MapFilterOptions[i].szName!=NULL;i++) 
    {
        if (!stricmp(argv[1],MapFilterOptions[i].szName)) 
        {
            if (argc>=3 && !stricmp(argv[2],"color")) 
            {
                if (MapFilterOptions[i].DefaultColor == -1) 
                {
                    WriteChatf("Option '%s' does not have a color.",MapFilterOptions[i].szName);
                } 
                else 
                {
                    DWORD R,G,B;
                    R = G = B = 255;
                    if (argc<6) 
                    {
                        MapFilterOptions[i].Color = MapFilterOptions[i].DefaultColor;
                    } 
                    else 
                    {
                        R=atoi(argv[3]);
                        G=atoi(argv[4]);
                        B=atoi(argv[5]);
                        if (R>255) R=255;
                        if (G>255) G=255;
                        if (B>255) B=255;
                        MapFilterOptions[i].Color = R*0x10000 + G*0x100 + B;
                    }
                    WriteChatf("Option '%s' color set to: %d %d %d",MapFilterOptions[i].szName,R,G,B);

                    //itoa(MapFilterOptions[i].Color & 0xFFFFFF,szBuffer,10);
                    char szBuffer[128];
                    sprintf(szBuffer,"%s Color",MapFilterOptions[i].szName);
                    pISInterface->SetSettingi("ISXEQMap.XML","Map Filters",szBuffer,MapFilterOptions[i].Color & 0xFFFFFF);
                    pISInterface->SaveSettings("ISXEQMap.XML");

                    MapFilterOptions[i].Color |= 0xFF000000;
                }
            } 
            else 
            {
                MapFilterSetting(i,2,argc,argv);
            }
            if (MapFilterOptions[i].RegenerateOnChange)
            {
                MapClear();
                MapGenerate();
            }
            return 0;
        }
    }

    WriteChatf("Usage: %s <option>|help",argv[0]);
    return 0;
}
Ejemplo n.º 9
0
VOID MapFilters(PSPAWNINFO pChar, PCHAR szLine)
{
	bRunNextCommand = TRUE;
	CHAR szArg[MAX_STRING] = { 0 };
	GetArg(szArg, szLine, 1);
	PCHAR szRest = GetNextArg(szLine);
	CHAR szBuffer[MAX_STRING] = { 0 };

	// Display settings
	if (szArg[0] == 0) {
		WriteChatColor("Map filtering settings:", USERCOLOR_DEFAULT);
		WriteChatColor("-----------------------", USERCOLOR_DEFAULT);
		for (DWORD i = 0; MapFilterOptions[i].szName != NULL; i++)
			if (RequirementsMet(i))
				MapFilterSetting(pChar, i);

		// Display Help
	}
	else if (!_strnicmp(szArg, "help", 4))
	{
		WriteChatColor("Map filtering options:", USERCOLOR_DEFAULT);
		for (DWORD i = 0; MapFilterOptions[i].szName != NULL; i++) {
			sprintf_s(szBuffer, "%s%s: %s", MapFilterOptions[i].szName, (MapFilterOptions[i].bIsToggle) ? "" : " #", MapFilterOptions[i].szHelpString);
			WriteChatColor(szBuffer, USERCOLOR_DEFAULT);
		}
		WriteChatColor("'option' color [r g b]: Set display color for 'option' (Omit to reset to default)", USERCOLOR_DEFAULT);

		// Set option
	}
	else {
		PMAPFILTER Found = 0;
		for (DWORD i = 0; MapFilterOptions[i].szName != NULL; i++) {
			if (!_stricmp(szArg, MapFilterOptions[i].szName)) {
				if (!_strnicmp(szRest, "color", 5)) {
					if (MapFilterOptions[i].DefaultColor == -1) {
						sprintf_s(szBuffer, "Option '%s' does not have a color.", MapFilterOptions[i].szName);
						WriteChatColor(szBuffer, USERCOLOR_DEFAULT);
					}
					else {
						DWORD R, G, B;
						CHAR szBuffer2[MAX_STRING] = { 0 };
						GetArg(szArg, szRest, 2);
						if (szArg[0] == 0) {
							MapFilterOptions[i].Color = MapFilterOptions[i].DefaultColor;
						}
						else {
							R = atoi(szArg);
							G = atoi(GetArg(szArg, szRest, 3));
							B = atoi(GetArg(szArg, szRest, 4));
							if (R>255) R = 255;
							if (G>255) G = 255;
							if (B>255) B = 255;
							MapFilterOptions[i].Color = R * 0x10000 + G * 0x100 + B;
						}
						sprintf_s(szBuffer, "Option '%s' color set to: %d %d %d", MapFilterOptions[i].szName, R, G, B);
						WriteChatColor(szBuffer, USERCOLOR_DEFAULT);
						_itoa_s(MapFilterOptions[i].Color & 0xFFFFFF, szBuffer, 10);
						sprintf_s(szBuffer2, "%s-Color", MapFilterOptions[i].szName);
						WritePrivateProfileString("Map Filters", szBuffer2, szBuffer, INIFileName);
						MapFilterOptions[i].Color |= 0xFF000000;
					}
				}
				else {
					MapFilterSetting(pChar, i, szRest);
				}
				Found = &MapFilterOptions[i];
			}
		}
		if (!Found)
			SyntaxError("Usage: /mapfilter [option|help]");
		else if (Found->RegenerateOnChange)
		{
			MapClear();
			MapGenerate();
		}
	}
}
Ejemplo n.º 10
0
Archivo: set.c Proyecto: cfengine/core
void SetClear(Set *set)
{
    assert(set != NULL);
    MapClear(set);
}