diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua index 2152b8a..f585d91 100644 --- a/builtin/mainmenu/dlg_contentstore.lua +++ b/builtin/mainmenu/dlg_contentstore.lua @@ -39,7 +39,7 @@ local screenshot_downloaded = {} local search_string = "" local cur_page = 1 local num_per_page = 5 -local filter_type = 1 +local filter_type = -1 local filter_types_titles = { fgettext("All packages"), fgettext("Games"), @@ -434,6 +434,8 @@ function install_dialog.get_formspec() end function install_dialog.handle_submit(this, fields) + store.filter_packages(search_string) + if fields.cancel then this:delete() return true @@ -713,12 +715,13 @@ function store.filter_packages(query) for k = 1, #keywords do local keyword = keywords[k] - if string.find(package.name:lower(), keyword, 1, true) or - string.find(package.title:lower(), keyword, 1, true) or - string.find(package.author:lower(), keyword, 1, true) or - string.find(package.short_description:lower(), keyword, 1, true) then + if string.find(package.author:lower(), keyword, 1, true) then return true end + + --if string.find(package.name:lower(), keyword, 1, true) or string.find(package.title:lower(), keyword, 1, true) or string.find(package.author:lower(), keyword, 1, true) or string.find(package.short_description:lower(), keyword, 1, true) then + -- return true + --end end return false @@ -736,6 +739,8 @@ end function store.get_formspec(dlgdata) store.update_paths() + + dlgdata.pagemax = math.max(math.ceil(#store.packages / num_per_page), 1) if cur_page > dlgdata.pagemax then cur_page = 1 @@ -899,10 +904,15 @@ function store.get_formspec(dlgdata) formspec[#formspec + 1] = "container_end[]" end + + return table.concat(formspec, "") end function store.handle_submit(this, fields) + + + if fields.search or fields.key_enter_field == "search_string" then search_string = fields.search_string:trim() cur_page = 1 @@ -913,7 +923,7 @@ function store.handle_submit(this, fields) if fields.clear then search_string = "" cur_page = 1 - store.filter_packages("") + store.filter_packages(search_string) return true end diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 0ed271e..1b267fa 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -15,13 +15,13 @@ --with this program; if not, write to the Free Software Foundation, Inc., --51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -mt_color_grey = "#AAAAAA" +mt_color_grey = "#AAAAFF" mt_color_blue = "#6389FF" mt_color_lightblue = "#99CCFF" -mt_color_green = "#72FF63" -mt_color_dark_green = "#25C191" -mt_color_orange = "#FF8800" -mt_color_red = "#FF3300" +mt_color_green = "#7264F3" +mt_color_dark_green = "#25C1F1" +mt_color_orange = "#FF6600" +mt_color_red = "#FF0000" local menupath = core.get_mainmenu_path() local basepath = core.get_builtin_path() @@ -95,7 +95,7 @@ local function init_globals() mm_game_theme.init() -- Create main tabview - local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0}) + --[[local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0}) -- note: size would be 15.5,7.1 in real coordinates mode tv_main:set_autosave_tab(true) @@ -123,11 +123,11 @@ local function init_globals() if game == nil then mm_game_theme.reset() end - end + end]] - ui.set_default("maintab") + --ui.set_default("maintab") check_new_version() - tv_main:show() + --tv_main:show() ui.update() end diff --git a/builtin/mainmenu/tab_about.lua b/builtin/mainmenu/tab_about.lua index c8628c8..06b5ad1 100644 --- a/builtin/mainmenu/tab_about.lua +++ b/builtin/mainmenu/tab_about.lua @@ -20,7 +20,6 @@ local xtreemtest_developers = { "Migdyn (a.k.a. Mike) [XtreemTest founder]", "Looki2000", -"Kacper Kostka ", } local core_developers = { @@ -165,7 +164,7 @@ return { "style[label_button;border=false]" .. "button[0.1,3.4;5.3,0.5;label_button;" .. core.formspec_escape(version.project .. " " .. version.string) .. "]" .. - "button[1.5,4.1;2.5,0.8;homepage;mcl.sovnat.info]" .. + "button[0.5,4.1;4.5,0.8;homepage;mcl.sovnat.info]" .. "scroll_container[5.5,0.1;9.5,6.9;scroll_credits;vertical;" .. tostring(scroll_height / 1000) .. "]" .. credit_fs .. "scroll_container_end[]"..