Ejemplo n.º 1
0
bool CUIActorMenu::OnItemRButtonClick(CUICellItem* itm)
{
	SetCurrentItem( itm );
	InfoCurItem( NULL );
	ActivatePropertiesBox();
	return false;
}
Ejemplo n.º 2
0
bool CUIActorMenu::OnItemFocusLost(CUICellItem* itm)
{
	if ( itm )
	{
		itm->m_selected = false;
	}
	InfoCurItem( NULL );
	return true;
}
Ejemplo n.º 3
0
void CUIActorMenu::SetCurrentItem(CUICellItem* itm)
{
	m_repair_mode = false;
	m_pCurrentCellItem = itm;
	if ( !itm )
	{
		InfoCurItem( NULL );
	}
	TryHidePropertiesBox();

	if ( m_currMenuMode == mmUpgrade )
	{
		SetupUpgradeItem();
	}
}
Ejemplo n.º 4
0
bool CUIActorMenu::OnItemFocusedUpdate(CUICellItem* itm)
{
	if ( itm )
	{
		itm->m_selected = true;
	}
	VERIFY( m_ItemInfo );
	if ( Device.dwTimeGlobal < itm->FocusReceiveTime() + m_ItemInfo->delay )
	{
		return true; //false
	}
	if ( CUIDragDropListEx::m_drag_item || m_UIPropertiesBox->IsShown() )
	{
		return true;
	}	
	
	InfoCurItem( itm );
	return true;
}
Ejemplo n.º 5
0
bool CUIActorMenu::OnKeyboard(int dik, EUIMessages keyboard_action)
{
/*
	if (UIPropertiesBox.GetVisible())
	{	UIPropertiesBox.OnKeyboard(dik, keyboard_action); }
*/
	InfoCurItem( NULL );
	if ( is_binded(kDROP, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action && CurrentIItem() && !CurrentIItem()->IsQuestItem() )
		{

			SendEvent_Item_Drop		(CurrentIItem(), m_pActorInvOwner->object_id());
			SetCurrentItem			(NULL);
		}
		return true;
	}
	
	if ( is_binded(kSPRINT_TOGGLE, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action )
		{
			OnPressUserKey();
		}
		return true;
	}	
	
	if ( is_binded(kUSE, dik) )
	{
		if ( WINDOW_KEY_PRESSED == keyboard_action )
		{
			GetHolder()->StartStopMenu( this, true );
		}
		return true;
	}	

	if( inherited::OnKeyboard(dik,keyboard_action) )return true;

	return false;
}
Ejemplo n.º 6
0
bool CUIActorMenu::OnItemFocusReceive(CUICellItem* itm)
{
	InfoCurItem( NULL );
	return true;
}
Ejemplo n.º 7
0
bool CUIActorMenu::OnItemDbClick(CUICellItem* itm)
{
	InfoCurItem( NULL );
	CUIDragDropListEx*	old_owner		= itm->OwnerList();
	EDDListType t_old					= GetListType(old_owner);

	switch ( t_old )
	{
		case iActorSlot:
		{
			if ( m_currMenuMode == mmDeadBodySearch )
				ToDeadBodyBag	( itm, false );
			else
				ToBag			( itm, false );
			break;
		}
		case iActorBag:
		{
			if ( m_currMenuMode == mmTrade )
			{
				ToActorTrade( itm, false );
				break;
			}else
			if ( m_currMenuMode == mmDeadBodySearch )
			{
				ToDeadBodyBag( itm, false );
				break;
			}
			if ( TryUseItem( itm ) )
			{
				break;
			}
			if ( TryActiveSlot( itm ) )
			{
				break;
			}
			if ( !ToSlot( itm, false ) )
			{
				if ( !ToBelt( itm, false ) )
				{
					ToSlot( itm, true );
				}
			}
			break;
		}
		case iActorBelt:
		{
			ToBag( itm, false );
			break;
		}
		case iActorTrade:
		{
			ToBag( itm, false );
			break;
		}
		case iPartnerTradeBag:
		{
			ToPartnerTrade( itm, false );
			break;
		}
		case iPartnerTrade:
		{
			ToPartnerTradeBag( itm, false );
			break;
		}
		case iDeadBodyBag:
		{
			ToBag( itm, false );
			break;
		}

	}; //switch 

	UpdateItemsPlace();
	return true;
}
Ejemplo n.º 8
0
bool CUIActorMenu::OnItemDrop(CUICellItem* itm)
{
	InfoCurItem( NULL );
	CUIDragDropListEx*	old_owner		= itm->OwnerList();
	CUIDragDropListEx*	new_owner		= CUIDragDropListEx::m_drag_item->BackList();
	if ( old_owner==new_owner || !old_owner || !new_owner )
	{
		return false;
	}

	EDDListType t_new		= GetListType(new_owner);
	EDDListType t_old		= GetListType(old_owner);
	
	if ( !AllowItemDrops(t_old, t_new) )
	{
		Msg("incorrect action [%d]->[%d]",t_old, t_new);
		return true;
	}
	switch(t_new)
	{
		case iActorSlot:
		{
			if(GetSlotList(CurrentIItem()->GetSlot())==new_owner)
				ToSlot	(itm, true);
		}break;
		case iActorBag:
		{
			ToBag	(itm, true);
		}break;
		case iActorBelt:
		{
			ToBelt	(itm, true);
		}break;
		case iActorTrade:
		{
			ToActorTrade(itm, true);
		}break;
		case iPartnerTrade:
		{
			if(t_old!=iPartnerTradeBag)	
				return false;
			ToPartnerTrade(itm, true);
		}break;
		case iPartnerTradeBag:
		{
			if(t_old!=iPartnerTrade)	
				return false;
			ToPartnerTradeBag(itm, true);
		}break;
		case iDeadBodyBag:
		{
			ToDeadBodyBag(itm, true);
		}break;
#ifdef DRAG_DROP_TRASH
		case iTrashSlot:
		{
			if (CurrentIItem()->IsQuestItem())
				return true;

			SendEvent_Item_Drop(CurrentIItem(), m_pActorInvOwner->object_id());
			SetCurrentItem(NULL);
		}break;
#endif
	};

	OnItemDropped			(CurrentIItem(), new_owner, old_owner);
	
	UpdateItemsPlace();

	return true;
}
Ejemplo n.º 9
0
bool CUIActorMenu::OnItemSelected(CUICellItem* itm)
{
	SetCurrentItem		(itm);
	InfoCurItem			(NULL);
	return				false;
}
Ejemplo n.º 10
0
bool CUIActorMenu::OnItemStartDrag(CUICellItem* itm)
{
	InfoCurItem( NULL );
	return false; //default behaviour
}