Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: 20231027 #5868

Merged
merged 16 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { AnalyticsKernelServiceDefinition } from 'shared/protocol/decentraland/r
import { getPerformanceInfo } from 'shared/session/getPerformanceInfo'
import { getUnityInstance } from 'unity-interface/IUnityInterface'
import { trackEvent } from 'shared/analytics/trackEvent'
import { setDelightedSurveyEnabled } from 'unity-interface/delightedSurvey'
import { browserInterface } from 'unity-interface/BrowserInterface'

type UnityEvent = any
Expand Down Expand Up @@ -34,10 +33,6 @@ export function registerAnalyticsKernelService(port: RpcServerPort<RendererProto
trackEvent('performance report', perfReport)
return {}
},
async setDelightedSurveyEnabled(req, _) {
setDelightedSurveyEnabled(req.enabled)
return {}
},
async systemInfoReport(req, _) {
trackEvent('system info report', req)

Expand Down
2 changes: 1 addition & 1 deletion browser-interface/packages/shared/renderer/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function* reportRealmChangeToRenderer() {
}
}

async function fetchAndReportRealmsInfo(url: string) {
export async function fetchAndReportRealmsInfo(url: string) {
try {
const response = await fetch(url)
if (response.ok) {
Expand Down
16 changes: 9 additions & 7 deletions browser-interface/packages/unity-interface/BrowserInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { notifyStatusThroughChat } from 'shared/chat'
import { sendMessage } from 'shared/chat/actions'
import { sendPublicChatMessage } from 'shared/comms'
import { changeRealm } from 'shared/dao'
import { getSelectedNetwork } from 'shared/dao/selectors'
import {getExploreRealmsService, getSelectedNetwork} from 'shared/dao/selectors'
import { getERC20Balance } from 'lib/web3/EthereumService'
import { leaveChannel, updateUserData } from 'shared/friends/actions'
import { ensureFriendProfile } from 'shared/friends/ensureFriendProfile'
Expand Down Expand Up @@ -114,12 +114,12 @@ import {
import { receivePositionReport } from 'shared/world/positionThings'
import { TeleportController } from 'shared/world/TeleportController'
import { setAudioStream } from './audioStream'
import { setDelightedSurveyEnabled } from './delightedSurvey'
import { fetchENSOwnerProfile } from './fetchENSOwnerProfile'
import { GIFProcessor } from './gif-processor'
import { getUnityInstance } from './IUnityInterface'
import { encodeParcelPosition } from 'lib/decentraland'
import { Vector2 } from 'shared/protocol/decentraland/common/vectors.gen'
import {fetchAndReportRealmsInfo} from "../shared/renderer/sagas";

declare const globalThis: { gifProcessor?: GIFProcessor; __debug_wearables: any }
export const futures: Record<string, IFuture<any>> = {}
Expand Down Expand Up @@ -762,11 +762,6 @@ export class BrowserInterface {
*/
public UserAcceptedCollectibles(_data: { id: string }) {}

/** @deprecated */
public SetDelightedSurveyEnabled(data: { enabled: boolean }) {
setDelightedSurveyEnabled(data.enabled)
}

public SetScenesLoadRadius(data: { newRadius: number }) {
store.dispatch(setWorldLoadingRadius(Math.max(Math.round(data.newRadius), 1)))
}
Expand Down Expand Up @@ -1077,6 +1072,13 @@ export class BrowserInterface {
)
}

public async FetchRealmsInfo() {
const url = getExploreRealmsService(store.getState());
if (url) {
await fetchAndReportRealmsInfo(url)
}
}

public async UpdateMemoryUsage() {
getUnityInstance().SendMemoryUsageToRenderer()
}
Expand Down
2 changes: 0 additions & 2 deletions browser-interface/packages/unity-interface/UnityInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
WorldPosition
} from 'shared/types'
import { futures } from './BrowserInterface'
import { setDelightedSurveyEnabled } from './delightedSurvey'
import { HotSceneInfo, IUnityInterface, MinimapSceneInfo, setUnityInstance } from './IUnityInterface'
import { nativeMsgBridge } from './nativeMessagesBridge'
import { AboutResponse } from 'shared/protocol/decentraland/renderer/about.gen'
Expand Down Expand Up @@ -530,7 +529,6 @@ export class UnityInterface implements IUnityInterface {
this.SetTutorialEnabled(tutorialConfig)
} else {
this.SetTutorialEnabledForUsersThatAlreadyDidTheTutorial(tutorialConfig)
setDelightedSurveyEnabled(true)
}
}
}
Expand Down
45 changes: 0 additions & 45 deletions browser-interface/packages/unity-interface/delightedSurvey.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,8 @@ message AnalyticsEventRequest {

message AnalyticsEventResponse {}

message DelightedSurveyRequest {
bool enabled = 1;
}

message DelightedSurveyResponse {}

service AnalyticsKernelService {
rpc PerformanceReport(PerformanceReportRequest) returns (PerformanceReportResponse) {}
rpc SystemInfoReport(SystemInfoReportRequest) returns (SystemInfoReportResponse) {}
rpc AnalyticsEvent(AnalyticsEventRequest) returns (AnalyticsEventResponse) {}
rpc SetDelightedSurveyEnabled(DelightedSurveyRequest) returns (DelightedSurveyResponse) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

public class ECSTweenHandler : IECSComponentHandler<PBTween>
{
private readonly IInternalECSComponent<InternalTween> internalTweenComponent;
private readonly IInternalECSComponent<InternalSceneBoundsCheck> sbcInternalComponent;
private readonly Dictionary<EasingFunction, Ease> easingFunctionsMap = new Dictionary<EasingFunction,Ease>()
private static readonly Dictionary<EasingFunction, Ease> easingFunctionsMap = new Dictionary<EasingFunction,Ease>()
{
[EfLinear] = Linear,
[EfEaseinsine] = InSine,
Expand Down Expand Up @@ -49,6 +47,9 @@ public class ECSTweenHandler : IECSComponentHandler<PBTween>
[EfEaseback] = InOutBack
};

private readonly IInternalECSComponent<InternalTween> internalTweenComponent;
private readonly IInternalECSComponent<InternalSceneBoundsCheck> sbcInternalComponent;

public ECSTweenHandler(IInternalECSComponent<InternalTween> internalTweenComponent, IInternalECSComponent<InternalSceneBoundsCheck> sbcInternalComponent)
{
this.internalTweenComponent = internalTweenComponent;
Expand Down Expand Up @@ -144,7 +145,7 @@ public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, PBTwe
internalTweenComponent.PutFor(scene, entity, internalComponentModel);
}

private bool AreSameModels(PBTween modelA, PBTween modelB)
private static bool AreSameModels(PBTween modelA, PBTween modelB)
{
if (modelB == null || modelA == null)
return false;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reference": "GUID:f8afb582bba443878c19a3bf4e7d83c0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,23 @@ public void UpdatePointerBlockingCorrectly()
handler.OnComponentModelUpdated(scene, entity, model);
Assert.AreEqual(PickingMode.Ignore, containerModel.rootElement.pickingMode);
}

[Test]
public void ApplyAutoSizeCorrectly()
{
var model = new PBUiTransform()
{
WidthUnit = YGUnit.YguAuto,
HeightUnit = YGUnit.YguAuto,
PositionType = YGPositionType.YgptAbsolute
};

handler.OnComponentCreated(scene, entity);
handler.OnComponentModelUpdated(scene, entity, model);

var containerModel = internalUiContainer.GetFor(scene, entity).Value.model;
Assert.AreEqual(StyleKeyword.Auto, containerModel.rootElement.style.width.keyword);
Assert.AreEqual(StyleKeyword.Auto, containerModel.rootElement.style.height.keyword);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ private static void SetUpVisualElement(VisualElement element, PBUiTransform mode
// Layout size
if (model.HeightUnit != YGUnit.YguUndefined)
{
element.style.height = new Length(model.Height, GetUnit(model.HeightUnit));
element.style.height = model.HeightUnit == YGUnit.YguAuto ? new StyleLength(StyleKeyword.Auto) : new Length(model.Height, GetUnit(model.HeightUnit));
}
if (model.WidthUnit != YGUnit.YguUndefined)
{
element.style.width = new Length(model.Width, GetUnit(model.WidthUnit));
element.style.width = model.WidthUnit == YGUnit.YguAuto ? new StyleLength(StyleKeyword.Auto) : new Length(model.Width, GetUnit(model.WidthUnit));
}
if (model.MaxWidthUnit != YGUnit.YguUndefined)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static void SetElementDefaultStyle(IStyle elementStyle)
elementStyle.bottom = 0;
elementStyle.width = new StyleLength(StyleKeyword.Auto);
elementStyle.height = new StyleLength(StyleKeyword.Auto);
elementStyle.position = new StyleEnum<Position>(Position.Absolute);
elementStyle.position = new StyleEnum<Position>(Position.Relative);
elementStyle.justifyContent = new StyleEnum<Justify>(Justify.Center);
elementStyle.alignItems = new StyleEnum<Align>(Align.Center);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ internal static void HandleUiWithoutRegisteredPointerEvents(
var unregisteredGroupElement = unregisteredUiPointerEvents[i];
IParcelScene scene = unregisteredGroupElement.scene;
IDCLEntity entity = unregisteredGroupElement.entity;
VisualElement visualElement = unregisteredGroupElement.componentData1.model.rootElement;

// Force pointer blocking
visualElement.pickingMode = PickingMode.Position;

InternalRegisteredUiPointerEvents uiPointerEvents;

// if `InternalPointerEvents` is dirty we delegate the callback setup to "InternalPointerEvents dirty" handler
if (!unregisteredGroupElement.componentData2.model.dirty)
{
VisualElement visualElement = unregisteredGroupElement.componentData1.model.rootElement;
InternalPointerEvents events = unregisteredGroupElement.componentData2.model;
uiPointerEvents = CreateUiPointerEvents(scene, entity, inputResultsComponent, events);
RegisterUiPointerEvents(visualElement, uiPointerEvents);
Expand All @@ -106,16 +109,16 @@ internal static void HandlePointerEventComponentUpdate(
for (int i = 0; i < group.Count; i++)
{
var groupElement = group[i];
VisualElement visualElement = groupElement.componentData1.model.rootElement;

// Force pointer blocking
visualElement.pickingMode = PickingMode.Position;

if (!groupElement.componentData2.model.dirty)
continue;

IParcelScene scene = groupElement.scene;
IDCLEntity entity = groupElement.entity;
VisualElement visualElement = groupElement.componentData1.model.rootElement;

// Force pointer blocking
visualElement.pickingMode = PickingMode.Position;

var registeredEventsData = registeredUiPointerEventsComponent.GetFor(scene, entity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"GUID:5e1778ed041a41f7a0c13abb42ca70b6",
"GUID:933da198fac7c00489424e7b953fe8b1",
"GUID:691ba36162f94224faace1706408a72c",
"GUID:e55bb9116cf54f04a57453fc981dc81d"
"GUID:e55bb9116cf54f04a57453fc981dc81d",
"GUID:cd4c1c51b9a395144a2550a24a6c496c"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down
Loading