Moderator: MacroQuest Developers
Code: Select all
// ***************************************************************************
// Function: MaxFPS
// Description: Our /MaxFPS command. Sets or displays the max fps setting for
// foreground or background
// 2003-11-01 Lax
// ***************************************************************************
VOID MaxFPS(PSPAWNINFO pChar, PCHAR szLine)
{
bRunNextCommand = TRUE;
CHAR szCmd[MAX_STRING] = {0};
CHAR Arg1[MAX_STRING] = {0};
CHAR Arg2[MAX_STRING] = {0};
GetArg(Arg1,szLine,1);
GetArg(Arg2,szLine,2);
if (Arg1[0]==0 || Arg2[0]==0) {
[color=red] sprintf(szCmd,"\aw\ayMaxFPS\ax\a-u:\ax \a-u[\ax\at%d\ax Foreground\a-u]\ax \a-u[\ax\at%d\ax Background\a-u]\ax",gFG_SLEEP?1000/gFG_SLEEP:0,gBG_SLEEP?1000/gBG_SLEEP:0);[/color]
WriteChatBuffer(szCmd,USERCOLOR_DEFAULT);
WriteChatBuffer("Usage: /maxfps <fg|bg> [#]",USERCOLOR_DEFAULT);
return;
}
DWORD NewMax=atoi(Arg2);
if (NewMax>200)
{
WriteChatBuffer("MaxFPS: Please use a number between 0 and 200",USERCOLOR_DEFAULT);
return;
}
if (!stricmp(Arg1,"fg"))
{
SetForegroundMaxFPS(NewMax);
WritePrivateProfileString("MacroQuest","ForegroundMaxFPS",Arg2,gszINIFilename);
}
else if (!stricmp(Arg1,"bg"))
{
SetBackgroundMaxFPS(NewMax);
WritePrivateProfileString("MacroQuest","BackgroundMaxFPS",Arg2,gszINIFilename);
}
[color=red] sprintf(szCmd,"\aw\ayMaxFPS\ax\a-u:\ax \a-u[\ax\at%d\ax Foreground\a-u]\ax \a-u[\ax\at%d\ax Background\a-u]\ax",gFG_SLEEP?1000/gFG_SLEEP:0,gBG_SLEEP?1000/gBG_SLEEP:0);[/color]
WriteChatBuffer(szCmd,USERCOLOR_DEFAULT);
}