Skip to content

Commit 1bc4c08

Browse files
committed
Fix missing quick add list, inability to select server
1 parent 5c26b8c commit 1bc4c08

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

Source/CesiumEditor/Private/CesiumIonServerManager.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ void CesiumIonServerManager::SetCurrentServer(UCesiumIonServer* pServer) {
172172
if (pSettings) {
173173
pSettings->CurrentCesiumIonServer = pServer;
174174
pSettings->Save();
175+
}
176+
177+
if (UCesiumIonServer::GetServerForNewObjects() != pServer) {
175178
UCesiumIonServer::SetServerForNewObjects(pServer);
176179
CurrentServerChanged.Broadcast();
177180
}

Source/CesiumEditor/Private/CesiumIonServerSelector.cpp

+18-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,22 @@
66
#include "Editor.h"
77
#include "PropertyCustomizationHelpers.h"
88

9+
CesiumIonServerSelector::CesiumIonServerSelector() {
10+
FCesiumEditorModule::serverManager().CurrentServerChanged.AddRaw(
11+
this,
12+
&CesiumIonServerSelector::OnCurrentServerChanged);
13+
}
14+
15+
CesiumIonServerSelector::~CesiumIonServerSelector() {
16+
FCesiumEditorModule::serverManager().CurrentServerChanged.RemoveAll(this);
17+
}
18+
919
void CesiumIonServerSelector::Construct(const FArguments& InArgs) {
1020
ChildSlot
1121
[SNew(SHorizontalBox) +
1222
SHorizontalBox::Slot().FillWidth(1.0f).VAlign(
1323
EVerticalAlignment::VAlign_Center)
14-
[SNew(SComboBox<TWeakObjectPtr<UCesiumIonServer>>)
24+
[SAssignNew(_pCombo, SComboBox<TWeakObjectPtr<UCesiumIonServer>>)
1525
.OptionsSource(
1626
&FCesiumEditorModule::serverManager().GetServerList())
1727
.OnGenerateWidget(
@@ -98,3 +108,10 @@ void CesiumIonServerSelector::OnBrowseForServer() {
98108
Objects.Add(FCesiumEditorModule::serverManager().GetCurrentServer());
99109
GEditor->SyncBrowserToObjects(Objects);
100110
}
111+
112+
void CesiumIonServerSelector::OnCurrentServerChanged() {
113+
if (this->_pCombo) {
114+
this->_pCombo->SetSelectedItem(
115+
FCesiumEditorModule::serverManager().GetCurrentServer());
116+
}
117+
}

Source/CesiumEditor/Private/CesiumIonServerSelector.h

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ class CesiumIonServerSelector : public SCompoundWidget {
1111
SLATE_BEGIN_ARGS(CesiumIonServerSelector) {}
1212
SLATE_END_ARGS()
1313

14+
CesiumIonServerSelector();
15+
virtual ~CesiumIonServerSelector();
16+
1417
void Construct(const FArguments& InArgs);
1518

1619
private:
@@ -23,4 +26,7 @@ class CesiumIonServerSelector : public SCompoundWidget {
2326
TWeakObjectPtr<UCesiumIonServer> InItem,
2427
ESelectInfo::Type InSeletionInfo);
2528
void OnBrowseForServer();
29+
void OnCurrentServerChanged();
30+
31+
TSharedPtr<SComboBox<TWeakObjectPtr<UCesiumIonServer>>> _pCombo;
2632
};

Source/CesiumEditor/Private/CesiumPanel.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ void CesiumPanel::OnServerChanged() {
130130
UCesiumIonServer* pNewServer =
131131
FCesiumEditorModule::serverManager().GetCurrentServer();
132132
this->Subscribe(pNewServer);
133+
134+
std::shared_ptr<CesiumIonSession> pSession =
135+
FCesiumEditorModule::serverManager().GetCurrentSession();
136+
if (pSession) {
137+
pSession->refreshDefaultsIfNeeded();
138+
}
133139
this->Refresh();
134140
}
135141

0 commit comments

Comments
 (0)