コード例 #1
0
 void FocusManager::ViewRemoved(View* parent, View* removed)
 {
     if(focused_view_ && focused_view_==removed)
     {
         ClearFocus();
     }
 }
コード例 #2
0
void Screen::SetFocused(Widget *w, bool enableKeyRepeat)
{
	ClearFocus();
	if (enableKeyRepeat)
		SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
	_focusedWidgetOnDelete = w->onDelete.connect(sigc::ptr_fun(&Screen::OnDeleteFocusedWidget));
	focusedWidget = w;
}
コード例 #3
0
void
ContainerWindow::SetFocus()
{
  /* just in case our child window was focused previously, we must
     clear it now */
  ClearFocus();

  Window::SetFocus();
}
コード例 #4
0
void AFournoidAIController::SetEnemy(APawn *InPawn){
	if(BlackboardComp){
		BlackboardComp->SetValue<UBlackboardKeyType_Object>(EnemyKeyID, InPawn);
		if(InPawn!=NULL){
			SetFocus(InPawn);
		}else{
			ClearFocus(EAIFocusPriority::Gameplay);
		}
	}
}
コード例 #5
0
 void FocusManager::ValidateFocusedView()
 {
     if(focused_view_)
     {
         if(!ContainsView(focused_view_))
         {
             ClearFocus();
         }
     }
 }
コード例 #6
0
ファイル: Planet.cpp プロジェクト: cpeosphoros/freeorion
void Planet::Depopulate() {
    PopCenter::Depopulate();

    GetMeter(METER_INDUSTRY)->Reset();
    GetMeter(METER_RESEARCH)->Reset();
    GetMeter(METER_TRADE)->Reset();
    GetMeter(METER_CONSTRUCTION)->Reset();

    ClearFocus();
}
コード例 #7
0
void
ContainerWindow::SetActiveChild(Window &child)
{
  if (active_child == &child)
    return;

  ClearFocus();

  active_child = &child;

  if (parent != NULL)
    parent->SetActiveChild(*this);
}
コード例 #8
0
void AAIController::SetFocalPoint(FVector NewFocus, EAIFocusPriority::Type InPriority)
{
    // clear out existing
    ClearFocus(InPriority);

    // now set new focus
    if (InPriority >= FocusInformation.Priorities.Num())
    {
        FocusInformation.Priorities.SetNum(InPriority + 1);
    }

    FFocusKnowledge::FFocusItem& FocusItem = FocusInformation.Priorities[InPriority];
    FocusItem.Position = NewFocus;
}
コード例 #9
0
// Event when controlled pawn has died
void AMurphysLawAIController::OnKilled(const float TimeToRespawn)
{
	// Disable movement task branch from BT and current Move task
	SetBlackboardCanMove(false);
	StopMovement();

	SetBlackboardTarget(nullptr);

	// Stop looking at target
	// Note :	Calling ClearFocus changes the current rotation.
	//			Saving the rotation avoid instant turn upon death
	const FRotator CurrentRotation = GetPawn()->GetActorRotation();
	ClearFocus(EAIFocusPriority::Gameplay);
	ClearFocus(EAIFocusPriority::Default);
	ClearFocus(EAIFocusPriority::LastFocusPriority);
	ClearFocus(EAIFocusPriority::Move);
	GetPawn()->SetActorRotation(CurrentRotation);

	// Respawn logic
	MyCharacter = Cast<AMurphysLawCharacter>(this->GetPawn());
	UnPossess();
	GetWorldTimerManager().SetTimer(TimerHandle_Respawn, this, &AMurphysLawAIController::Respawn, TimeToRespawn);
}
コード例 #10
0
ファイル: AIController.cpp プロジェクト: Foreven/Unreal4-1
void AAIController::SetFocus(AActor* NewFocus, EAIFocusPriority::Type InPriority)
{
	if (NewFocus)
	{
		if (InPriority >= FocusInformation.Priorities.Num())
		{
			FocusInformation.Priorities.SetNum(InPriority + 1);
		}
		FocusInformation.Priorities[InPriority].Actor = NewFocus;
	}
	else
	{
		ClearFocus(InPriority);
	}
}
コード例 #11
0
void AAIController::SetFocus(AActor* NewFocus, EAIFocusPriority::Type InPriority)
{
    // clear out existing
    ClearFocus(InPriority);

    // now set new
    if (NewFocus)
    {
        if (InPriority >= FocusInformation.Priorities.Num())
        {
            FocusInformation.Priorities.SetNum(InPriority + 1);
        }
        FocusInformation.Priorities[InPriority].Actor = NewFocus;
    }
}
コード例 #12
0
    void FocusManager::RestoreFocusedView()
    {
        ViewStorage* view_storage = ViewStorage::GetSharedInstance();
        if(!view_storage)
        {
            // This should never happen but bug 981648 seems to indicate it could.
            NOTREACHED();
            return;
        }

        View* view = view_storage->RetrieveView(stored_focused_view_storage_id_);
        if(view)
        {
            if(ContainsView(view))
            {
                if(!view->IsFocusableInRootView() &&
                    view->IsAccessibilityFocusableInRootView())
                {
                    // RequestFocus would fail, but we want to restore focus to controls
                    // that had focus in accessibility mode.
                    SetFocusedViewWithReason(view, kReasonFocusRestore);
                }
                else
                {
                    // This usually just sets the focus if this view is focusable, but
                    // let the view override RequestFocus if necessary.
                    view->RequestFocus();

                    // If it succeeded, the reason would be incorrect; set it to
                    // focus restore.
                    if(focused_view_ == view)
                    {
                        focus_change_reason_ = kReasonFocusRestore;
                    }
                }
            }
        }
        else
        {
            // Clearing the focus will focus the root window, so we still get key
            // events.
            ClearFocus();
        }
    }
コード例 #13
0
void ResourceCenter::SetFocus(const std::string& focus) {
    if (focus == m_focus)
        return;
    if (focus.empty()) {
        ClearFocus();
        return;
    }
    std::vector<std::string> avail_foci = AvailableFoci();
    if (std::find(avail_foci.begin(), avail_foci.end(), focus) != avail_foci.end()) {
        m_focus = focus;
        if (m_focus == m_focus_turn_initial)
            m_last_turn_focus_changed = m_last_turn_focus_changed_turn_initial;
        else
            m_last_turn_focus_changed = CurrentTurn();
        ResourceCenterChangedSignal();
        return;
    }
    ErrorLogger() << "ResourceCenter::SetFocus Exploiter!-- unavailable focus " << focus << " attempted to be set for object w/ dump string: " << Dump();
}
コード例 #14
0
    void FocusManager::StoreFocusedView()
    {
        ViewStorage* view_storage = ViewStorage::GetSharedInstance();
        if(!view_storage)
        {
            // This should never happen but bug 981648 seems to indicate it could.
            NOTREACHED();
            return;
        }

        // TODO (jcampan): when a TabContents containing a popup is closed, the focus
        // is stored twice causing an assert. We should find a better alternative than
        // removing the view from the storage explicitly.
        view_storage->RemoveView(stored_focused_view_storage_id_);

        if(!focused_view_)
        {
            return;
        }

        view_storage->StoreView(stored_focused_view_storage_id_, focused_view_);

        View* v = focused_view_;

        {
            // Temporarily disable notification.  ClearFocus() will set the focus to the
            // main browser window.  This extra focus bounce which happens during
            // deactivation can confuse registered WidgetFocusListeners, as the focus
            // is not changing due to a user-initiated event.
            AutoNativeNotificationDisabler local_notification_disabler;
            ClearFocus();
        }

        if(v)
        {
            v->SchedulePaint(); // Remove focus border.
        }
    }
コード例 #15
0
void KeyboardFocusManager::OnTouched(const TouchEvent& touchEvent)
{
  // Clear the focus when user touch the screen
  ClearFocus();
}
コード例 #16
0
ファイル: AIController.cpp プロジェクト: Foreven/Unreal4-1
void AAIController::K2_ClearFocus()
{
	ClearFocus(EAIFocusPriority::Gameplay);
}
コード例 #17
0
void Screen::SetFocused(Widget *w, bool enableKeyRepeat)
{
	ClearFocus();
	_focusedWidgetOnDelete = w->onDelete.connect(sigc::ptr_fun(&Screen::OnDeleteFocusedWidget));
	focusedWidget = w;
}