Beispiel #1
0
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
//|							From ReferenceMaker								 |
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
RefResult PFTestSpeed::NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget,PartID& partID, RefMessage message)
{
	switch (message) {
		case REFMSG_CHANGE:
			if ( hTarget == pblock() ) {
				ParamID lastUpdateID = pblock()->LastNotifyParamID();
				switch ( lastUpdateID )
				{
				case kSpeedTest_testType:
				case kSpeedTest_unitVariation:
				case kSpeedTest_angleVariation:
					RefreshUI(kSpeedTest_message_update);
					// the break is omitted on purpose (bayboro 11-18-02)
				case kSpeedTest_conditionType:
				case kSpeedTest_unitValue:
				case kSpeedTest_angleValue:
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					break;
				}
				UpdatePViewUI(lastUpdateID);
			}
			break;
		// Initialization of Dialog
		case kSpeedTest_RefMsg_InitDlg:
			RefreshUI(kSpeedTest_message_update, (IParamMap2*)partID);
			return REF_STOP;
		// New Random Seed
		case kSpeedTest_RefMsg_NewRand:
			theHold.Begin();
			NewRand();
			theHold.Accept(GetString(IDS_NEWRANDOMSEED));
			return REF_STOP;
	}	
	return REF_SUCCEED;
}
RefResult PFOperatorSimpleOrientation::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
														PartID& partID, RefMessage message)
{
	IParamMap2* map = NULL;

	switch(message) {
		case REFMSG_CHANGE:
			if ( hTarget == pblock() ) {
				int lastUpdateID = pblock()->LastNotifyParamID();
				switch(lastUpdateID) {
				case kSimpleOrientation_direction:
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					// break is omitted on purpose (bayboro 6/18/2003)
				case kSimpleOrientation_restrictToAxis:
					RefreshUI(kSimpleOrientation_message_update);
					break;
				}
				UpdatePViewUI(lastUpdateID);
			}
			break;
		case kSimpleOrientation_RefMsg_Init:
			map = (IParamMap2*)partID;
			RefreshUI(kSimpleOrientation_message_update, map);
			return REF_STOP;
		case kSimpleOrientation_RefMsg_NewRand:
			theHold.Begin();
			NewRand();
			theHold.Accept(GetString(IDS_NEWRANDOMSEED));
			return REF_STOP;
	}
	return REF_SUCCEED;
}
bool DebuggerManager::UnregisterDebugger(cbDebuggerPlugin *plugin)
{
    RegisteredPlugins::iterator it = m_registered.find(plugin);
    if(it == m_registered.end())
        return false;

    it->second.ClearConfigurations();
    m_registered.erase(it);
    if (plugin == m_activeDebugger)
    {
        if (m_registered.empty())
            m_activeDebugger = nullptr;
        else
            m_activeDebugger = m_registered.begin()->first;
        m_menuHandler->SetActiveDebugger(m_activeDebugger);
    }
    if (!Manager::IsAppShuttingDown())
    {
        m_menuHandler->RebuildMenus();
        RefreshUI();
    }

    if (m_registered.empty())
    {
        DestoryWindows();

        if (Manager::Get()->GetLogManager())
            Manager::Get()->GetDebuggerManager()->HideLogger();
    }

    return true;
}
bool PFOperatorMaterialFrequency::updateFromRealMtl()
{
	if (pblock == NULL) return false;
	if (theHold.RestoreOrRedoing()) return true;
	if (gUpdateFrequencyMtlInProgress) return false;
	if (verifyMtlsMXSSync()) return false;
	gUpdateFrequencyMtlInProgress = true;
	pblock()->SetValue(kMaterialFrequency_material, 0, _material());
	int curNumSubs = (material() != NULL) ? _material()->NumSubMtls() : 0;
	if (curNumSubs != lastNumSubs()) {
		_lastNumSubs() = curNumSubs;
		RefreshUI(kMaterialFrequency_message_numSubMtls);
	}
	RefreshUI(kMaterialFrequency_message_numSubMtls);
	gUpdateFrequencyMtlInProgress = false;
	return true;
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION


void SDeviceProfileDetailsPanel::UpdateUIForProfile( const TWeakObjectPtr< UDeviceProfile > InProfile )
{
	ViewingProfile = InProfile;
	RefreshUI();
}
void DebuggerManager::OnPluginLoadingComplete(cb_unused CodeBlocksEvent& event)
{
    RefreshUI();
    if (!m_activeDebugger)
    {
        m_useTargetsDefault = true;
        FindTargetsDebugger();
    }
}
void DebuggerManager::SetActiveDebugger(cbDebuggerPlugin* activeDebugger, ConfigurationVector::const_iterator config)
{
    RegisteredPlugins::const_iterator it = m_registered.find(activeDebugger);
    cbAssert(it != m_registered.end());

    m_useTargetsDefault = false;
    m_activeDebugger = activeDebugger;
    int index = std::distance(it->second.GetConfigurations().begin(), config);
    m_activeDebugger->SetActiveConfig(index);

    WriteActiveDebuggerConfig(it->first->GetSettingsName(), index);
    RefreshUI();
}
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
//|							From ReferenceMaker								 |
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
RefResult PFTestSplitBySource::NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget,PartID& partID, RefMessage message)
{
	switch (message) {
		case REFMSG_CHANGE:
			if ( hTarget == pblock() ) {
				int lastUpdateID = pblock()->LastNotifyParamID();
				switch ( lastUpdateID )
				{
				case kSplitBySource_sources:
					RefreshUI(kSplitBySource_message_update);
					break;
				}
				UpdatePViewUI(lastUpdateID);
			}
			break;

		case REFMSG_NODE_HANDLE_CHANGED:
			if (hTarget == NULL) // direct notification
				updateNodeHandles((IMergeManager*)partID);
			return REF_STOP;

		// Initialization of Dialog
		case kSplitBySource_RefMsg_InitDlg:
			RefreshUI(kSplitBySource_message_update, (IParamMap2*)partID);
			return REF_STOP;
		// New Random Seed
		case kSplitBySource_RefMsg_NewRand:
			theHold.Begin();
			NewRand();
			theHold.Accept(GetString(IDS_NEWRANDOMSEED));
			return REF_STOP;
		case kSplitBySource_RefMsg_MacrorecSources:
			macrorecSources();
			return REF_STOP;
	}	
	return REF_SUCCEED;
}
//+--------------------------------------------------------------------------+
//|							From ReferenceMaker								 |
//+--------------------------------------------------------------------------+
RefResult PFTestGoToRotation::NotifyRefChanged(Interval changeInt,RefTargetHandle hTarget,PartID& partID, RefMessage message)
{
	IParamMap2* map;

	switch (message) {
		case REFMSG_CHANGE:
			if ( hTarget == pblock() ) 
			{
				ParamID lastUpdateID = pblock()->LastNotifyParamID();
				switch ( lastUpdateID )
				{
				case kGoToRotation_syncBy:
					RefreshUI(kGoToRotation_message_sync);
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					break;
				case kGoToRotation_time:
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					break;
				case kGoToRotation_variation:
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					RefreshUI(kGoToRotation_message_variation);
					break;
				case kGoToRotation_spinVariation:
					RefreshUI(kGoToRotation_message_variation);
					break;
				case kGoToRotation_matchSpin:
					RefreshUI(kGoToRotation_message_match);
					break;
				}
				UpdatePViewUI(lastUpdateID);
			}
			break;
		// Initialization of Dialog
		case kGoToRotation_RefMsg_InitDlg:
			map = (IParamMap2*)partID;
			RefreshUI(kGoToRotation_message_sync, map);
			RefreshUI(kGoToRotation_message_variation, map);
			RefreshUI(kGoToRotation_message_match);
			return REF_STOP;

		// New Random Seed
		case kGoToRotation_RefMsg_NewRand:
			theHold.Begin();
			NewRand();
			theHold.Accept(GetString(IDS_NEWRANDOMSEED));
			return REF_STOP;
	}	
	return REF_SUCCEED;
}
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SDeviceProfileDetailsPanel::Construct( const FArguments& InArgs )
{
	// Generate our details panel.
	DetailsViewBox = SNew( SVerticalBox );
	RefreshUI();

	ChildSlot
	[
		SNew( SBorder )
		.BorderImage( FEditorStyle::GetBrush( "Docking.Tab.ContentAreaBrush" ) )
		[
			SNew( SVerticalBox )
			+ SVerticalBox::Slot()
			.AutoHeight()
			.Padding( FMargin( 2.0f ) )
			.VAlign( VAlign_Bottom )
			[
				SNew( SHorizontalBox )
				+ SHorizontalBox::Slot()
				.AutoWidth()
				.Padding( 0.0f, 0.0f, 4.0f, 0.0f )
				[
					SNew( SImage )
					.Image( FEditorStyle::GetBrush( "LevelEditor.Tabs.Details" ) )
				]
				+ SHorizontalBox::Slot()
					.VAlign( VAlign_Center )
					[
						SNew( STextBlock )
						.Text( LOCTEXT("CVarsLabel", "Console Variables") )
						.TextStyle( FEditorStyle::Get(), "Docking.TabFont" )
					]
			]

			+ SVerticalBox::Slot()
			[
				SNew( SHorizontalBox )
				+ SHorizontalBox::Slot()
				[
					DetailsViewBox.ToSharedRef()
				]
			]
		]
	];
}
Beispiel #11
0
void CDbWriteThread::customEvent( QEvent *e )
{
    CDbEvent* pEvent = ( CDbEvent* ) e;
    CDbEvent::WriteParameter& parameter = pEvent->GetParameter( );
    CDbEvent::UserEvent evtType = ( CDbEvent::UserEvent ) e->type( );

    switch ( evtType ) {
    case CDbEvent::SQLExternal :
        WriteData( parameter, true );
        break;

    case CDbEvent::SQLInternal :
        WriteData( parameter, true );
        break;

    case CDbEvent::ImgExternal :
        if ( bWriteImage ) {
            WriteData( parameter, false );
        } else {
            PostWriteImage( e );
        }
        break;

    case CDbEvent::ImgInternal :
        if ( bWriteImage ) {
            WriteData( parameter, false );
        } else {
            PostWriteImage( e );
        }
        break;
    }

    if ( pEvent->GetRefreshUI( ) ) {
        emit RefreshUI( pEvent->GetStoprdid( ) );
    }
}
RefResult PFOperatorMaterialStatic::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
													 PartID& partID, RefMessage message)
{
	IParamMap2* map;
	TSTR dynamicNameSuffix;

	if ( hTarget == pblock() ) {
		int lastUpdateID;
		switch (message)
		{
		case REFMSG_CHANGE:
			lastUpdateID = pblock()->LastNotifyParamID();
			if (lastUpdateID == kMaterialStatic_material) {
				if (updateFromMXSMtl()) {
					NotifyDependents(FOREVER, PART_MTL, kPFMSG_UpdateMaterial, NOTIFY_ALL, TRUE);
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
				}
				UpdatePViewUI(lastUpdateID);
				return REF_STOP;
			}
			if (!(theHold.Holding() || theHold.RestoreOrRedoing())) return REF_STOP;
			switch ( lastUpdateID )
			{
			case kMaterialStatic_assignMaterial:
				RefreshUI(kMaterialStatic_message_assignMaterial);
				NotifyDependents(FOREVER, PART_MTL, kPFMSG_UpdateMaterial, NOTIFY_ALL, TRUE);
				NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
				break;
			case kMaterialStatic_assignID:
				RefreshUI(kMaterialStatic_message_assignID);
				break;
			case kMaterialStatic_type:
				RefreshUI(kMaterialStatic_message_type);
				break;
			case kMaterialStatic_rateType:
				RefreshUI(kMaterialStatic_message_rateType);
				break;
			}
			UpdatePViewUI(lastUpdateID);
			break;
		case REFMSG_NODE_WSCACHE_UPDATED:
			updateFromRealMtl();
			break;
		// Initialization of Dialog
		case kMaterialStatic_RefMsg_InitDlg:
			// Set ICustButton properties for MaterialStatic DAD button
			map = (IParamMap2*)partID;
			if (map != NULL) {
				HWND hWnd = map->GetHWnd();
				if (hWnd) {
					ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, IDC_MATERIAL));
					iBut->SetDADMgr(_dadMgr());
					ReleaseICustButton(iBut);
				}
			}
			// Refresh UI
			RefreshUI(kMaterialStatic_message_assignMaterial);
			RefreshUI(kMaterialStatic_message_assignID);
			return REF_STOP;
		// New Random Seed
		case kMaterialStatic_RefMsg_NewRand:
			theHold.Begin();
			NewRand();
			theHold.Accept(GetString(IDS_NEWRANDOMSEED));
			return REF_STOP;
		}
	}
	if ( hTarget == const_cast <Mtl*> (material()) ) {
		switch (message)
		{
		case REFMSG_CHANGE:
			return REF_STOP;
//			if (ignoreRefMsgNotify()) return REF_STOP;
//			if (!(theHold.Holding() || theHold.RestoreOrRedoing())) return REF_STOP;
			break;
		case REFMSG_NODE_NAMECHANGE:
			if (HasDynamicName(dynamicNameSuffix)) {
				if (lastDynamicName() != dynamicNameSuffix) {
					_lastDynamicName() = dynamicNameSuffix;
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					UpdatePViewUI(kMaterialStatic_material);
				}
			}
			return REF_STOP;
		case REFMSG_TARGET_DELETED:
			_material() = NULL;
			if (pblock() != NULL)
				pblock()->SetValue(kMaterialStatic_material, 0, NULL);
			if (theHold.Holding()) {
				if (HasDynamicName(dynamicNameSuffix)) {
					if (lastDynamicName() != dynamicNameSuffix) {
						_lastDynamicName() = dynamicNameSuffix;
						NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
						UpdatePViewUI(kMaterialStatic_material);
					}
				}
			}
			break;
		}
	}

	return REF_SUCCEED;
}
Beispiel #13
0
void DebuggerManager::FindTargetsDebugger()
{
    if (Manager::Get()->GetProjectManager()->IsLoadingOrClosing())
        return;

    m_activeDebugger = nullptr;
    m_menuHandler->SetActiveDebugger(nullptr);

    if (m_registered.empty())
    {
        m_menuHandler->MarkActiveTargetAsValid(false);
        return;
    }

    ProjectManager* projectMgr = Manager::Get()->GetProjectManager();
    LogManager* log = Manager::Get()->GetLogManager();
    cbProject* project = projectMgr->GetActiveProject();
    ProjectBuildTarget *target = nullptr;
    if (project)
    {
        const wxString &targetName = project->GetActiveBuildTarget();
        if (project->BuildTargetValid(targetName))
            target = project->GetBuildTarget(targetName);
    }


    Compiler *compiler = nullptr;
    if (!target)
    {
        if (project)
            compiler = CompilerFactory::GetCompiler(project->GetCompilerID());
        if (!compiler)
            compiler = CompilerFactory::GetDefaultCompiler();
        if (!compiler)
        {
            log->LogError(_("Can't get the compiler for the active target, nor the project, nor the default one!"));
            m_menuHandler->MarkActiveTargetAsValid(false);
            return;
        }
    }
    else
    {
        compiler = CompilerFactory::GetCompiler(target->GetCompilerID());
        if (!compiler)
        {
            log->LogError(wxString::Format(_("Current target '%s' doesn't have valid compiler!"),
                                           target->GetTitle().c_str()));
            m_menuHandler->MarkActiveTargetAsValid(false);
            return;
        }
    }
    wxString dbgString = compiler->GetPrograms().DBGconfig;
    wxString::size_type pos = dbgString.find(wxT(':'));

    wxString name, config;
    if (pos != wxString::npos)
    {
        name = dbgString.substr(0, pos);
        config = dbgString.substr(pos + 1, dbgString.length() - pos - 1);
    }

    if (name.empty() || config.empty())
    {
        log->LogError(wxString::Format(_("Current compiler '%s' doesn't have correctly defined debugger!"),
                                       compiler->GetName().c_str()));
        m_menuHandler->MarkActiveTargetAsValid(false);
        return;
    }

    for (RegisteredPlugins::iterator it = m_registered.begin(); it != m_registered.end(); ++it)
    {
        PluginData &data = it->second;
        if (it->first->GetSettingsName() == name)
        {
            ConfigurationVector &configs = data.GetConfigurations();
            int index = 0;
            for (ConfigurationVector::iterator itConf = configs.begin(); itConf != configs.end(); ++itConf, ++index)
            {
                if ((*itConf)->GetName() == config)
                {
                    m_activeDebugger = it->first;
                    m_activeDebugger->SetActiveConfig(index);
                    m_useTargetsDefault = true;

                    WriteActiveDebuggerConfig(wxEmptyString, -1);
                    RefreshUI();
                    m_menuHandler->MarkActiveTargetAsValid(true);
                    return;
                }
            }
        }
    }

    wxString targetTitle(target ? target->GetTitle() : wxT("<nullptr>"));
    log->LogError(wxString::Format(_("Can't find the debugger config: '%s:%s' for the current target '%s'!"),
                                   name.c_str(), config.c_str(),
                                   targetTitle.c_str()));
    m_menuHandler->MarkActiveTargetAsValid(false);
}
RefResult PFOperatorForceSpaceWarp::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
														PartID& partID, RefMessage message)
{
	switch (message)
	{
		case REFMSG_CHANGE:
			if ( hTarget == pblock() ) {
				ParamID lastUpdateID = pblock()->LastNotifyParamID();
				if (lastUpdateID == kForceSpaceWarp_ForcesMaxscript) {
					if (IsIgnoringRefNodeChange()) return REF_STOP;
					updateFromMXSForces();
					return REF_STOP;
				}
				if (!(theHold.Holding() || theHold.RestoreOrRedoing())) return REF_STOP;
				switch ( lastUpdateID )
				{
				case kForceSpaceWarp_ForceNodeList:
					if (IsIgnoringRefNodeChange()) return REF_STOP;
					updateFromRealForces();
					if (updateObjectNames(kForceSpaceWarp_ForceNodeList)) {
						RefreshUI(kForceSpaceWarp_message_nodes);
						NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
						UpdatePViewUI(pblock(), lastUpdateID);
					}
					return REF_SUCCEED; // to avoid unnecessary UI update
				}
				UpdatePViewUI(pblock(), lastUpdateID);
			} else if (hTarget == scriptPBlock() ) {
				ParamID lastUpdateID = scriptPBlock()->LastNotifyParamID();
				bool disable = ((scriptPBlock()->GetInt(kForceSpaceWarp_useScriptWiring, 0) != 0)
							&& (scriptPBlock()->GetInt(kForceSpaceWarp_useFloat, 0) == kForceSpaceWarp_useFloat_influence));
				if (disable) 
					RefreshUI(kForceSpaceWarp_message_disableInfluence);
				else
					RefreshUI(kForceSpaceWarp_message_enableInfluence);
				UpdatePViewUI(scriptPBlock(), lastUpdateID);
			}
			break;
		case REFMSG_NODE_NAMECHANGE:
			NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
			UpdatePViewUI(pblock(), kForceSpaceWarp_ForceNodeList);
			break;
		case REFMSG_NODE_WSCACHE_UPDATED:
			updateFromRealForces();
			break;
		// Initialization of Dialog
		case kForceSpaceWarp_RefMsg_InitDlg:
			{
				if (scriptPBlock() != NULL) {
					bool disable = ((scriptPBlock()->GetInt(kForceSpaceWarp_useScriptWiring, 0) != 0)
								&& (scriptPBlock()->GetInt(kForceSpaceWarp_useFloat, 0) == kForceSpaceWarp_useFloat_influence));
					if (disable) 
						RefreshUI(kForceSpaceWarp_message_disableInfluence, (IParamMap2*)partID);
					else
						RefreshUI(kForceSpaceWarp_message_enableInfluence, (IParamMap2*)partID);
				}
				RefreshUI(kForceSpaceWarp_message_nodes, (IParamMap2*)partID);
			}
			return REF_STOP;
		case kForceSpaceWarp_RefMsg_ListSelect:
			validator.action = this;
			GetCOREInterface()->DoHitByNameDialog(this);
			return REF_STOP;
		case kForceSpaceWarp_RefMsg_ResetValidatorAction:
			validator.action = this;
			return REF_STOP;
	}
	return REF_SUCCEED;
}
Beispiel #15
0
void UIManager::HandleEvent(string eventName, list<string> params)
{
	int action = m_ActionStringToEnumMap[eventName];

	switch (action)
	{
	case PUSH_UI:
		{
			string ui_name = *(params.begin()); // always only 1 parameter
			PushUI(ui_name); 
			if (ui_name == "mainmenu")
			{
				GameObjectManager::Instance()->SetLevelFreshLaunch(true);
			}
			break;
		}
	case POP_UI:
		{
			string ui_name = *(params.begin()); // always only 1 parameter
			PopUI(ui_name); 
			break;
		}
	case LOAD_LEVEL:
		{
			string level_file = *(params.begin()); // always only 1 parameter
			Game::SetIsLevelEditMode(false);
			auto inputManager = Game::GetInstance()->GetInputManager();
			inputManager.EnableDebugInfo(false);
			inputManager.EnablePostProcessing(false);
			GameObjectManager::Instance()->LoadObjectsFromFile(level_file.c_str());
			break;
		}
	case PLAY_SOUND_EFFECT:
		{
			list<string>::iterator iter = params.begin();
			string sound_file = (*iter); // first param is the audio file

			// second param is optional and is the loop bool
			bool loop = false;
			iter++;
			if (iter != params.end())
			{
				string boolean = (*iter);
				if ((*iter) == "true") loop = true; 
			}

			AudioManager::Instance()->PlaySoundEffect(sound_file, loop);
			break;
		}
	case PLAY_MUSIC:
		{
			list<string>::iterator iter = params.begin();
			string sound_file = (*iter); // first param is the audio file

			// second param is optional and is the loop bool
			bool loop = false;
			iter++;
			if (iter != params.end())
			{
				string boolean = (*iter);
				if ((*iter) == "true") loop = true; 
			}

			AudioManager::Instance()->PlayMusic(sound_file, loop);
			break;
		}
	case REFRESH_UI:
		{
			RefreshUI();
			break;
		}
	case STOP_ALL_SOUNDS:
		{
			AudioManager::Instance()->StopAllSounds();
			break;
		}
	case PAUSE_GAME:
		{
			Game::PauseGame();
			break;
		}
	case UNPAUSE_GAME:
		{
			Game::UnPauseGame();
			break;
		}
	case DESTROY_LEVEL:
		{
			Game::SetIsLevelEditMode(false);
			Game::GetInstance()->ResetLevelEditor();
			GameObjectManager::Instance()->DeleteGameObjects();
			break;
		}
	case SLEEP:
		{
			list<string>::iterator iter = params.begin();
			int milliseconds = atoi((*iter).c_str());
			Sleep(milliseconds);
		}
	case APPLY_ALPHA:
		{
			list<string>::iterator iter = params.begin();
			string ui = (*iter); 
			iter++;
			float alpha = atof((*iter).c_str());
			m_allScreens[ui]->ApplyAlpha(alpha);
			break;
		}
	case FADE_OUT:
		{
			list<string>::iterator iter = params.begin();
			int milliseconds = atoi((*iter).c_str());

			// start fading out - we do 10 passes 
			UIScreen * screen = PushUI("fullscreen_fade");
			screen->ApplyAlpha(0.0);
			float count = 0.0f;

			while (count < 1.0f)
			{
				screen->ApplyAlpha(count);
				RefreshUI();
				Sleep(milliseconds * 0.05f); // TODO: this is terrible bleugh, get rid of this crap
				count+= 0.05;
			}

			PopUI("fullscreen_fade");
			break;
		}
	case FADE_IN:
		{
			list<string>::iterator iter = params.begin();
			int milliseconds = atoi((*iter).c_str());

			// start fading out - we do 10 passes 
			UIScreen * screen = PushUI("fullscreen_fade");
			screen->ApplyAlpha(1.0);
			float count = 1.0;

			while (count > 0)
			{
				screen->ApplyAlpha(count);
				RefreshUI();
				Sleep(milliseconds/10);
				count-= 0.05;
			}

			PopUI("fullscreen_fade");
			break;
		}
	case MUTE_SOUND_EFFECTS:
		{
			AudioManager::Instance()->SetSfxEnabled(false);
			Settings::GetInstance()->SetSfxEnabled(false, true);
			break;
		}
	case MUTE_MUSIC:
		{
			AudioManager::Instance()->SetMusicEnabled(false);
			Settings::GetInstance()->SetMusicEnabled(false, true);
			break;
		}
	case UNMUTE_MUSIC:
		{
			AudioManager::Instance()->SetMusicEnabled(false);
			Settings::GetInstance()->SetMusicEnabled(true, true);
			break;
		}
	case UNMUTE_SOUND_EFFECTS:
		{
			AudioManager::Instance()->SetSfxEnabled(true);
			Settings::GetInstance()->SetSfxEnabled(true, true);
			break;
		}
	case QUIT_TO_DESKTOP:
		{
			PostDestroyMessage(); // evil global from program.cpp
			break;
		}
	case LEVEL_EDIT:
		{
			Game::GetInstance()->ResetLevelEditor();
			// only allow level editing if the back buffer is 1920x1080
			// this needs to be fixed at a later time
			if (Graphics::GetInstance()->BackBufferWidth() == 1920 &&
				Graphics::GetInstance()->BackBufferHeight() == 1080)
			{
				list<string>::iterator iter = params.begin();
				const char * level = (*iter).c_str();
				Game::SetIsLevelEditMode(true);
				GameObjectManager::Instance()->LoadObjectsFromFile(level);
			}
			auto inputManager = Game::GetInstance()->GetInputManager();
			inputManager.EnableDebugInfo(true);
			inputManager.EnablePostProcessing(true);
			break;			
		}
	case SET_LANGUAGE:
		{
			list<string>::iterator iter = params.begin();
			std::string lang = (*iter).c_str();
			StringManager::GetInstance()->SetLocale(lang);
			break;
		}

	default:
		break;
	};
}