⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menuslotmanager.cpp

📁 墨香最新私服
💻 CPP
字号:
// MenuSlotManager.cpp: implementation of the CMenuSlotManager class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MenuSlotManager.h"
#include "./Interface/cWindowManager.h"
#include "Ability.h"
#include "AbilityIcon.h"
#include "AbilityInfo.h"
#include "ObjectManager.h"
#include "MenuIcon.h"
#include "MenuSlotDialog.h"
#include "GameIn.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
GLOBALTON(CMenuSlotManager)

CMenuSlotManager::CMenuSlotManager()
{
	m_IconIndexCreator.Init( MAX_ITEMICON_NUM, IG_MENUSLOTITEM_STARTINDEX );
}

CMenuSlotManager::~CMenuSlotManager()
{
	m_IconIndexCreator.Release();
}

void CMenuSlotManager::Init()
{

}

void CMenuSlotManager::Release()
{

}

BOOL CMenuSlotManager::AddMenuIcon( WORD wPage, WORD wPos, cIcon* pSrcIcon )
{
	if( pSrcIcon->GetType() != WT_ABILITYICON )
		return FALSE;

	CAbilityIcon* pAbilIcon = (CAbilityIcon*)pSrcIcon;
	if( pAbilIcon->GetAbilityInfo()->GetUseType() == eAUT_Passive )
		return FALSE;

	//pAbilIcon俊 Slot Position捞 乐栏搁 MoveMenuIcon...
//	GAMEIN->GetMenuSlotDialog()->IsThisAbilityIconInSlot( pAbilIcon->geti)

	CMenuIcon* pMenuIcon = new CMenuIcon;
	pMenuIcon->Init( 0, 0, DEFAULT_ICONSIZE, DEFAULT_ICONSIZE, pAbilIcon->GetBasicImage(), m_IconIndexCreator.GenerateIndex() );
	pMenuIcon->SetAbilityIdx( pAbilIcon->GetAbilityInfo()->GetIdx() );
	
	WINDOWMGR->AddWindow( (cWindow*)pMenuIcon );

	if( GAMEIN->GetMenuSlotDialog()->AddMenuIcon( wPage, wPos, pMenuIcon ) == TRUE )
	{
		return TRUE;
	}
	else
	{
		//父电 酒捞能阑 瘤快磊.
		return FALSE;
	}
}

BOOL CMenuSlotManager::DeleteMenuIcon( CMenuIcon* pMenuIcon )
{
	if( GAMEIN->GetMenuSlotDialog()->DeleteMenuIcon( pMenuIcon ) == TRUE )
	{
		//ablility update		

		pMenuIcon->SetDisable( TRUE );
		pMenuIcon->SetActive( FALSE );
		WINDOWMGR->AddListDestroyWindow( (cWindow*)pMenuIcon );

		return TRUE;
	}
	else
	{
		return FALSE;		
	}
}

BOOL CMenuSlotManager::ExchangeMenuIcon( CMenuIcon* pMenuIcon1, CMenuIcon* pMenuIcon2 )
{
	if( GAMEIN->GetMenuSlotDialog()->ExchangeMenuIcon( pMenuIcon1, pMenuIcon2 ) )
	{
		//abliltiyIcon狼 SlotPos官操扁
		return TRUE;
	}
	else
		return FALSE;
}

BOOL CMenuSlotManager::MoveMenuIcon( WORD wPage, WORD wPos, CMenuIcon* pMenuIcon )
{
	if( GAMEIN->GetMenuSlotDialog()->MoveMenuIcon( wPage, wPos, pMenuIcon ) )
	{
		//abliltiyIcon狼 SlotPos官操扁
		return TRUE;
	}
	else
		return FALSE;
}

BOOL CMenuSlotManager::UseMenuIcon( CMenuIcon* pMenuIcon )
{
	CAbility* pAbility = HERO->GetAbilityGroup()->GetAbility( pMenuIcon->GetAbilityIdx() );

	if( pAbility == NULL )
		return FALSE;	//肋给 殿废 登绢 乐促.

	//焊救.... 辑滚俊辑 茄锅歹 眉农窍绊 乐阑鳖?

	pAbility->Use();

	return TRUE;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -