Skip to content

Commit

Permalink
Merge pull request #2705 from RaiderIO/development
Browse files Browse the repository at this point in the history
Release v12.0 - M+ Heatmaps are now officially released
  • Loading branch information
Wotuu authored Feb 3, 2025
2 parents 173f576 + 6696edd commit 7d82487
Show file tree
Hide file tree
Showing 20 changed files with 109 additions and 46 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Dungeon/DungeonExploreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function embed(
'itemLevelMin' => $mostRecentSeason?->item_level_min ?? 0,
'itemLevelMax' => $mostRecentSeason?->item_level_max ?? 0,
'playerDeathsMin' => 0,
'playerDeathsMax' => 50,
'playerDeathsMax' => 99,
'seasonWeeklyAffixGroups' => $dungeon->gameVersion->has_seasons ?
$seasonService->getWeeklyAffixGroupsSinceStart($mostRecentSeason, GameServerRegion::getUserOrDefaultRegion()) :
collect(),
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/TagPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function edit(User $user, Tag $tag): bool
/** @var DungeonRoute $dungeonRoute */
$dungeonRoute = $tag->model;

$result = $dungeonRoute->mayUserEdit($user);
$result = $dungeonRoute?->mayUserEdit($user) ?? false;
break;
}
} else {
Expand Down
31 changes: 31 additions & 0 deletions database/seeders/releases/v12.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"id": 275,
"release_changelog_id": 282,
"version": "v12.0",
"title": "M+ Heatmaps are now officially released",
"backup_db": 1,
"silent": 0,
"spotlight": 0,
"released": 0,
"created_at": "2025-02-03T09:34:24+00:00",
"updated_at": "2025-02-03T09:34:24+00:00",
"changelog": {
"id": 282,
"release_id": 275,
"description": "M+ heatmaps are now live! For more info, see https:\/\/raider.io\/events\/raiderio-great-eight-celebration\/day-8",
"changes": [
{
"release_changelog_id": 282,
"release_changelog_category_id": 5,
"ticket_id": 2702,
"change": "When viewing a heatmap, switching floors and then refreshing the heatmap by changing a filter, no longer renders the heatmap for the previous floor on your current floor."
},
{
"release_changelog_id": 282,
"release_changelog_category_id": 13,
"ticket_id": 2692,
"change": "Loading indicator is now moved to the bottom of the screen, along with the display of how many routes the current heatmap is based on."
}
]
}
}
2 changes: 2 additions & 0 deletions lang/en_US/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,4 +466,6 @@
'toggle_spell_visibility_success' => 'Spell visibility toggled successfully',
'toggle_spell_visibility_error' => 'Spell visibility toggle failed',
'week_label' => 'Week',
'loading_label' => 'Loading',
'run_count_label' => 'Showing data from :count runs',
];
4 changes: 0 additions & 4 deletions lang/en_US/view_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@
'bloodlust_alt' => 'Bloodlust',
'data_type_title' => 'Enemy position uses the original position of the enemy that was engaged (powered by Auto-Route Creator), player position uses the position of the player when an enemy was engaged (combat log position).',
'filter' => 'Filter',
'loading' => 'Loading',
'key_level' => 'Key level',
'item_level' => 'Item level',
'player_deaths' => 'Player deaths',
Expand All @@ -348,9 +347,6 @@
'gradient' => 'Gradient',
'pane' => 'Pane',
],
'data' => [
'dungeon_routes' => 'Showing data from :count runs',
],
],
'header' => [
'toggle_navigation' => 'Toggle navigation',
Expand Down
4 changes: 4 additions & 0 deletions resources/assets/css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ html, body, #map, #app, .wrapper {

.snackbar_footer {
max-width: 728px !important;
margin-bottom: 18px !important;
}

.snackbar_footer.ad_loaded {
margin-bottom: 72px !important;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* @property {Boolean} hideOnMove
* @property {String} currentFiltersSelector
* @property {String} loaderSelector
* @property {String} searchResultSelector
* @property {String} searchResultDataDungeonRoutesSelector
*
* @property {String} keyLevelSelector
* @property {Number} keyLevelMin
Expand Down Expand Up @@ -60,9 +58,7 @@
*/
class CommonMapsHeatmapsearchsidebar extends SearchInlineBase {
constructor(options) {
super(new SearchHandlerHeatmap($.extend({}, {
loaderSelector: options.loaderSelector,
}, options)), options);
super(new SearchHandlerHeatmap(options), options);

let self = this;

Expand Down Expand Up @@ -231,11 +227,6 @@ class CommonMapsHeatmapsearchsidebar extends SearchInlineBase {
super._search({
success: function (json) {
getState().getDungeonMap().pluginHeat.setRawLatLngsPerFloor(json.data);
$(self.options.searchResultDataDungeonRoutesSelector).html(
json.run_count
);

$(self.options.searchResultSelector).css('visibility', 'visible');

if (json.hasOwnProperty('url')) {
console.log(json.url);
Expand Down
4 changes: 3 additions & 1 deletion resources/assets/js/custom/inline/common/maps/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ class CommonMapsMap extends InlineCode {
_onSnackbarAdd(snackbarAddEvent) {
console.assert(this instanceof CommonMapsMap, 'this is not a CommonMapsMap', this);

let template = Handlebars.templates['map_controls_snackbar_template'];
let template = Handlebars.templates[
snackbarAddEvent.data.compact ? 'map_controls_snackbar_compact' : 'map_controls_snackbar'
];

$('#snackbar_container').append(
template($.extend({}, getHandlebarsDefaultVariables(), {
Expand Down
13 changes: 11 additions & 2 deletions resources/assets/js/custom/inline/common/search/searchhandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class SearchHandler {
console.assert(searchParams instanceof SearchParams, 'searchParams was not null or a SearchParams', searchParams);

let self = this;
let response = null;

$.ajax($.extend({}, {
type: 'GET',
Expand All @@ -39,7 +40,9 @@ class SearchHandler {
data: searchParams.params,
beforeSend: function () {
self.loading = true;
if (typeof self.options.loaderSelector !== 'undefined') {
if (typeof self.options.loaderFn === 'function') {
self.options.loaderFn(true, null);
} else if (typeof self.options.loaderSelector !== 'undefined') {
$(self.options.loaderSelector).show();
}

Expand All @@ -48,19 +51,25 @@ class SearchHandler {
}
},
success: function (html, textStatus, xhr) {
response = html;

if (options.hasOwnProperty('success')) {
options.success(html, textStatus, xhr);
}
},
complete: function () {
self.loading = false;
if (typeof self.options.loaderSelector !== 'undefined') {
if (typeof self.options.loaderFn === 'function') {
self.options.loaderFn(false, response);
} else if (typeof self.options.loaderSelector !== 'undefined') {
$(self.options.loaderSelector).hide();
}

if (options.hasOwnProperty('complete')) {
options.complete();
}
// Reset just in case
response = null;
}
}, this.getAjaxOptions()));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
class SearchHandlerHeatmap extends SearchHandler {
constructor(options) {
super(options);

let currentSnackbarId = null;
super($.extend({}, {
loaderFn: function (isLoading, json) {
let state = getState();

state.removeSnackbar(currentSnackbarId);

let data = $.extend({}, getHandlebarsDefaultVariables());
let template;
if (isLoading) {
template = Handlebars.templates['map_heatmapsearch_loader'];
} else {
template = Handlebars.templates['map_heatmapsearch_run_count'];
data.run_count = lang.get('messages.run_count_label', {count: json.run_count});
}

currentSnackbarId = getState().addSnackbar(
template(data), {
compact: true
}
);
}
}, options));
}

getSearchUrl() {
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/custom/mapcontext/mapcontext.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class MapContext extends Signalable {
*
* @returns {null}
*/
getFloorId() {
getInitialFloorId() {
return this._options.floorId;
}

Expand Down
4 changes: 2 additions & 2 deletions resources/assets/js/custom/mapplugins/heatplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class HeatPlugin extends MapPlugin {

this.hidden = !enabled;

this._applyLatLngsForFloor(enabled ? getState().getMapContext().getFloorId() : -1, true);
this._applyLatLngsForFloor(enabled ? getState().getCurrentFloor().id : -1, true);
}

/**
Expand All @@ -115,7 +115,7 @@ class HeatPlugin extends MapPlugin {
}
}

this._applyLatLngsForFloor(getState().getMapContext().getFloorId());
this._applyLatLngsForFloor(getState().getCurrentFloor().id);
}

clear() {
Expand Down
3 changes: 2 additions & 1 deletion resources/assets/js/custom/statemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class StateManager extends Signalable {
this.setUnkilledImportantEnemyOpacity(this._map.options.defaultUnkilledImportantEnemyOpacity);
this.setEnemyAggressivenessBorder(this._map.options.defaultEnemyAggressivenessBorder);
this.setMapFacadeStyle(this._map.options.mapFacadeStyle);
this.setFloorId(this.getMapContext().getFloorId());
this.setFloorId(this.getMapContext().getInitialFloorId());

// Change defaults based on the hash if necessary
if (window.location.hash.length > 0) {
Expand Down Expand Up @@ -634,6 +634,7 @@ class StateManager extends Signalable {
this.signal('snackbar:add', {
id: snackbarId,
html: html,
compact: options.hasOwnProperty('compact') ? options.compact : false,
onDomAdded: options.hasOwnProperty('onDomAdded') ? (typeof options.onDomAdded === 'function' ? options.onDomAdded : null) : null
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div id="{{id}}" class="mt-4 p-2 bg-secondary map_fade_out" style="border-radius: 7px;">
{{{ html }}}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div id="{{id}}" class="row mt-2 p-2 map_fade_out" style="border-radius: 7px;">
<div class="col">

</div>
<div class="col-auto bg-secondary">
{{{ html }}}
</div>
<div class="col">

</div>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div id="heatmap_search_loader" class="w-100 text-center">
<h5 class="py-1 m-0">
<i class="fas fa-stroopwafel fa-spin"></i> {{ loading_label }}
</h5>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div id="heatmap_search_run_count" class="w-100 text-center">
<h5 class="py-1 m-0">
{{ run_count }}
</h5>
</div>
19 changes: 1 addition & 18 deletions resources/views/common/maps/controls/heatmapsearch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
'hideOnMove' => $hideOnMove,
'currentFiltersSelector' => '#heatmap_search_options_current_filters',
'loaderSelector' => '#heatmap_search_loader',
'searchResultSelector' => '#heatmap_search_result',
'searchResultDataDungeonRoutesSelector' => '#heatmap_search_result_data_dungeonroutes',
'keyLevelMin' => $keyLevelMin,
'keyLevelMax' => $keyLevelMax,
Expand Down Expand Up @@ -141,12 +139,7 @@ class="route_sidebar top right row no-gutters map_fade_out
<i class='fas fa-cog'></i>
</button>
</div>
<div class="col pl-2 pr-2">
<div id="heatmap_search_loader" class="w-100 text-center">
<h5 class="pt-1">
<i class="fas fa-stroopwafel fa-spin"></i> {{ __('view_common.maps.controls.heatmapsearch.loading') }}
</h5>
</div>
<div class="col">
</div>
<div class="col-auto">
<input id="heatmap_search_toggle" type="checkbox"
Expand Down Expand Up @@ -461,16 +454,6 @@ class="select_icon class_icon affix_icon_{{ $affix->image_name }} selectable m-a
</div>
@endcomponent
@endif

<div class="row">
<div id="heatmap_search_result" class="col" style="visibility: hidden;">
<div class="pl-1">
{!! __('view_common.maps.controls.heatmapsearch.data.dungeon_routes', [
'count' => '<span id="heatmap_search_result_data_dungeonroutes"> </span>',
]) !!}
</div>
</div>
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion resources/views/common/maps/map.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@
{{-- @include('common.thirdparty.adunit', ['id' => 'map_footer', 'type' => 'footer'])--}}
{{-- @endif--}}
{{-- @endif--}}
<footer class="fixed-bottom container p-0 snackbar_footer">
<footer class="fixed-bottom container p-0 snackbar_footer {{ !$adFree && $showAds ? 'ad_loaded' : '' }}">
<div id="snackbar_container">

</div>
Expand Down

0 comments on commit 7d82487

Please sign in to comment.