Esempio n. 1
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFPowerup::InputToggle( inputdata_t &inputdata )
{
	if ( m_bDisabled )
	{
		SetDisabled( false );
	}
	else
	{
		SetDisabled( true );
	}
}
Esempio n. 2
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CFuncRespawnFlagZone::InputToggle(inputdata_t &inputdata)
{
	if (m_bDisabled)
	{
		SetDisabled(false);
	}
	else
	{
		SetDisabled(true);
	}
}
Esempio n. 3
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CChangeClassZone::InputToggle( inputdata_t &inputdata )
{
    if ( m_bDisabled )
    {
        SetDisabled( false );
    }
    else
    {
        SetDisabled( true );
    }
}
NS_IMETHODIMP
HTMLStyleElement::SetDisabled(bool aDisabled)
{
  ErrorResult error;
  SetDisabled(aDisabled, error);
  return error.ErrorCode();
}
Esempio n. 5
0
void MainScreen::OnFileSytemDialogCanceled(UIFileSystemDialog *forDialog)
{
    if(forDialog == fsDlgProject)
    {
        SetDisabled(false);
    }
}
Esempio n. 6
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPointCommentaryNode::Spawn( void )
{
	// No model specified?
	char *szModel = (char *)STRING( GetModelName() );
	if (!szModel || !*szModel)
	{
		szModel = "models/extras/info_speech.mdl";
		SetModelName( AllocPooledString(szModel) );
	}

	Precache();
	SetModel( szModel );
	UTIL_SetSize( this, -Vector(16,16,16), Vector(16,16,16) );
	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST );
	AddEffects( EF_NOSHADOW );

	// Setup for animation
	ResetSequence( LookupSequence("idle") );
	SetThink( &CPointCommentaryNode::SpinThink );
	SetNextThink( gpGlobals->curtime + 0.1f ); 

	m_iNodeNumber = 0;
	m_iNodeNumberMax = 0;

	SetDisabled( m_bDisabled );
}
bool
HTMLButtonElement::RestoreState(nsPresState* aState)
{
  if (aState && aState->IsDisabledSet() && !aState->GetDisabled()) {
    SetDisabled(false);
  }

  return false;
}
bool HTMLTextAreaElement::RestoreState(PresState* aState) {
  const PresContentData& state = aState->contentData();

  if (state.type() == PresContentData::TnsString) {
    ErrorResult rv;
    SetValue(state.get_nsString(), rv);
    ENSURE_SUCCESS(rv, false);
  }

  if (aState->disabledSet() && !aState->disabled()) {
    SetDisabled(false, IgnoreErrors());
  }

  return false;
}
Esempio n. 9
0
//-----------------------------------------------------------------------------
// Purpose: Update entity with updated data from the server
//-----------------------------------------------------------------------------
void CShip::OnReceiveServerUpdate( ServerShipUpdateData_t *pUpdateData )
{
	if ( m_bIsServerInstance )
	{
		OutputDebugString( "Should not be receiving server updates on the server itself\n" );
		return;
	}

	SetDisabled( pUpdateData->GetDisabled() );

	SetExploding( pUpdateData->GetExploding() );

	SetPosition( pUpdateData->GetXPosition()*m_pGameEngine->GetViewportWidth(), pUpdateData->GetYPosition()*m_pGameEngine->GetViewportHeight() );
	SetVelocity( pUpdateData->GetXVelocity(), pUpdateData->GetYVelocity() );
	SetAccumulatedRotation( pUpdateData->GetRotation() );


	m_bForwardThrustersActive = pUpdateData->GetForwardThrustersActive();
	m_bReverseThrustersActive = pUpdateData->GetReverseThrustersActive();

	// Update the photon beams
	for ( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i )
	{
		ServerPhotonBeamUpdateData_t *pPhotonUpdate = pUpdateData->AccessPhotonBeamData( i );
		if ( pPhotonUpdate->GetActive() )
		{
			if ( !m_rgPhotonBeams[i] )
			{
				m_rgPhotonBeams[i] = new CPhotonBeam( m_pGameEngine, 
					pPhotonUpdate->GetXPosition(), pPhotonUpdate->GetYPosition(), 
					m_dwShipColor, pPhotonUpdate->GetRotation(), 
					pPhotonUpdate->GetXVelocity(), pPhotonUpdate->GetYVelocity() );
			}
			else
			{
				m_rgPhotonBeams[i]->OnReceiveServerUpdate( pPhotonUpdate );
			}
		}
		else
		{
			if ( m_rgPhotonBeams[i] )
			{
				delete m_rgPhotonBeams[i];
				m_rgPhotonBeams[i] = NULL;
			}
		}
	}
}
Esempio n. 10
0
bool
HTMLTextAreaElement::RestoreState(nsPresState* aState)
{
  nsCOMPtr<nsISupportsString> state
    (do_QueryInterface(aState->GetStateProperty()));
  
  if (state) {
    nsAutoString data;
    state->GetData(data);
    SetValue(data);
  }

  if (aState->IsDisabledSet()) {
    SetDisabled(aState->GetDisabled());
  }

  return false;
}
Esempio n. 11
0
void MainScreen::OnLoadProject()
{
    KeyedArchive* archive = new KeyedArchive();
    archive->SetString("projectPath", projectPath);
    //TODO: different path formats for different OS
    archive->Save("~doc:/uiviewer.archive");
    SafeRelease(archive);
    
    Logger::Debug("MainScreen::OnLoadProject %s", projectPath.c_str());
    FileSystem::ReplaceBundleName(projectPath + "/Data");
    fsDlg->SetCurrentDir(FileSystem::Instance()->SystemPathForFrameworkPath("~res:/")); 
    
    ConvertGraphics(projectPath + "/DataSource");
    
    SetDisabled(false);

    preview->Unload();
    loadUI->SetVisible(true);
    selectHoverModeButton->SetVisible(false);
}
Esempio n. 12
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFPowerup::Spawn( void )
{
	BaseClass::Precache();
	BaseClass::Spawn();

	BaseClass::SetOriginalSpawnOrigin( GetAbsOrigin() );
	BaseClass::SetOriginalSpawnAngles( GetAbsAngles() );

	VPhysicsDestroyObject();
	SetMoveType( MOVETYPE_NONE );
	SetSolidFlags( FSOLID_NOT_SOLID | FSOLID_TRIGGER );

	if ( m_bDisabled )
	{
		SetDisabled( true );
	}

	m_bRespawning = false;

	ResetSequence( LookupSequence("idle") );
}
Esempio n. 13
0
void MainScreen::OnButtonPressed(BaseObject *obj, void *data, void *callerData)
{
    if(obj == loadUI)
    {
        fsDlg->SetOperationType(UIFileSystemDialog::OPERATION_LOAD);
        fsDlg->Show(this);
    }
    if(obj == saveUI)
    {
        fsDlg->SetOperationType(UIFileSystemDialog::OPERATION_SAVE);
        fsDlg->Show(this);
    }
    if(obj == chooseProject)
    {
        SetDisabled(true);
        fsDlgProject->Show(this);
    }
    if(obj == selectHoverModeButton)
    {
        selectHoverModeButton->SetSelected(!selectHoverModeButton->GetSelected());
    }
}
Esempio n. 14
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CChangeClassZone::InputEnable( inputdata_t &inputdata )
{
    SetDisabled( false );
}
Esempio n. 15
0
void Widget::Enable()
{
	SetDisabled(false);
	GetContext()->EnableWidget(this);
}
Esempio n. 16
0
void Widget::Disable()
{
	SetDisabled(true);
	GetContext()->DisableWidget(this);
}
/**
 * Common interface for disabling a motor.
 */
void PWMSpeedController::Disable() { SetDisabled(); }
Esempio n. 18
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CChangeClassZone::InputDisable( inputdata_t &inputdata )
{
    SetDisabled( true );
}
Esempio n. 19
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFPowerup::InputEnable( inputdata_t &inputdata )
{
	SetDisabled( false );
}
Esempio n. 20
0
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CAI_Hint::DisableForSeconds( float flSeconds )
{
	SetDisabled( true );
	SetThink( &CAI_Hint::EnableThink );
	SetNextThink( gpGlobals->curtime + flSeconds );
}
Esempio n. 21
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CFuncRespawnFlagZone::InputDisable(inputdata_t &inputdata)
{
	SetDisabled(true);
}
Esempio n. 22
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CFuncRespawnFlagZone::InputEnable(inputdata_t &inputdata)
{
	SetDisabled(false);
}
Esempio n. 23
0
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CAI_Hint::EnableThink()
{
	SetDisabled( false );
	SetThink( NULL );
}
Esempio n. 24
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPointCommentaryNode::InputDisable( inputdata_t &inputdata )
{
	SetDisabled( true );
}
Esempio n. 25
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPointCommentaryNode::InputEnable( inputdata_t &inputdata )
{
	SetDisabled( false );
}
NS_IMETHODIMP
HTMLLinkElement::SetMozDisabled(bool aDisabled)
{
  SetDisabled(aDisabled);
  return NS_OK;
}
Esempio n. 27
0
ALERROR CExtension::Load (ELoadStates iDesiredState, IXMLParserController *pResolver, bool bNoResources, bool bKeepXML, CString *retsError)

//	Load
//
//	Makes sure that the extension is fully loaded.

	{
	ALERROR error;
	int i;

	switch (m_iLoadState)
		{
		case loadNone:
			{
			*retsError = CONSTLIT("Unable to load.");
			return ERR_FAIL;
			}

		case loadEntities:
		case loadAdventureDesc:
			{
			if (iDesiredState == loadNone || iDesiredState == loadEntities)
				return NOERROR;
			else if (iDesiredState == loadAdventureDesc && m_iLoadState == loadAdventureDesc)
				return NOERROR;

			//	Open the file

			CResourceDb ExtDb(m_sFilespec, true);
			if (error = ExtDb.Open(DFOPEN_FLAG_READ_ONLY, retsError))
				return ERR_FAIL;

			//	Setup

			SDesignLoadCtx Ctx;
			Ctx.sResDb = m_sFilespec;
			Ctx.pResDb = &ExtDb;
			Ctx.bNoVersionCheck = true;	//	Obsolete now
			Ctx.bNoResources = bNoResources;
			Ctx.bKeepXML = bKeepXML;
			Ctx.bLoadAdventureDesc = (iDesiredState == loadAdventureDesc && m_iType == extAdventure);
			Ctx.sErrorFilespec = m_sFilespec;

			//	If this is a registered extension then compute a digest for the
			//	file (so that we can compare against the cloud's digest).
			//	
			//	We need to do this even if we fail later because we don't want to
			//	have to recalc it later.

			if (m_Digest.IsEmpty() && GetFolderType() == folderCollection && IsRegistered())
				{
				if (error = fileCreateDigest(m_sFilespec, &m_Digest))
					{
					*retsError = strPatternSubst(CONSTLIT("Unable to compute digest for: %s."), m_sFilespec);
					return error;
					}
				}

			//	If we've already loaded a root element, then we need to clean up

			if (m_pRootXML)
				CleanUpXML();

			//	Parse the XML file into a structure

			if (error = ExtDb.LoadGameFile(&m_pRootXML, pResolver, retsError))
				{
				//	If we're in debug mode then this is a real error.

				if (g_pUniverse->InDebugMode()
						&& !ExtDb.IsTDB())
					{
					if (retsError) *retsError = strPatternSubst(CONSTLIT("Error parsing %s: %s"), m_sFilespec, *retsError);
					return ERR_FAIL;
					}

				//	Otherwise, we try to continue as if nothing bad had happened, but we
				//	disable the extension.

				else
					{
					SetDisabled((retsError ? *retsError : CONSTLIT("Unable to load")));
					return NOERROR;
					}
				}

			//	Set up context

			Ctx.pExtension = this;

			//	Load all the design elements

			for (i = 0; i < m_pRootXML->GetContentElementCount(); i++)
				{
				CXMLElement *pItem = m_pRootXML->GetContentElement(i);

				if (error = LoadDesignElement(Ctx, pItem))
					{
					if (!bKeepXML)
						{
						delete m_pRootXML;
						m_pRootXML = NULL;
						}

					if (g_pUniverse->InDebugMode()
							&& !ExtDb.IsTDB())
						return ComposeLoadError(Ctx, retsError);

					SetDisabled(Ctx.sError);
					return NOERROR;
					}
				}

			//	Restore

			Ctx.pExtension = NULL;

			//	Done

			m_iLoadState = (m_iType == extAdventure ? iDesiredState : loadComplete);
			if (!bKeepXML)
				{
				delete m_pRootXML;
				m_pRootXML = NULL;
				}

			//	If we get this far and we have no libraries, then include the 
			//	compatibility library.

			if (m_iLoadState == loadComplete)
				AddDefaultLibraryReferences(Ctx);

			//	Debug output

			switch (m_iType)
				{
				case extAdventure:
					if (m_iLoadState == loadAdventureDesc)
						kernelDebugLogMessage("Loaded adventure desc: %s", m_sFilespec);
					else
						kernelDebugLogMessage("Loaded adventure: %s", m_sFilespec);
					break;

				case extExtension:
					kernelDebugLogMessage("Loaded extension: %s", m_sFilespec);
					break;

				case extLibrary:
					kernelDebugLogMessage("Loaded library: %s", m_sFilespec);
					break;
				}

			return NOERROR;
			}

		case loadComplete:
			return NOERROR;

		default:
			ASSERT(false);
			return ERR_FAIL;
		}
	}
Esempio n. 28
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFPowerup::InputDisable( inputdata_t &inputdata )
{
	SetDisabled( true );
}