コード例 #1
0
void ASkillHintActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
    if(SkillLength < MinimalLength)
    {
        SkillLength = MinimalLength;
    }
	UseDirectionSkill = false;
	UseRangeSkill = false;
	switch (SkillType)
	{
	case ESkillHintEnum::DirectionSkill:
	case ESkillHintEnum::DirectionSkill_CanBlock:
	{
		UseDirectionSkill = true;
	}
	break;
	case ESkillHintEnum::RangeSkill:
	{
		UseRangeSkill = true;
	}
	break;
	}
    UpdateLength();
    Super::PostEditChangeProperty(PropertyChangedEvent);
}
コード例 #2
0
void CPage_Node_Lane::OnLvnEndlabeleditGridlistctrlex(NMHDR *pNMHDR, LRESULT *pResult)
{
	NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
	// TODO: 在此添加控件通知处理程序代码
	*pResult = 0;

	POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
	int nSelected = -1;
	int nLinkID,nLaneNo;
	CString strIndex,strLink,strLane,strLaneType,strChange;

	while(pos!=NULL)
	{
		int nSelectedRow = m_ListCtrl.GetNextSelectedItem(pos);
		strIndex = m_ListCtrl.GetItemText (nSelectedRow,0);
		nSelected = atoi(strIndex)-1;
		strLink = m_ListCtrl.GetItemText (nSelectedRow,1);
		strLane = m_ListCtrl.GetItemText (nSelectedRow,4);
		strLaneType = m_ListCtrl.GetItemText (nSelectedRow,5);
		strChange = m_ListCtrl.GetItemText (nSelectedRow,6);
	}
	if ( nSelected >= 0 )
	{
		float fLength;
		if ( _T("Basic") == strLaneType ) fLength = -1.0;
		else fLength = atof(strChange);
		UpdateLength(nSelected,atoi(strLink),atoi(strLane),fLength);
	}
	Invalidate();
}
コード例 #3
0
ファイル: Stroke.cpp プロジェクト: dfelinto/blender
void Stroke::RemoveAllVertices()
{
  vertex_container::iterator it = _Vertices.begin(), itend = _Vertices.end();
  for (; it != itend; ++it)
    delete (*it);
  _Vertices.clear();
  UpdateLength();
}
コード例 #4
0
ファイル: macro_cart.cpp プロジェクト: stgabmp/Rivendell
void MacroCart::deleteMacroData()
{
    QListViewItem *item=rdcart_macro_list->selectedItem();

    if((item==NULL)||(item->text(0).isEmpty())) {
        return;
    }
    DeleteLine(item);
    UpdateLength();
}
コード例 #5
0
ファイル: Stroke.cpp プロジェクト: dfelinto/blender
void Stroke::RemoveVertex(StrokeVertex *iVertex)
{
  vertex_container::iterator it = _Vertices.begin(), itend = _Vertices.end();
  for (; it != itend; ++it) {
    if ((*it) == iVertex) {
      delete iVertex;
      it = _Vertices.erase(it);  // it is now the element just after the erased element
      break;
    }
  }
  UpdateLength();
}
コード例 #6
0
ファイル: macro_cart.cpp プロジェクト: stgabmp/Rivendell
void MacroCart::editMacroData()
{
    QListViewItem *item=rdcart_macro_list->selectedItem();

    if((item==NULL)||(item->text(0).isEmpty())) {
        return;
    }
    unsigned line=item->text(0).toUInt()-1;
    EditMacro *edit=new EditMacro(rdcart_events->command(line),this,"edit");
    if(edit->exec()!=-1) {
        RefreshLine(item);
        UpdateLength();
    }
    delete edit;
}
コード例 #7
0
ファイル: macro_cart.cpp プロジェクト: stgabmp/Rivendell
void MacroCart::pasteMacroData()
{
    QListViewItem *item=rdcart_macro_list->selectedItem();
    unsigned line;

    if(item==NULL) {
        return;
    }
    if(item->text(0).isEmpty()) {
        line=rdcart_events->size();
    }
    else {
        line=item->text(0).toUInt()-1;
    }
    AddLine(line,&rdcart_clipboard);
    UpdateLength();
}
コード例 #8
0
filePos CLogFile::Write(const void* pvSource, filePos iSize, filePos iCount)
{
	CArrayIntAndPointer			apvOverlapping;
	BOOL					bAny;
	filePos					iByteLength;
	CLogFileCommandWrite*	pcWrite;

	if (IsFileModeWritable(meFileMode))
	{
		mbTouched = TRUE;

		iByteLength = iSize * iCount;

		if (miLastWriteOpenIndex == -1)
		{
			bAny = FALSE;
		}
		else
		{
			bAny = FindTouchingWriteCommands(miLastWriteOpenIndex + 1, &apvOverlapping, miPosition, iByteLength, FALSE);
		}

		if (bAny)
		{
			AmalgamateOverlappingWrites(&apvOverlapping, pvSource, miPosition, iByteLength);
			apvOverlapping.Kill();
			miPosition += iByteLength;
		}
		else
		{
			pcWrite = AddWriteCommand(miPosition, (void*)pvSource, iByteLength);
			if (!pcWrite)
			{
				return 0;
			}

			miPosition += iByteLength;
		}
		UpdateLength();
		return iCount;
	}
	else
	{
		return 0;
	}
}
コード例 #9
0
void ASkillHintActor::UpdatePos(FVector PlayerPos, FVector MousePos)
{
    FVector dir = MousePos - PlayerPos;
    dir.Z = 0;
	float len = dir.Size();
	dir.Normalize();
    switch(SkillType)
    {
    case ESkillHintEnum::DirectionSkill:
    case ESkillHintEnum::DirectionSkill_CanBlock:
    {
        SetActorRotation(dir.Rotation());
        SetActorLocation(PlayerPos);
		if (len < MinimalLength)
		{
			len = MinimalLength;
		}
		else if (len > SkillLength)
		{
			len = SkillLength;
		}
        if(!IsFixdLength)
        {
            SkillLength = len;
            SkillPos = MousePos;
        }
    }
    break;
	case ESkillHintEnum::RangeSkill:
	{
		if (len < MinimalCastRadius)
		{
			len = MinimalCastRadius;
		}
		else if (len > SkillCastRadius)
		{
			len = SkillCastRadius;
		}
		FVector pos = dir*len + PlayerPos;
		SetActorLocation(pos);
	}
	break;
    }
    UpdateLength();
}
コード例 #10
0
//----------------------------
bool CCylinder::Update()
{
	// Game pausing can cause dumb time things to happen, so kill the effect in this instance
	if ( mTimeStart > theFxHelper.mTime )
	{
		return false;
	}
		
	UpdateSize();
	UpdateSize2();
	UpdateLength();
	UpdateRGB();
	UpdateAlpha();

	Draw();

	return true;
}
コード例 #11
0
ファイル: macro_cart.cpp プロジェクト: stgabmp/Rivendell
void MacroCart::addMacroData()
{
    QListViewItem *item=rdcart_macro_list->selectedItem();
    RDMacro cmd;
    unsigned line;

    if(item==NULL) {
        return;
    }
    if(item->text(0).isEmpty()) {
        line=rdcart_events->size();
    }
    else {
        line=item->text(0).toUInt()-1;
    }
    EditMacro *edit=new EditMacro(&cmd,this,"edit_macro");
    if(edit->exec()!=-1) {
        AddLine(line,&cmd);
        UpdateLength();
    }
    delete edit;
}
コード例 #12
0
ファイル: Stroke.cpp プロジェクト: dfelinto/blender
void Stroke::InsertVertex(StrokeVertex *iVertex, StrokeInternal::StrokeVertexIterator next)
{
  vertex_container::iterator itnext = next.getIt();
  _Vertices.insert(itnext, iVertex);
  UpdateLength();
}
コード例 #13
0
//----------------------------
bool CTail::Update()
{
	// Game pausing can cause dumb time things to happen, so kill the effect in this instance
	if ( mTimeStart > theFxHelper.mTime )
	{
		return false;
	}
	
	if ( !fx_freeze.integer )
	{
		VectorCopy( mOrigin1, mOldOrigin );
	}

	if ( mFlags & FX_RELATIVE )
	{
		if ( mClientID < 0 || mClientID >= ENTITYNUM_WORLD )
		{
			// the thing we are bolted to is no longer valid, so we may as well just die.
			return false;
		}

		vec3_t	dir, org;
//		vec3_t	right, up;
		vec3_t 	realVel, realAccel;

		// Get our current position and direction
		GetOrigin( mClientID, org );
		GetDir( mClientID, dir );

		vec3_t ang, ax[3];

		vectoangles( dir, ang );
		AngleVectors( ang, ax[0], ax[1], ax[2] );

		VectorMA( org, mOrgOffset[0], ax[0], org );
		VectorMA( org, mOrgOffset[1], ax[1], org );
		VectorMA( org, mOrgOffset[2], ax[2], org );

		// calc the real velocity and accel vectors
		// FIXME: if you want right and up movement in addition to the forward movement, you'll have to convert dir into a set of perp. axes and do some extra work
		VectorScale( ax[0], mVel[0], realVel );
		VectorMA( realVel, mVel[1], ax[1], realVel );
		VectorMA( realVel, mVel[2], ax[2], realVel );

		VectorScale( ax[0], mAccel[0], realAccel );
		VectorMA( realAccel, mAccel[1], ax[1], realAccel );
		VectorMA( realAccel, mAccel[2], ax[2], realAccel );

		// Get our real velocity at the current time, taking into account the effects of acceleration.  NOTE: not sure if this is even 100% correct math-wise
		VectorMA( realVel, (theFxHelper.mTime - mTimeStart) * 0.001f, realAccel, realVel );

		// Now move us to where we should be at the given time
		VectorMA( org, (theFxHelper.mTime - mTimeStart) * 0.001f, realVel, mOrigin1 );

		// Just calc an old point some time in the past, doesn't really matter when
		VectorMA( org, ((theFxHelper.mTime - mTimeStart) - 3) * 0.001f, realVel, mOldOrigin );
	}
	else if (( mTimeStart < theFxHelper.mTime ) && UpdateOrigin() == false )
	{
		// we are marked for death
		return false;
	}

	if ( !Cull() )
	{
		UpdateSize();
		UpdateLength();
		UpdateRGB();
		UpdateAlpha();

		CalcNewEndpoint();

		Draw();
	}

	return true;
}
コード例 #14
0
void ASkillHintActor::SetLength(float len)
{
    SkillLength = len;
    UpdateLength();
}
コード例 #15
0
void ASkillHintActor::PostInitProperties()
{
    Super::PostInitProperties();
    UpdateLength();
}