示例#1
0
void CGoods::EnchaseAttrRemove(CPlayer* pPlayer,CGoods* pCard)
{	
	vector<CGoods::tagAddonProperty>::iterator tagCardIter=pCard->GetAddonProperties()->begin();
	CGoodsBaseProperties* pEquipBaseProperty=GoodsSetup::QueryGoodsBaseProperties(m_dwBasePropertiesIndex);
	for(;tagCardIter!=pCard->GetAddonProperties()->end();tagCardIter++)
	{				
		//装备上是否有该属性
		if(tagCardIter->gapType==GAP_PARTICULAR_ATTRIBUTE)
			continue;
		if(tagCardIter->gapType==GAP_MIN_REINFORCE_LEVEL || 
			tagCardIter->gapType==GAP_MAX_REINFORCE_LEVEL)
			continue;
		if(tagCardIter->gapType==GAP_COLOR)
			continue;
		if(tagCardIter->gapType==GAP_QUALITY)
			continue;
		

		bool bExist=HasAddonProperty(tagCardIter->gapType);		
		if(bExist)
		{
			//已经有该属性,直接更新
			ChangeAttribute(tagCardIter->gapType,-(tagCardIter->lValues[0]),1);
		}		
	}
	UpdateAttribute(pPlayer->GetExID());
}
示例#2
0
void
nsSliderFrame::SetCurrentPositionInternal(nsIContent* aScrollbar, PRInt32 aNewPos,
                                          PRBool aIsSmooth,
                                          PRBool aImmediateRedraw)
{
  nsCOMPtr<nsIContent> scrollbar = aScrollbar;
  nsIBox* scrollbarBox = GetScrollbar();

  mUserChanged = PR_TRUE;

  nsIScrollbarFrame* scrollbarFrame = do_QueryFrame(scrollbarBox);
  if (scrollbarFrame) {
    // See if we have a mediator.
    nsIScrollbarMediator* mediator = scrollbarFrame->GetScrollbarMediator();
    if (mediator) {
      nsRefPtr<nsPresContext> context = PresContext();
      nsCOMPtr<nsIContent> content = GetContent();
      mediator->PositionChanged(scrollbarFrame, GetCurrentPosition(scrollbar), aNewPos);
      // 'mediator' might be dangling now...
      UpdateAttribute(scrollbar, aNewPos, PR_FALSE, aIsSmooth);
      nsIFrame* frame = content->GetPrimaryFrame();
      if (frame && frame->GetType() == nsGkAtoms::sliderFrame) {
        static_cast<nsSliderFrame*>(frame)->
          CurrentPositionChanged(frame->PresContext(), aImmediateRedraw);
      }
      mUserChanged = PR_FALSE;
      return;
    }
  }

  UpdateAttribute(scrollbar, aNewPos, PR_TRUE, aIsSmooth);
  mUserChanged = PR_FALSE;

#ifdef DEBUG_SLIDER
  printf("Current Pos=%d\n",aNewPos);
#endif

}