From 751f85dcc9d7f684b481dd1b9a7e0bdc5b0d9477 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 15 Aug 2016 03:14:26 +0200 Subject: [PATCH] some range input fixes --- components/scan.lua | 2 +- tabs/search/frames.lua | 6 ------ util/filter.lua | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/components/scan.lua b/components/scan.lua index 52aa35e..8870546 100644 --- a/components/scan.lua +++ b/components/scan.lua @@ -81,7 +81,7 @@ end function private.scan() m.state.query_index = m.state.query_index and m.state.query_index + 1 or 1 - if m.query() then + if m.query() and (aux.index(m.query.blizzard_query, 'first_page') or 0) <= (aux.index(m.query.blizzard_query, 'last_page') or aux.huge) then if m.query.blizzard_query then m.state.page = m.query.blizzard_query.first_page or 0 else diff --git a/tabs/search/frames.lua b/tabs/search/frames.lua index 37fd757..b423665 100644 --- a/tabs/search/frames.lua +++ b/tabs/search/frames.lua @@ -85,9 +85,6 @@ function private.create_frames() if this:GetText() ~= valid_input then this:SetText(valid_input) end - if (tonumber(m.last_page_input:GetText()) or aux.huge) < (tonumber(this:GetText()) or 1) then - m.last_page_input:SetText(tonumber(this:GetText())) - end if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then this:SetBackdropColor(unpack(aux.gui.color.state.enabled)) else @@ -119,9 +116,6 @@ function private.create_frames() if this:GetText() ~= valid_input then this:SetText(valid_input) end - if (tonumber(m.first_page_input:GetText()) or 1) > (tonumber(this:GetText()) or aux.huge) then - this:SetText(tonumber(this:GetText())) - end if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then this:SetBackdropColor(unpack(aux.gui.color.state.enabled)) else diff --git a/util/filter.lua b/util/filter.lua index 6ed4f64..189f8c4 100644 --- a/util/filter.lua +++ b/util/filter.lua @@ -238,7 +238,7 @@ function private.blizzard_filter_parser() end if not filters.min_level then filter = {'min_level', str} - elseif not filters.max_level and tonumber(str) >= tonumber(filters.min_level) then + elseif not filters.max_level then filter = {'max_level', str} else return nil, 'Erroneous level range modifier'