File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
Source/CesiumRuntime/Private Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -174,18 +174,17 @@ void ACesiumCreditSystem::Tick(float DeltaTime) {
174174 CreditsUpdated =
175175 creditsToShowThisFrame.size () != _lastCreditsCount ||
176176 _pCreditSystem->getCreditsToNoLongerShowThisFrame ().size () > 0 ;
177+
177178 if (CreditsUpdated) {
178179 FString OnScreenCredits;
179180 FString Credits;
180181
181182 _lastCreditsCount = creditsToShowThisFrame.size ();
182183
183- bool first = true ;
184+ bool firstCreditOnScreen = true ;
184185 for (int i = 0 ; i < creditsToShowThisFrame.size (); i++) {
185186 const Cesium3DTilesSelection::Credit& credit = creditsToShowThisFrame[i];
186- if (i != 0 ) {
187- Credits += " \n " ;
188- }
187+
189188 FString CreditRtf;
190189 const std::string& html = _pCreditSystem->getHtml (credit);
191190
@@ -196,17 +195,28 @@ void ACesiumCreditSystem::Tick(float DeltaTime) {
196195 CreditRtf = ConvertHtmlToRtf (html);
197196 _htmlToRtf.insert ({html, CreditRtf});
198197 }
199- Credits += CreditRtf;
198+
200199 if (_pCreditSystem->shouldBeShownOnScreen (credit)) {
201- if (first ) {
202- first = false ;
200+ if (firstCreditOnScreen ) {
201+ firstCreditOnScreen = false ;
203202 } else {
204203 OnScreenCredits += TEXT (" \u2022 " );
205204 }
205+
206206 OnScreenCredits += CreditRtf;
207+ } else {
208+ if (i != 0 ) {
209+ Credits += " \n " ;
210+ }
211+
212+ Credits += CreditRtf;
207213 }
208214 }
209- OnScreenCredits += " <credits url=\" popup\" text=\" Data attribution\" />" ;
215+
216+ if (!Credits.IsEmpty ()) {
217+ OnScreenCredits += " <credits url=\" popup\" text=\" Data attribution\" />" ;
218+ }
219+
210220 CreditsWidget->SetCredits (Credits, OnScreenCredits);
211221 }
212222 _pCreditSystem->startNextFrame ();
You can’t perform that action at this time.
0 commit comments