Skip to content

Commit

Permalink
Merge branch 'CesiumGS:main' into ue5-main
Browse files Browse the repository at this point in the history
  • Loading branch information
EzioHelios authored Dec 17, 2023
2 parents def33c9 + 4c614e8 commit 326f5ab
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

### ? - ?
### v2.2.0 - 2023-12-14

##### Breaking Changes :mega:

Expand All @@ -10,6 +10,8 @@

- Added support for multiple Cesium ion servers by creating `CesiumIonServer` data assets.

In addition to the above, this release updates [cesium-native](https://github.com/CesiumGS/cesium-native) from v0.30.0 to v0.31.0. See the [changelog](https://github.com/CesiumGS/cesium-native/blob/main/CHANGES.md) for a complete list of changes in cesium-native.

### v2.1.0 - 2023-12-01

##### Additions :tada:
Expand Down
4 changes: 2 additions & 2 deletions CesiumForUnreal.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 54,
"VersionName": "2.1.0",
"Version": 55,
"VersionName": "2.2.0",
"FriendlyName": "Cesium for Unreal",
"Description": "Unlock the 3D geospatial ecosystem in Unreal Engine with real-world 3D content and a high accuracy full-scale WGS84 globe.",
"Category": "Geospatial",
Expand Down
3 changes: 3 additions & 0 deletions Source/CesiumEditor/Private/CesiumIonServerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ void CesiumIonServerManager::SetCurrentServer(UCesiumIonServer* pServer) {
if (pSettings) {
pSettings->CurrentCesiumIonServer = pServer;
pSettings->Save();
}

if (UCesiumIonServer::GetServerForNewObjects() != pServer) {
UCesiumIonServer::SetServerForNewObjects(pServer);
CurrentServerChanged.Broadcast();
}
Expand Down
19 changes: 18 additions & 1 deletion Source/CesiumEditor/Private/CesiumIonServerSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@
#include "Editor.h"
#include "PropertyCustomizationHelpers.h"

CesiumIonServerSelector::CesiumIonServerSelector() {
FCesiumEditorModule::serverManager().CurrentServerChanged.AddRaw(
this,
&CesiumIonServerSelector::OnCurrentServerChanged);
}

CesiumIonServerSelector::~CesiumIonServerSelector() {
FCesiumEditorModule::serverManager().CurrentServerChanged.RemoveAll(this);
}

void CesiumIonServerSelector::Construct(const FArguments& InArgs) {
ChildSlot
[SNew(SHorizontalBox) +
SHorizontalBox::Slot().FillWidth(1.0f).VAlign(
EVerticalAlignment::VAlign_Center)
[SNew(SComboBox<TWeakObjectPtr<UCesiumIonServer>>)
[SAssignNew(_pCombo, SComboBox<TWeakObjectPtr<UCesiumIonServer>>)
.OptionsSource(
&FCesiumEditorModule::serverManager().GetServerList())
.OnGenerateWidget(
Expand Down Expand Up @@ -98,3 +108,10 @@ void CesiumIonServerSelector::OnBrowseForServer() {
Objects.Add(FCesiumEditorModule::serverManager().GetCurrentServer());
GEditor->SyncBrowserToObjects(Objects);
}

void CesiumIonServerSelector::OnCurrentServerChanged() {
if (this->_pCombo) {
this->_pCombo->SetSelectedItem(
FCesiumEditorModule::serverManager().GetCurrentServer());
}
}
6 changes: 6 additions & 0 deletions Source/CesiumEditor/Private/CesiumIonServerSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class CesiumIonServerSelector : public SCompoundWidget {
SLATE_BEGIN_ARGS(CesiumIonServerSelector) {}
SLATE_END_ARGS()

CesiumIonServerSelector();
virtual ~CesiumIonServerSelector();

void Construct(const FArguments& InArgs);

private:
Expand All @@ -23,4 +26,7 @@ class CesiumIonServerSelector : public SCompoundWidget {
TWeakObjectPtr<UCesiumIonServer> InItem,
ESelectInfo::Type InSeletionInfo);
void OnBrowseForServer();
void OnCurrentServerChanged();

TSharedPtr<SComboBox<TWeakObjectPtr<UCesiumIonServer>>> _pCombo;
};
6 changes: 6 additions & 0 deletions Source/CesiumEditor/Private/CesiumPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ void CesiumPanel::OnServerChanged() {
UCesiumIonServer* pNewServer =
FCesiumEditorModule::serverManager().GetCurrentServer();
this->Subscribe(pNewServer);

std::shared_ptr<CesiumIonSession> pSession =
FCesiumEditorModule::serverManager().GetCurrentSession();
if (pSession) {
pSession->refreshDefaultsIfNeeded();
}
this->Refresh();
}

Expand Down
2 changes: 1 addition & 1 deletion extern/cesium-native
Submodule cesium-native updated 2 files
+1 −1 CHANGES.md
+1 −1 package.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cesium-unreal",
"version": "2.1.0",
"version": "2.2.0",
"description": "Cesium for Unreal",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 326f5ab

Please sign in to comment.