Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Sign in to follow this  
Azathoth

Главное меню

Сделал кнопки, прописал их а они не нажимаются.
В чём может быть причина? Кнопки сделал просто через buttonwidget

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
modded class MainMenu
{
	override Widget Init()
	{
		layoutRoot = GetGame().GetWorkspace().CreateWidgets( "MainMenu/gui/layouts/main_menu.layout" );
		
		m_Play1						= ButtonWidget.Cast(layoutRoot.FindAnyWidget( "play1" ));
		m_Play2						= ButtonWidget.Cast(layoutRoot.FindAnyWidget( "play2" ));
		m_CustomizeCharacter		= ButtonWidget.Cast(layoutRoot.FindAnyWidget( "customize_character_panel" ));
		m_SettingsButton			= ButtonWidget.Cast(layoutRoot.FindAnyWidget( "settings_button" ));
		m_Exit						= ButtonWidget.Cast(layoutRoot.FindAnyWidget( "exit_button" ));
		m_Mission					= MissionMainMenu.Cast( GetGame().GetMission() );
		m_LastFocusedButton			= m_Play1;
		m_ScenePC					= m_Mission.GetIntroScenePC();
		
		if( m_ScenePC )
		{
			m_ScenePC.ResetIntroCamera();
		}
			
		GetGame().GetUIManager().ScreenFadeOut(0);

		SetFocus( null );
		
		Refresh();
		
		GetDayZGame().GetBacklit().MainMenu_OnShow();

		g_Game.SetLoadState( DayZLoadState.MAIN_MENU_CONTROLLER_SELECT );
		
		return layoutRoot;
	}
	
	override bool OnClick( Widget w, int x, int y, int button )
	{
		if( button == MouseState.LEFT )
		{
			if( w == m_Play1 )
			{
				m_LastFocusedButton = m_Play1;
				g_Game.ConnectFromServerBrowser( "127.0.0.1", 2322, "" ); // server 1
				return true;
			}
			else if( w == m_Play2 )
			{
				m_LastFocusedButton = m_Play2;
				g_Game.ConnectFromServerBrowser( "127.0.0.1", 2302, "" ); // server 2
				return true;
			}
			else if ( w == m_CustomizeCharacter )
			{
				OpenMenuCustomizeCharacter();
				return true;
			}
			else if ( w == m_SettingsButton )
			{
				OpenSettings();
				return true;
			}
			else if ( w == m_Exit )
			{
				Exit();
				return true;
			}
		}
		return false;
	}
	
	override bool IsFocusable( Widget w )
	{
		if( w )
		{
			if( w == m_Play1 || w == m_Play2 || w == m_CustomizeCharacter || w == m_SettingsButton || w == m_Exit);
			{
				return true;
			}
		}
		return false;
	}
	
	override void LoadMods()
	{
		return;
	}
	
	/*override void Refresh()
	{		
		if( m_ScenePC )
		{
			OnChangeCharacter();
		}
	}	

	override void OnShow()
	{
		SetFocus( null );
		OnChangeCharacter();
		return;
	}*/
	
	override void Play()
	{
		return;
	}
}

 

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.