Skip to content

Commit 4f14d8b

Browse files
committed
clean IsHoverEnabled, include worlds on favorites & warning reduction
1 parent 2253d88 commit 4f14d8b

6 files changed

Lines changed: 17 additions & 7 deletions

File tree

Explorer/Assets/DCL/Navmap/PlaceInfoPanelController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public void Set(PlacesData.PlaceInfo place)
187187
thumbnailImage.RequestImage(place.image);
188188
view.PlaceNameLabel.text = place.title;
189189
view.CreatorNameLabel.text = $"created by <b>{place.contact_name}</b>";
190-
view.LikeRateLabel.text = $"{(place.like_rate_as_float ?? 0) * 100:F0}%";
190+
view.LikeRateLabel.text = $"{(place.LikeRateAsFloat ?? 0) * 100:F0}%";
191191
view.PlayerCountLabel.text = place.user_count.ToString();
192192
view.DescriptionLabel.text = string.IsNullOrEmpty(place.description) ? "No description" : place.description;
193193
view.DescriptionLabel.ConvertUrlsToClickeableLinks(OpenUrl);

Explorer/Assets/DCL/Navmap/SearchForPlaceAndShowResultsCommand.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using DCL.PlacesAPIService;
44
using System.Collections.Generic;
55
using System.Threading;
6-
using UnityEngine;
76
using UnityEngine.Pool;
87

98
namespace DCL.Navmap
@@ -124,8 +123,7 @@ private async UniTask ProcessPlacesAsync(CancellationToken ct)
124123
ct,
125124
pageNumber: @params.page, pageSize: @params.pageSize,
126125
sortByBy: sort, sortDirection: sortDirection,
127-
onlySdk7: true,
128-
onlyPlaces: true);
126+
onlySdk7: true);
129127
places.AddRange(response.Data);
130128
totalResultCount = response.Total;
131129
}

Explorer/Assets/DCL/Navmap/SearchResultPanelController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public void ClearResults()
5454
{
5555
foreach ((string _, PlaceElementView fullSearchResultsView) in usedPoolElements)
5656
{
57+
fullSearchResultsView.IsHoverEnabled = true;
5758
fullSearchResultsView.resultButton.onClick.RemoveAllListeners();
5859
fullSearchResultsView.resultAnimator.Rebind();
5960
fullSearchResultsView.resultAnimator.Update(0f);

Explorer/Assets/DCL/Places/PlaceCardView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public void Configure(PlaceInfo placeInfo, string ownerName, bool userOwnsPlace,
159159
int onlineMembers = placeInfo.connected_addresses?.Length ?? placeInfo.user_count;
160160
onlineMembersText.text = $"{onlineMembers}";
161161
onlineMembersContainer.SetActive(onlineMembers > 0);
162-
likeRateText.text = $"{(placeInfo.like_rate_as_float ?? 0) * 100:F0}%";
162+
likeRateText.text = $"{(placeInfo.LikeRateAsFloat ?? 0) * 100:F0}%";
163163
placeCoordsText.text = string.IsNullOrWhiteSpace(placeInfo.world_name) ? placeInfo.base_position : placeInfo.world_name;
164164
featuredTag.SetActive(placeInfo.highlighted);
165165

Explorer/Assets/DCL/Places/PlaceDetailPanelView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void ConfigurePlaceData(
190190
creatorNameText.gameObject.SetActive(!string.IsNullOrEmpty(placeInfo.contact_name));
191191
creatorWalletText.text = !string.IsNullOrEmpty(placeInfo.owner) && placeInfo.owner.Length >= 10 ? $"{placeInfo.owner[..5]}...{placeInfo.owner[^5..]}" : "Unknown";
192192
creatorWalletText.gameObject.SetActive(string.IsNullOrEmpty(placeInfo.contact_name));
193-
likeRateText.text = $"{(placeInfo.like_rate_as_float ?? 0) * 100:F0}%";
193+
likeRateText.text = $"{(placeInfo.LikeRateAsFloat ?? 0) * 100:F0}%";
194194
visitsText.text = UIUtils.NumberToCompactString(placeInfo.user_visits);
195195
SilentlySetLikeToggle(placeInfo.user_like);
196196
SilentlySetDislikeToggle(placeInfo.user_dislike);

Explorer/Assets/DCL/PlacesAPIService/PlacesAPIResponse.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class PlaceInfo : ISerializationCallbackReceiver
2525
{
2626
private const string EMPTY_PLACE_ID = "fake_id";
2727

28+
// ReSharper disable InconsistentNaming
2829
public string id;
2930
public string title;
3031
public string description;
@@ -67,6 +68,8 @@ public class PlaceInfo : ISerializationCallbackReceiver
6768

6869
[SerializeField] private string[] positions;
6970

71+
// ReSharper restore InconsistentNaming
72+
7073
public bool IsEmptyPlace => id == EMPTY_PLACE_ID;
7174

7275
[JsonIgnore]
@@ -122,7 +125,7 @@ public PlaceInfo(Vector2Int position)
122125
}
123126

124127
[JsonIgnore]
125-
public float? like_rate_as_float
128+
public float? LikeRateAsFloat
126129
{
127130
get
128131
{
@@ -173,22 +176,26 @@ public void OnAfterDeserialize()
173176
[Serializable]
174177
public class Realm
175178
{
179+
// ReSharper disable InconsistentNaming
176180
public string serverName;
177181
public string layer;
178182
public string url;
179183
public int usersCount;
180184
public int maxUsers;
181185
public Vector2Int[] userParcels;
186+
// ReSharper restore InconsistentNaming
182187
}
183188
}
184189

185190
// TODO: This class should be moved to the PlacesAPIService folder
186191
[Serializable]
187192
public class PlacesAPIResponse : PaginatedResponse, IPlacesAPIResponse
188193
{
194+
// ReSharper disable InconsistentNaming
189195
public bool ok;
190196
public int total;
191197
public List<PlaceInfo> data;
198+
// ReSharper restore InconsistentNaming
192199

193200
int IPlacesAPIResponse.Total => total;
194201
IReadOnlyList<PlaceInfo> IPlacesAPIResponse.Data => data;
@@ -213,16 +220,20 @@ public interface IPlacesAPIResponse : IDisposable
213220
[Serializable]
214221
public class PlacesAPIGetParcelResponse
215222
{
223+
// ReSharper disable InconsistentNaming
216224
public bool ok;
217225
public PlaceInfo data;
226+
// ReSharper restore InconsistentNaming
218227
}
219228

220229
}
221230

222231
[Serializable]
223232
public class OptimizedPlaceInMapResponse
224233
{
234+
// ReSharper disable InconsistentNaming
225235
public Vector2Int base_position;
226236
public string name;
237+
// ReSharper restore InconsistentNaming
227238
}
228239
}

0 commit comments

Comments
 (0)