diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua index 83b9ba9..af41d45 100644 --- a/tabs/search/filter.lua +++ b/tabs/search/filter.lua @@ -151,8 +151,11 @@ function public.formatted_post_filter(components) component_text = component_text..(tonumber(component[3]) or '') tinsert(stack, component[3]) elseif component[1] == 'filter' then - if component[3] then - component_text = component[3] and component_text..': '..aux.auction_listing.colors.ORANGE..component[3]..FONT_COLOR_CODE_CLOSE or component_text + for _, parameter in {component[3]} do + if aux.filter.filters[component[2]].input_type == 'money' then + parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, nil, true) + end + component_text = component_text..': '..aux.auction_listing.colors.ORANGE..parameter..FONT_COLOR_CODE_CLOSE or component_text end while getn(stack) > 0 and stack[getn(stack)] do local top = tremove(stack) @@ -192,8 +195,8 @@ function private.data_link_click() end function private.remove_component(index) - if m.filter_builder_state.selected == index then - m.filter_builder_state.selected = max(index - 1, min(1, getn(m.post_filter))) + if m.filter_builder_state.selected >= index then + m.filter_builder_state.selected = max(m.filter_builder_state.selected - 1, min(1, getn(m.post_filter))) end m.filter_builder_state[m.post_filter[index]] = nil tremove(m.post_filter, index) diff --git a/util/filter.lua b/util/filter.lua index 25d160e..865ce0e 100644 --- a/util/filter.lua +++ b/util/filter.lua @@ -522,8 +522,11 @@ function public.query_string(components) prettified.append(component[2]..(component[2] ~= 'not' and tonumber(component[3]) or '')) elseif component[1] == 'filter' then prettified.append(component[2]) - if component[3] then - prettified.append(component[3]) + for _, parameter in {component[3]} do + if aux.filter.filters[component[2]].input_type == 'money' then + parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, nil, true) + end + prettified.append(parameter) end end end @@ -559,8 +562,11 @@ function private.prettified_query_string(components) if component[2] ~= 'tooltip' then prettified.append(aux.auction_listing.colors.YELLOW..component[2]..FONT_COLOR_CODE_CLOSE) end - if component[3] then - prettified.append(aux.auction_listing.colors.ORANGE..component[3]..FONT_COLOR_CODE_CLOSE) + for _, parameter in {component[3]} do + if m.filters[component[2]].input_type == 'money' then + parameter = aux.money.to_string(aux.money.from_string(parameter), nil, true, nil, nil, true) + end + prettified.append(aux.auction_listing.colors.ORANGE..parameter..FONT_COLOR_CODE_CLOSE) end end end