Skip to content

Commit

Permalink
#2691 Sidebar cleaned up. Data type no longer shows up for player dea…
Browse files Browse the repository at this point in the history
…th/bloodlust casts
  • Loading branch information
Wotuu committed Jan 30, 2025
1 parent 6717e41 commit 96832a1
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 36 deletions.
4 changes: 4 additions & 0 deletions resources/assets/js/custom/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ const GAME_VERSION_RETAIL = 'retail';
const MOVEMENT_SPEED_DEFAULT = 7;
const MOVEMENT_SPEED_MOUNTED = 14;

const COMBAT_LOG_EVENT_EVENT_TYPE_NPC_DEATH = 'npc_death';
const COMBAT_LOG_EVENT_EVENT_TYPE_PLAYER_DEATH = 'player_death';
const COMBAT_LOG_EVENT_EVENT_TYPE_PLAYER_SPELL = 'player_spell';

// Leaflet constants
const LEAFLET_PANE_MAP = 'mapPane';
const LEAFLET_PANE_TILE = 'tilePane';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ class CommonMapsHeatmapsearchsidebar extends SearchInlineBase {
this._previousSearchParams = null;

this.filters = {
'type': new SearchFilterRadioEventType(this.options.filterEventTypeContainerSelector, this.options.filterEventTypeSelector, this._search.bind(this)),
'type': new SearchFilterRadioEventType(this.options.filterEventTypeContainerSelector, this.options.filterEventTypeSelector, function () {
let $this = $(`${self.options.filterEventTypeSelector}:checked`);

let enabled = $this.val() === COMBAT_LOG_EVENT_EVENT_TYPE_NPC_DEATH;
$(self.options.filterDataTypeContainerSelector).toggle(enabled);
self.filters['dataType'].toggle(enabled);

self._search();
}),
'dataType': new SearchFilterRadioDataType(this.options.filterDataTypeContainerSelector, this.options.filterDataTypeSelector, this._search.bind(this)),
'keyLevel': new SearchFilterKeyLevel(this.options.filterKeyLevelSelector, this._search.bind(this), this.options.keyLevelMin, this.options.keyLevelMax),
'itemLevel': new SearchFilterItemLevel(this.options.filterItemLevelSelector, this._search.bind(this), this.options.itemLevelMin, this.options.itemLevelMax),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ class SearchFilter {
this.selector = selector;
this.onChange = onChange;
this.options = options;
this.enabled = true;
}

activate() {

}

toggle(enabled) {
this.enabled = enabled;
}

isEnabled() {
return this.enabled;
}

getFilterHeaderText() {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class SearchParams {
if (this.filters.hasOwnProperty(name)) {
let filter = this.filters[name];

if (!filter.isEnabled()) {
continue;
}

let paramsOverride = filter.getParamsOverride();
if (paramsOverride !== null && paramsOverride.length !== null) {
for (let key in paramsOverride) {
Expand Down
30 changes: 30 additions & 0 deletions resources/views/common/forms/labelinput.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* @var string $name
* @var string $label
* @var string|null $title
*/
$id = $id ?? null;
$title = $title ?? null;
?>
<div @if($id !== null) id="{{ $id }}" @endif class="form-group">
<div class="row">
<div class="col">
<label for="{{ $name }}">
{{ $label }}
</label>
</div>
@if( $title !== null )
<div class="col-auto">
<i class="fas fa-info-circle pr-2" data-toggle="tooltip" title="{{$title}}"
style="padding-top: 0.75rem !important;"></i>
</div>
@endif
</div>
<div class="row">
<div class="col">
{{ $slot }}
</div>
</div>
</div>
93 changes: 58 additions & 35 deletions resources/views/common/maps/controls/heatmapsearch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ class="route_sidebar top right row no-gutters map_fade_out
</div>

<div class="data_container p-2" data-simplebar>
<div id="heatmap_search_options_container">
<div id="heatmap_search_options_container" class="px-1">
<div class="row">
<div class="col">
<div id="heatmap_search_options_current_filters" class="pl-1">
<div id="heatmap_search_options_current_filters">

</div>
</div>
Expand Down Expand Up @@ -194,13 +194,13 @@ class="filter_event_type_icon">
</div>
</div>

@component('common.search.filter', [
'key' => 'data_type',
'text' => __('view_common.maps.controls.heatmapsearch.data_type'),
'expanded' => $expandedDataType,
@component('common.forms.labelinput', [
'id' => 'filter_data_type_container',
'name' => 'filter_data_type',
'label' => __('view_common.maps.controls.heatmapsearch.data_type'),
'title' => __('view_common.maps.controls.heatmapsearch.data_type_title'),
])
<div id="filter_data_type_container" class="btn-group btn-group-toggle w-100 mb-1"
<div class="btn-group btn-group-toggle w-100 mb-1"
data-toggle="buttons">
<label class="btn btn-secondary">
<input type="radio" name="data_type"
Expand All @@ -218,21 +218,62 @@ class="{{ CombatLogEventDataType::PlayerPosition->value }}"
</div>
@endcomponent

@component('common.search.filter', ['key' => 'key_level', 'text' => __('view_common.maps.controls.heatmapsearch.key_level'), 'expanded' => $expandedKeyLevel])
@component('common.forms.labelinput', [
'name' => 'key_level',
'label' => __('view_common.maps.controls.heatmapsearch.key_level')
])
<input id="filter_key_level" type="text" name="key_level" value="{{ old('key_level') }}"/>
@endcomponent

@component('common.search.filter', ['key' => 'item_level', 'text' => __('view_common.maps.controls.heatmapsearch.item_level'), 'expanded' => $expandedItemLevel])
@component('common.forms.labelinput', [
'name' => 'item_level',
'label' => __('view_common.maps.controls.heatmapsearch.item_level'),
])
<input id="filter_item_level" type="text" name="item_level" value="{{ old('item_level') }}"/>
@endcomponent

@component('common.search.filter', ['key' => 'player_deaths', 'text' => __('view_common.maps.controls.heatmapsearch.player_deaths'), 'expanded' => $expandedPlayerDeaths])
@component('common.forms.labelinput', [
'name' => 'player_deaths',
'label' => __('view_common.maps.controls.heatmapsearch.player_deaths')
])
<input id="filter_player_deaths" type="text" name="player_deaths"
value="{{ old('player_deaths') }}"/>
@endcomponent

@component('common.forms.labelinput', [
'name' => 'duration',
'label' => __('view_common.maps.controls.heatmapsearch.duration'),
])
<input id="filter_duration" type="text" name="duration" value="{{ old('duration') }}"/>
@endcomponent

@component('common.forms.labelinput', [
'name' => 'weekly_affix_groups',
'label' => __('view_common.maps.controls.heatmapsearch.weekly_affix_groups'),
])
<div class="filter_affix">
<div class="row">
<div class="col">
{!!
Form::select(
'filter_weekly_affix_groups[]',
$seasonWeeklyAffixGroups->mapWithKeys(function(WeeklyAffixGroup $seasonWeeklyAffixGroup){
return [$seasonWeeklyAffixGroup->week => $seasonWeeklyAffixGroup->affixGroup->text];
}), [],
['id' => 'filter_weekly_affix_groups',
'name' => 'weekly_affix_groups',
'class' => 'form-control affixselect selectpicker',
'multiple' => 'multiple',
'title' => __('view_common.maps.controls.heatmapsearch.weekly_affix_groups_title')]
)
!!}
</div>
</div>
</div>
@endcomponent

@if($dungeon->gameVersion->has_seasons)
{{-- @component('common.search.filter', ['key' => 'season', 'text' => __('view_common.maps.controls.heatmapsearch.season'), 'expanded' => $expandedAffixWeek])--}}
{{-- @component('common.forms.labelinput', ['key' => 'season', 'text' => __('view_common.maps.controls.heatmapsearch.season'), 'expanded' => $expandedAffixWeek])--}}
{{-- <div class="filter_affix">--}}
{{-- <div class="row">--}}
{{-- <div class="col">--}}
Expand All @@ -248,7 +289,10 @@ class="{{ CombatLogEventDataType::PlayerPosition->value }}"
{{-- </div>--}}
{{-- @endcomponent--}}

@component('common.search.filter', ['key' => 'affixes', 'text' => __('view_common.maps.controls.heatmapsearch.affixes'), 'expanded' => $expandedAffixes])
@component('common.forms.labelinput', [
'name' => 'affixes',
'label' => __('view_common.maps.controls.heatmapsearch.affixes'),
])
<div class="filter_affix">
<?php
$chunkedFeaturedAffixes = $featuredAffixes->chunk($featuredAffixes->count() < 9 ? 4 : (int)($featuredAffixes->count() / 2));
Expand All @@ -257,9 +301,9 @@ class="{{ CombatLogEventDataType::PlayerPosition->value }}"
<div class="row mt-2 pl-2 featured_affixes">
@foreach($affixRow as $affix)
<?php /** @var Affix $affix */ ?>
<div class="col px-xl-1">
<div class="col">
<div
class="select_icon class_icon affix_icon_{{ $affix->image_name }} selectable"
class="select_icon class_icon affix_icon_{{ $affix->image_name }} selectable m-auto"
data-toggle="tooltip" data-id="{{ $affix->affix_id }}"
title="{{ __($affix->description) }}"
style="height: 24px;">
Expand All @@ -272,27 +316,6 @@ class="select_icon class_icon affix_icon_{{ $affix->image_name }} selectable"
@endcomponent
@endif

@component('common.search.filter', ['key' => 'weekly_affix_groups', 'text' => __('view_common.maps.controls.heatmapsearch.weekly_affix_groups'), 'expanded' => $expandedAffixWeek])
<div class="filter_affix">
<div class="row">
<div class="col">
{!! Form::select('filter_weekly_affix_groups[]',
$seasonWeeklyAffixGroups->mapWithKeys(function(WeeklyAffixGroup $seasonWeeklyAffixGroup){
return [$seasonWeeklyAffixGroup->week => $seasonWeeklyAffixGroup->affixGroup->text];
}), [],
['id' => 'filter_weekly_affix_groups',
'class' => 'form-control affixselect selectpicker',
'multiple' => 'multiple',
'title' => __('view_common.maps.controls.heatmapsearch.weekly_affix_groups_title')]) !!}
</div>
</div>
</div>
@endcomponent

@component('common.search.filter', ['key' => 'duration', 'text' => __('view_common.maps.controls.heatmapsearch.duration'), 'expanded' => $expandedDuration])
<input id="filter_duration" type="text" name="duration" value="{{ old('duration') }}"/>
@endcomponent

@if(Auth::check() && Auth::user()->hasRole('admin'))
@component('common.search.filter', ['key' => 'heatoptions', 'text' => __('view_common.maps.controls.heatmapsearch.heat_options'), 'expanded' => true])
<div class="row">
Expand Down

0 comments on commit 96832a1

Please sign in to comment.