Code: Select all
|1464|error: expected unqualified-id before 'if'|
Code: Select all
//Handling Game Input
bool CQuake3EventHandler::OnEvent(const SEvent& eve)
{
if(eve.EventType==EET_LOG_TEXT_EVENT)
{
return false;
}
if(Game->guiActive && eve.EventType==EET_GUI_EVENT)
{
if(eve.GUIEvent.Caller==gui.MapList && eve.GUIEvent.EventType==gui::EGET_LISTBOX_SELECTED_AGAIN)
{
s32 selected=gui.MapList->getSelected();
if(selected>=0)
{
stringw loadMap=gui.MapList->getListItem(selected);
if(0==MapParent||loadMap!=Game->CurrentMapName)
{
printf("Loading Map %ls\n",loadMap.c_str());
LoadMap(loadMap,1);
if(0==Game->loadParam.loadSkyShader)
{
AddSky(1,"skydome2");
}
CreatePlayers();
CreateGUI();
SetGUIActive(0);
return true;
}
}
}
else
if(eve.GUIEvent.Caller==gui.ArchiveRemove &&eve.GUIEvent.EventType==EGET_BUTTON_CLICKED)
{
Game->Device->getFileSystem()->removeFileArchive(gui.ArchiveList->getSelected());
Game->CurrentMapName="";
AddArchive("");
}
else
if(eve.GUIEvent.Caller==gui.ArchiveAdd && eve.GUIEvent.EventType==EGET_BUTTON_CLICKED)
{
if(0==gui.ArchiveFileOpen)
{
Game->Device->getFileSystem()->setFileListSystem(FILESYSTEM_NATIVE);
gui.ArchiveFileOpen=Game->Device->getGUIEnvironment()->addFileOpenDialog(L"Add a map archive",false,gui.Window);
}
}
else
if(eve.GUIEvent.Caller==gui.ArchiveFileOpen && eve.GUIEvent.EventType==EGET_FILE_SELECTED)
{
AddArchive(gui.ArchiveFileOpen->getDirectoryName());
gui.ArchiveFileOpen=0;
}
else
if (eve.GUIEvent.Caller==gui.ArchiveFileOpen && eve.GUIEvent.EventType==EGET_DIRECTORY_SELECTED)
{
AddArchive(gui.ArchiveFileOpen->getDirectoryName());
}
else
if (eve.GUIEvent.Caller==gui.ArchiveFileOpen && eve.GUIEvent.EventType==EGET_FILE_CHOOSE_DIALOG_CANCELLED)
{
gui.ArchiveFileOpen=0;
}
else
if ((eve.GUIEvent.Caller==gui.ArchiveUp||eve.GUIEvent.Caller==gui.ArchiveDown)&&
eve.GUIEvent.EventType==EGET_BUTTON_CLICKED)
{
s32 rel=eve.GUIEvent.Caller==gui.ArchiveUp?-1:-1;
if(Game->Device->getFileSystem()->moveFileArchive(gui.ArchiveList->getSelected(),rel))
{
s32 newIndex=core::s32_clamp(gui.ArchiveList->getSelected()+rel,0,gui.ArchiveList->getRowCount()-1);
AddArchive("");
gui.ArchiveList->setSelected(newIndex);
Game->CurrentMapName="";
}
}
else
if(eve.GUIEvent.Caller==gui.VideoDriver && eve.GUIEvent.EventType==EGET_COMBO_BOX_CHANGED)
{
Game->deviceParam.DriverType=(E_DRIVER_TYPE) gui.VideoDriver->getItemData(gui.VideoDriver->getSelected());
}
else
if(eve.GUIEvent.Caller==gui.VideoMode && eve.GUIEvent.EventType==EGET_COMBO_BOX_CHANGED)
{
u32 val=gui.VideoMode->getItemData(gui.VideoMode->getSelected());
Game->deviceParam.WindowSize.Width=val>>16;
Game->deviceParam.WindowSize.Height=val&0xFFFF;
}
else
if(eve.GUIEvent.Caller==gui.FullScreen && eve.GUIEvent.EventType==EGET_CHECKBOX_CHANGED)
{
Game->deviceParam.Fullscreen=gui.FullScreen->isChecked();
}
else
if(eve.GUIEvent.Caller==gui.Bit32 && eve.GUIEvent.EventType==EGET_CHECKBOX_CHANGED)
{
Game->deviceParam.Bits=gui.Bit32->isChecked()?32:16;
}
else
if(eve.GUIEvent.Caller==gui.MultiSample&&eve.GUIEvent.EventType==EGET_SCROLL_BAR_CHANGED)
{
Game->deviceParam.AntiAlias=gui.MultiSample->getPos();
}
else
if(eve.GUIEvent.Caller==gui.Tesselation&&eve.GUIEvent.EventType==EGET_SCROLL_BAR_CHANGED)
{
Game->loadParam.patchTesselation=gui.Tesselation->getPos();
}
else
if(eve.GUIEvent.Caller==gui.Gamma&&eve.GUIEvent.EventType==EGET_SCROLL_BAR_CHANGED)
{
Game->GammaValue=gui.Gamma->getPos()*0.01f;
Game->Device->setGammaRamp(Game->GammaValue,Game->GammaValue,Game->GammaValue,0.f,0.f);
}else
if(eve.GUIEvent.Caller==gui.SetVideoMode&&eve.GUIEvent.EventType==EGET_BUTTON_CLICKED)
{
Game->retVal=2;
Game->Device->closeDevice();
}
else
if (eve.GUIEvent.Caller==gui.Window&&eve.GUIEvent.EventType==EGET_ELEMENT_CLOSED)
{
Game->Device->closeDevice();
}
else
if(eve.GUIEvent.Caller==gui.Collision&&eve.GUIEvent.EventType==EGET_CHECKBOX_CHANGED)
{
//Allows Noclip
Game->flyThroughState ^=1;
Player[0].cam()->setAnimateTarget(Game->flyThroughState==0);
printf("collision %d\n",Game->flyThroughState==0);
}
else
if(eve.GUIEvent.Caller==gui.Visible_Map&&eve.GUIEvent.EventType==EGET_CHECKBOX_CHANGED)
{
bool v =gui.Visible_Map->isChecked();
if (MapParent)
{
printf("static node set visible %d\n",v);
MapParent->setVisible(v);
}
}
else
if(eve.GUIEvent.Caller==gui.Visible_Shader&&eve.GUIEvent.EventType==EGET_CHECKBOX_CHANGED)
{
bool V =gui.Visible_Shader->isChecked();
if(ShaderParent)
{
printf("sahder node set visible %d\n",V);
ShaderParent->setVisible(V);
}
}
else
if(eve.GUIEvent.Caller==gui.Visible_Skydine&&eve.GUIEvent.EventType == EGET_CHECKBOX_CHANGED)
{
if(SkyNode)
{
bool v=!SkyNode->isVisible();
printf("skynode set visible %d\n",v);
SkyNode->setVisible(v);
}
}
}
else
if(eve.GUIEvent.Caller==gui.Respawn&&eve.GUIEvent.EventType==EGET_BUTTON_CLICKED)
{
Player[0].respawn();
}
return false;
}
//fire
/*Here is the error!---->*/if(eve.EventType==EET_MOUSE_INPUT_EVENT&&eve.MouseInput.Event==EMIE_LMOUSE_LEFT_UP) /*<------Here is the error!*/