Пример #1
0
void CUIActorMenu::CheckDistance()
{
	CGameObject* pActorGO	= smart_cast<CGameObject*>(m_pActorInvOwner);
	CGameObject* pPartnerGO	= smart_cast<CGameObject*>(m_pPartnerInvOwner);
	CGameObject* pBoxGO		= smart_cast<CGameObject*>(m_pInvBox);
	VERIFY( pActorGO && (pPartnerGO || pBoxGO) );

	if ( pPartnerGO )
	{
		if ( ( pActorGO->Position().distance_to( pPartnerGO->Position() ) > 3.0f ) &&
			!m_pPartnerInvOwner->NeedOsoznanieMode() )
		{
			g_btnHint->Discard();
			HideDialog();
		}
	}
	else //pBoxGO
	{
		VERIFY( pBoxGO );
		if ( pActorGO->Position().distance_to( pBoxGO->Position() ) > 3.0f )
		{
			g_btnHint->Discard();
			HideDialog();
		}
	}
}
Пример #2
0
void CUISkinSelectorWnd::SendMessage(CUIWindow *pWnd, s16 msg, void *pData)
{
	game_cl_mp	*game = NULL;
	//game_cl_Deathmatch * dm = NULL;
	switch (msg){
		case BUTTON_CLICKED:
			game = smart_cast<game_cl_mp*>(&(Game()));
			//dm = smart_cast<game_cl_Deathmatch *>(&(Game()));
/*
			if (pWnd == m_pButtons[0])
				OnKeyLeft();
			else if (pWnd == m_pButtons[1])
				OnKeyRight();
			else */if (pWnd == m_pBtnAutoSelect)
			{
				m_iActiveIndex = -1;
				OnBtnOK();		
			}
			else if (pWnd == m_pBtnSpectator)
			{
				HideDialog();
				game->OnSpectatorSelect();
			}
			else if (pWnd == m_pBtnBack)
			{
				HideDialog();
				game->OnSkinMenuBack();				
			}
			else
                for (int i = 0; i<6; i++)
					if (pWnd == m_pImage[i])
					{
						m_iActiveIndex = m_firstSkin+i;
						OnBtnOK();					
					}
			break;
		case WINDOW_FOCUS_RECEIVED:
/*
			if (pWnd == m_pButtons[0])
			{
				m_pAnims[0]->Rewind(0);
				m_pAnims[0]->Play();
			}
			else if (pWnd == m_pButtons[1])
			{
				m_pAnims[1]->Rewind(0);
				m_pAnims[1]->Play();
			}
*/			
			break;
	}
}
Пример #3
0
/*--------------------------------------*/
void HideColorDialog2(UIColorDialog2* dialog, gboolean apply)
{
	/* Ver.2.80 */
	GtkWidget* window = UI_DIALOG(dialog)->window;

	if( apply )
	{
		/* Ver.2.90 */
		dialog->cyan_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_c_value_spin2") ) ) );
		dialog->magenta_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_m_value_spin2") ) ) );
		dialog->yellow_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_y_value_spin2") ) ) );
		dialog->density_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_density_value_spin2") ) ) );
		dialog->contrast_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_contrast_value_spin2") ) ) );
		/* Ver.3.40 */
		dialog->tone_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_tone_value_spin2") ) ) );

		dialog->vivid
			= GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window,
					"color_dialog_vivid_button2"))->active;

		/* CNCL_INTENT : Set current setting */
		dialog->color_correct = GetCurrentnValue(CNCL_INTENT);
		/* CNCL_INPUT_GAMMA : Set current setting */
		dialog->gamma = GetCurrentnValue(CNCL_INPUT_GAMMA);
	}
	else	
	{	/* "Cancel" -> Recover parameters. */
		UpdateMenuLink(CNCL_INPUT_GAMMA, dialog->gamma);
		UpdateMenuLink(CNCL_INTENT, dialog->color_correct);
	}

	HideDialog((UIDialog*)dialog);
}
Пример #4
0
void ChangeGameTypeDialog::OnButtonClick(int i)
{
    string1024 command;
    xr_sprintf(command, "cl_votestart changegametype %s", gameTypes[i].c_str());
    Console->Execute(command);
    HideDialog();
}
Пример #5
0
void CUIChangeGameType::OnBtn(int i)
{
	string1024				command;
	xr_sprintf				(command, "cl_votestart changegametype %s", m_data[i].m_weather_name.c_str());
	Console->Execute		(command);
	HideDialog				();
}
Пример #6
0
void ChangeWeatherDialog::OnButtonClick(int i)
{
    string1024 command;
    xr_sprintf(command, "cl_votestart changeweather %s %s", *weathers[i].Name, *weathers[i].Time);
    Console->Execute(command);
    HideDialog();
}
Пример #7
0
void CUIChangeWeather::OnBtn(int i)
{
	string1024				command;
	xr_sprintf				(command, "cl_votestart changeweather %s %s", *m_data[i].m_weather_name, *m_data[i].m_weather_time);
	Console->Execute		(command);
	HideDialog							();
}
Пример #8
0
bool TransposeDialog::MessageReceived(EMListenerRepository* p_opSender, uint32 p_vMessage)
{
	switch(p_vMessage)
	{
/*	case EM_DRAW:
		if(p_opSender == m_opMainView)
		{
			eo << "EM_DRAW: m_oBackgroundView" << ef;
			m_opMainView -> SetHighColor(EMColor(0, 192, 0, 255));
			m_opMainView -> FillRect(m_opMainView -> Bounds());
		}
		else
			eo << "EM_DRAW (unknown)" << ef;
		return true;
*/	case EM_BUTTON_OK:
		eo << "OK button pressed" << ef;
	//	eo << "Getting TextControl value: " << m_opTextControl -> Text() << ef;
		m_opDialogWindow -> Hide();
		return true;
	case EM_BUTTON_CANCEL:
		eo << "Cancel button pressed" << ef;
		m_opDialogWindow -> Hide();
		return true;
	case EM_CLOSE_WINDOW:
		if(p_opSender == m_opDialogWindow)
		{
			eo << "EM_CLOSE_WINDOW" << ef;
			HideDialog();
			return true;
		}
		break;
	}
	return false;
}
Пример #9
0
void DisplayVariableDlg::OnKeyDown(wxKeyEvent& event)
{
    if(event.GetKeyCode() == WXK_F2) {
        wxTreeItemId item = m_treeCtrl->GetSelection();
        if(item.IsOk() && !IsFakeItem(item)) {
            DoEditItem(item);

        } else {
            HideDialog();
        }

    } else {
        HideDialog();

    }
}
Пример #10
0
void HideTonerReplacementDlg(UIStatusWnd *wnd)
{
	if(wnd != NULL){
		HideDialog((UIDialog *)wnd->toner_replacement_dlg);
		UpdateDialogPosition(wnd);
	}
}
Пример #11
0
gboolean
on_version_dialog_delete_event         (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{
	HideDialog((UIDialog*)g_version_dialog);
	return TRUE;
}
Пример #12
0
void CUIMpTradeWnd::OnBtnCancelClicked(CUIWindow* w, void* d)
{
	CheckDragItemToDestroy				();
	HideDialog							();
	game_cl_mp* clgame					= smart_cast<game_cl_mp*>(&(Game()));
	VERIFY(clgame);
	clgame->OnBuyMenu_Cancel			();
}
Пример #13
0
void HideUserSizeDialog(UIUserSizeDialog* dialog, gboolean apply)
{
	if( apply )
	{
		ApplyUserSizeDialog(dialog);
	}
   	HideDialog((UIDialog*)dialog);
}
Пример #14
0
bool AboutDialog::MessageReceived(EMListenerRepository* p_opSender, uint32 p_vMessage)
{
	switch(p_vMessage)
	{
	case EM_DRAW:
		if(p_opSender == m_opMainView && vDraw)
		{
			m_opMainView -> DrawBitmap(m_opSplashBitmap, 0, 0);

			char vpVersionString[80];
			sprintf(vpVersionString, "Version %s", EMApplication::GetApplicationVersionNumber());
			m_opMainView -> SetHighColor(EMColor(0, 0, 0, 255));
			m_opMainView -> DrawString(380, 20, vpVersionString);
			if(*(static_cast<bool*>(EMSettingsRepository::Instance() -> GetSetting(SETTING_SOFTWARE_IS_CRIPPLED))))
				m_opMainView -> DrawString(380, 30, "Unregistered");

			return true;
		}
		return false;
	case EM_BUTTON_HOMEPAGE:
		HideDialog();
		return true;
	case EM_BUTTON_PURCHASE:
		HideDialog();
		return true;
	case EM_GUI_COMPONENT_ENTER_PRESSED:
	case EM_GUI_COMPONENT_ESC_PRESSED:
	case EM_BUTTON_CLOSE:
		eo << "Close button pressed" << ef;
	//	eo << "Getting TextControl value: " << m_opTextControl -> Text() << ef;
		HideDialog();
		return true;
	case EM_CLOSE_WINDOW:
		if(p_opSender == m_opDialogWindow)
		{
			eo << "EM_CLOSE_WINDOW" << ef;
			HideDialog();
			return true;
		}
		break;
	}
	return false;
}
Пример #15
0
void CH3CDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	if(nID == SC_MINIMIZE)
	{
		HideDialog();
		return;
	}

	CDialog::OnSysCommand(nID, lParam);
}
Пример #16
0
void CH3CDlg::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: 在此添加消息处理程序代码和/或调用默认值
	if(nIDEvent == 1)
	{
		KillTimer(nIDEvent);
		HideDialog();
	}

	CDialog::OnTimer(nIDEvent);
}
Пример #17
0
void HideMediaSizeDialog(UIMediaSizeDialog* dialog,
							gboolean exec, gboolean apply)
{
	// Set exec flag.
	dialog->exec = exec;

	// Set apply flag.
	dialog->apply = apply;

	HideDialog((UIDialog*)dialog);
}
Пример #18
0
LRESULT CH3CDlg::OnTray(WPARAM wParam,LPARAM lParam)
{
	UINT uID=(UINT) wParam; 
	UINT uMouseMsg=(UINT) lParam; 
	CMenu menu;
	CMenu *pMenu;
	POINT pt;

	if(uMouseMsg==WM_LBUTTONDBLCLK)//如果是左键双击 
	{ 
		switch(uID) 
		{ 
		case IDR_MAINFRAME: 
		case IDI_DISCON:
			if(isShown==false) 
			{
				//显示主窗口 
				//ModifyStyle(WS_POPUP,WS_OVERLAPPEDWINDOW);  
				//ModifyStyleEx(WS_EX_TOOLWINDOW,WS_EX_TOPMOST); 
				ShowDialog();
			} 
			else 
			{
				HideDialog();
			}
			return 0;
			break; 
		default: 
			break; 
		} 
	} 

	if(uMouseMsg==WM_RBUTTONDOWN || uMouseMsg==WM_LBUTTONDOWN)//如果是单击左右键 
	{ 
		switch(uID) 
		{ 
		case IDR_MAINFRAME://如果是我们的图标 
		case IDI_DISCON:
			GetCursorPos(&pt);//取得鼠标位置 
			//执行相应操作 
			menu.LoadMenu(IDR_MENU1); 
			pMenu=menu.GetSubMenu(0); 
			ASSERT(pMenu!=0);
			::SetForegroundWindow(this->m_hWnd);
			pMenu->TrackPopupMenu (0,pt.x,pt.y,this); 
			break; 
		default: 
			break; 
		} 
	}

	return 0;

}
Пример #19
0
void CUIMpTradeWnd::OnBtnOkClicked(CUIWindow* w, void* d)
{
	DeleteHelperItems();
	CheckDragItemToDestroy				();
	StorePreset							(_preset_idx_last, true, false, false);
	HideDialog							();
	game_cl_mp* clgame					= smart_cast<game_cl_mp*>(&(Game()));
	VERIFY(clgame);
	clgame->OnBuyMenu_Ok					();
//.	StorePreset							(_preset_idx_last, true, true);
}
Пример #20
0
void on_Cancel_clicked_event		(GtkButton       *button,
                                        gpointer         user_data)
{
	const char *dlg_name = (char *)user_data;

	if(dlg_name != NULL){
		if(TRUE == SigDisable()){
			HideDialog(dlg_name, FALSE);
		}
		SigEnable();
	}
}
Пример #21
0
bool CUISpeechMenu::OnKeyboardAction(int dik, EUIMessages keyboard_action)
{
    if (dik < DIK_1 || dik > DIK_0)
		return CUIDialogWnd::OnKeyboardAction(dik, keyboard_action);

	game_cl_mp* game = smart_cast<game_cl_mp*>(&Game());

	HideDialog();
	game->OnMessageSelected(this, static_cast<u8>(dik - DIK_1));

	return true;
}
Пример #22
0
void HideMsgDlg(UIStatusWnd *wnd)
{
	switch(wnd->msg_dlg->type){
	case MSG_TYPE_PRINT_PPAP:
		gtk_widget_hide(UI_DIALOG(wnd->msg_dlg)->window);
		break;
	default:
		HideDialog((UIDialog *)wnd->msg_dlg);
		break;
	}
	DisposeDialog((UIDialog *)wnd->msg_dlg);
	wnd->msg_dlg = NULL;
}
Пример #23
0
gboolean
on_delete_event                (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{
	const char *dlg_name = (char*)user_data;
	if(dlg_name != NULL){
		if(TRUE == SigDisable()){
			HideDialog(dlg_name, FALSE);
		}
		SigEnable();
	}
	return TRUE;
}
Пример #24
0
void HideQualityDialog(UIQualityDialog* dialog, gboolean apply)
{
	if( !apply )
	{
		// Recover parameters.
		UpdateMenuLink(CNCL_PRINTQUALITY, dialog->print_quality);
		UpdateMenuLink(CNCL_DITHER_PAT, dialog->bin_method);
	}
	else
		SetQualityCustomValue(dialog);
	

	HideDialog((UIDialog*)dialog);
}
Пример #25
0
void    pfGameGUIMgr::IHideDialog( const char *name )
{
    int     i;


    for( i = 0; i < fDialogs.GetCount(); i++ )
    {
        if( stricmp( fDialogs[ i ]->GetName(), name ) == 0 )
        {
            HideDialog( fDialogs[ i ] );
            break;
        }
    }
}
Пример #26
0
void CUISkinSelectorWnd::OnBtnOK()
{
	HideDialog();
	game_cl_mp *game = smart_cast<game_cl_mp*>(&(Game()));
	VERIFY(game);
	//game_cl_Deathmatch * dm = smart_cast<game_cl_Deathmatch *>(&(Game()));
	
	if (m_iActiveIndex == -1)
	{
		m_iActiveIndex	= m_skinsEnabled[::Random.randI(m_skinsEnabled.size())];

	}
	game->OnSkinMenu_Ok();
}
Пример #27
0
void ExportMediaDialog::Export()
{
	string oFullPath(m_opExportToTextControl -> Text());
	oFullPath.append(m_opFilenameTextControl -> Text());

//	EMCommandRepository::Instance() -> ExecuteCommand(MEDIA_COMMAND_SET_RENDER_TO_DISK_OUTPUT_FILENAME, const_cast<char*>(oFullPath.c_str()), NULL, NULL);
//	EMCommandRepository::Instance() -> ExecuteCommand(MEDIA_COMMAND_SET_RENDERING_FLAG, &m_vRenderVideo, &m_vRenderAudio, NULL);
//	EMCommandRepository::Instance() -> ExecuteCommand(MEDIA_COMMAND_START_PLAYBACK);

	EMExport oExportFunctions;
	if(oExportFunctions.Export(m_vRenderVideo, m_vRenderAudio, oFullPath.c_str()))
	{
		m_opExportButton -> SetLabel("Stop");
		m_opCancelButton -> Enable(false);
	}
	else
	{
		HideDialog();
		EMMessageBox* opMessageBox = EMFactory::Instance() -> CreateMessageBox();
		opMessageBox -> DisplayDialog(m_opParentWindow -> GetNativeView(), "You are running a shareware version - export is disabled!", "Shareware version limitation!", EM_DIALOG_BUTTON_OK | EM_DIALOG_ICON_INFORMATION);
	}
}
Пример #28
0
void CUIKickPlayer::OnBtnOk()
{
	CUIListBoxItem* item = smart_cast<CUIListBoxItem*>(m_ui_players_list->GetSelected());
	if (item)
	{
		string512 command;	
		switch (mode)
		{
			case MODE_KICK:
                xr_sprintf(command, "cl_votestart kick %s", item->GetText());
				break;
			case MODE_BAN:
				{
					xr_sprintf(command, "cl_votestart ban %s %d", item->GetText(), m_spin_ban_sec->Value());
				}break;
		}
		Console->Execute			(command);
		HideDialog					();
	}
	else
		return;
}
Пример #29
0
void HideColorDialog(UIColorDialog* dialog, gboolean apply)
{
	if( apply )
	{
		dialog->cyan_balance    = (int)dialog->cyan_adjust->value; 
		dialog->magenta_balance = (int)dialog->magenta_adjust->value; 
		dialog->yellow_balance  = (int)dialog->yellow_adjust->value; 
		dialog->black_balance   = (int)dialog->black_adjust->value; 
		dialog->density_balance = (int)dialog->density_adjust->value; 

		dialog->vivid
			= GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window,
					"color_dialog_vivid_button"))->active;

		dialog->color_correct = GetColorCorrectCombo(dialog);

		if( dialog->gamma_list == NULL )
		{
			dialog->gamma
				 = GetTextArrayValueFromCombo(UI_DIALOG(dialog)->window,
					 "color_dialog_gamma_combo", gamma_key, gamma_value);
		}
		else
		{
			dialog->gamma = GetCurrentnValue(CNCL_INPUT_GAMMA);
		}
	}
	else
	{
		if( dialog->gamma_list )
		{
			// Recover parameters.
			UpdateMenuLink(CNCL_INPUT_GAMMA, dialog->gamma);
		}
	}

	HideDialog((UIDialog*)dialog);
}
Пример #30
0
void DisplayVariableDlg::OnCheckMousePosTimer(wxTimerEvent& e)
{
    if ( m_editDlgIsUp ) {
        return;
    }

    wxRect rect = GetScreenRect().Inflate(20, 30);

    wxPoint pt = ::wxGetMousePosition();
    bool mouseLeftWidow = !rect.Contains( pt );
    if(mouseLeftWidow) {

        wxMouseState state = wxGetMouseState();
        // This is to fix a 'MouseCapture' bug on Linux while leaving the mouse Window
        // and mouse button is clicked and scrolling the scrollbar (H or Vertical)
        // The UI hangs
        if (state.LeftIsDown()) {
            // Don't Hide, just restart the timer
            return;
        }

        HideDialog();
    }
}