aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu
Commit message (Collapse)AuthorAge
* ContentDB: Fix ungraceful crash on aliases when list download failsrubenwardy2022-05-03
| | | | Fixes #12267 and fixes #12154
* Fix texture packs not showing as enabled in mainmenurubenwardy2022-04-24
| | | | Fixes #12219
* Fix invalid queued package element and path (#12218)Alex2022-04-24
|
* Use mod names/titles instead of technical names (#12192)olive2022-04-24
|
* Fix typo and update settings filesShadowNinja2022-04-08
|
* Fix spaces generated by settings file generatorShadowNinja2022-04-08
|
* Tune shadow perspective distortion (#12146)x20482022-03-31
| | | | | * Pass perspective distortion parameters as uniforms * Set all perspective bias parameters via ShadowRenderer * Recalibrate perspective distortion and shadow range to render less shadow geometry with the same quality and observed shadow distance
* Store vector metatable in registryJude Melton-Houghton2022-03-29
|
* Fix broken dependency enabling due to missing `enabled` field (#12093)rubenwardy2022-02-24
|
* Apply texture pack main menu textures immediately (#12018)ROllerozxa2022-02-12
|
* Add support for 'seed' in disallow_mapgen_settings (#12023)Wuzzy2022-02-12
|
* Noise params serialization fixupGaël C2022-02-08
|
* Fix types of get_mapgen_setting_noiseparams (#12025)Lars Müller2022-02-04
|
* Revert "Disable dynamic shadows for the 5.5.0 release" (#12032)rubenwardy2022-01-31
|
* Use virtual paths to specify exact mod to enable (#11784)rubenwardy2022-01-30
|
* Update credits for 5.5.0 release (#12001)sfan52022-01-30
|
* Fix Minetest logo when installed system-wideROllerozxa2022-01-30
|
* Disable dynamic shadows for the 5.5.0 releaseSmallJoker2022-01-29
| | | | | | | | | The dynamic shadows are yet not in the desired state to justify the inclusion into version 5.5.0. A stable release is long overdue, hence this allows fixes to continue in 5.6.0-dev to finally release an acceptable version of the dynamic shadows feature. Reverting this commit is highly recommended to proceed in development.
* Main menu: Fix automatic dependency enables on doubleclickSmallJoker2022-01-19
| | | | | When mods were toggled by double-click, the hard dependencies were no longer enabled automatically. However, the 'Enabled' checkbox did still work. This commit restores the behaviour as seen before commit c401a06
* Mainmenu game-related changes (#11887)sfan52022-01-09
| | | | | | | fixes: * Switching between games does not immediately hide creative mode / damage buttons if so specified * World creation menu has a game selection list even though the menu already provides a gamebar * Showing gameid in world list is unnecessary * Choice of mapgen parameters in menu persists between games (and was half-broken)
* Fix URL escaping in content storesfan52021-12-13
|
* Remove unused Direct3D shader error/warning (#11793)ROllerozxa2021-11-26
|
* Allow for Game-Specific Menu Music (#11241)ExeVirus2021-11-22
|
* Move instead of copy during content install if possiblesfan52021-10-07
|
* Move archive extraction in content store to async jobsfan52021-10-07
|
* Add "MINETEST_MOD_PATH" environment variable (#11515)emixa-d2021-10-07
| | | | This adds an environment variable MINETEST_MOD_PATH. When it exists, Minetest will look there for mods in addition to ~/.minetest/mods/.
* Add disable_settings to game.conf to get rid of "Enable Damage"/"Creative ↵Hugues Ross2021-08-12
| | | | | | | | | Mode"/"Host Server" checkboxes (#11524) This adds support for disable_settings to game.conf. In this you can specify a list of settings that should not be visible in the "local game" (or however it is called nowadays) tab. Enable Damage, Creative Mode and Host Server are supported. Co-authored-by: Wuzzy <Wuzzy2@mail.ru> Co-authored-by: Aaron Suen <warr1024@gmail.com> Co-authored-by: rubenwardy <rw@rubenwardy.com>
* ContentDB: Add support for package aliases / renaming (#11484)rubenwardy2021-08-02
|
* ContentDB: Add reason to downloads (#10876)rubenwardy2021-07-27
|
* Fix spurious shadow enablement in mainmenusfan52021-06-30
| | | | fixes #11394
* Strip carriage returns from lines in settingtypes.txt (#11338)William L. DeRieux IV2021-06-21
| | | Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
* Fix some typos in builtin (#11370)Wuzzy2021-06-21
|
* Shadow mapping render pass (#11244)Liso2021-06-06
| | | Co-authored-by: x2048 <codeforsmile@gmail.com>
* Add metatables to lua vectors (#11039)DS2021-06-04
| | | Add backwards-compatible metatable functions for vectors.
* Fix server favorites not saving when client/serverlist/ doesn't exist ↵sfan52021-04-09
| | | | already (#11152)
* Consistent title bar + render information in mainmenu (#10764)SmallJoker2021-03-30
|
* Mainmenu: Improve "Join Game" tab (#11078)sfan52021-03-20
|
* Make pkgmgr handle modpacks containing modpacks properlyElias Fleckenstein2021-03-01
| | | fixes #10550
* pkgmgr: Fix crash when .conf release field is invalidrubenwardy2021-02-28
| | | | Fixes #10942
* Allow toggling of texture pack by double clickingYaman Qalieh2021-02-24
|
* Update credits tab and mailmapsfan52021-02-23
|
* Replace 'minetest.' with 'core.' in builtinrubenwardy2021-02-11
|
* Fix crash in tab_online when cURL is disabledrubenwardy2021-02-09
|
* Use consistent temp folder path (#10892)rubenwardy2021-02-07
|
* ContentDB: Order installed content first (#10864)rubenwardy2021-01-28
|
* Use JSON for favorites, move server list code to Lua (#10085)rubenwardy2021-01-22
| | | Co-authored-by: sfan5 <sfan5@live.de>
* Load system-wide texture packs too (#10791)Zughy2021-01-21
| | | Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
* Local tab: rename 'Configure' to 'Select Mods' (#10779)Zughy2021-01-20
| | | | Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com> Co-authored-by: rubenwardy <rw@rubenwardy.com>
* ContentDB: Ignore content not installed from ContentDBrubenwardy2021-01-16
|
* Sanitize server IP field in mainmenu (#10793)Zughy2021-01-10
|
d::string replace_from = lua_tostring(L, -1); lua_pop(L, 1); lua_rawgeti(L, -1, 2); if(!lua_isstring(L, -1)) return false; std::string replace_to = lua_tostring(L, -1); lua_pop(L, 1); replacements.pairs.push_back( std::make_pair(replace_from, replace_to)); // removes value, keeps key for next iteration lua_pop(L, 1); } return true; } // register_craft({output=item, recipe={{item00,item10},{item01,item11}}) int ModApiCraft::l_register_craft(lua_State *L) { NO_MAP_LOCK_REQUIRED; //infostream<<"register_craft"<<std::endl; luaL_checktype(L, 1, LUA_TTABLE); int table = 1; // Get the writable craft definition manager from the server IWritableCraftDefManager *craftdef = getServer(L)->getWritableCraftDefManager(); std::string type = getstringfield_default(L, table, "type", "shaped"); /* CraftDefinitionShaped */ if(type == "shaped"){ std::string output = getstringfield_default(L, table, "output", ""); if(output == "") throw LuaError("Crafting definition is missing an output"); int width = 0; std::vector<std::string> recipe; lua_getfield(L, table, "recipe"); if(lua_isnil(L, -1)) throw LuaError("Crafting definition is missing a recipe" " (output=\"" + output + "\")"); if(!readCraftRecipeShaped(L, -1, width, recipe)) throw LuaError("Invalid crafting recipe" " (output=\"" + output + "\")"); CraftReplacements replacements; lua_getfield(L, table, "replacements"); if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) throw LuaError("Invalid replacements" " (output=\"" + output + "\")"); } CraftDefinition *def = new CraftDefinitionShaped( output, width, recipe, replacements); craftdef->registerCraft(def, getServer(L)); } /* CraftDefinitionShapeless */ else if(type == "shapeless"){ std::string output = getstringfield_default(L, table, "output", ""); if(output == "") throw LuaError("Crafting definition (shapeless)" " is missing an output"); std::vector<std::string> recipe; lua_getfield(L, table, "recipe"); if(lua_isnil(L, -1)) throw LuaError("Crafting definition (shapeless)" " is missing a recipe" " (output=\"" + output + "\")"); if(!readCraftRecipeShapeless(L, -1, recipe)) throw LuaError("Invalid crafting recipe" " (output=\"" + output + "\")"); CraftReplacements replacements; lua_getfield(L, table, "replacements"); if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) throw LuaError("Invalid replacements" " (output=\"" + output + "\")"); } CraftDefinition *def = new CraftDefinitionShapeless( output, recipe, replacements); craftdef->registerCraft(def, getServer(L)); } /* CraftDefinitionToolRepair */ else if(type == "toolrepair"){ float additional_wear = getfloatfield_default(L, table, "additional_wear", 0.0); CraftDefinition *def = new CraftDefinitionToolRepair( additional_wear); craftdef->registerCraft(def, getServer(L)); } /* CraftDefinitionCooking */ else if(type == "cooking"){ std::string output = getstringfield_default(L, table, "output", ""); if(output == "") throw LuaError("Crafting definition (cooking)" " is missing an output"); std::string recipe = getstringfield_default(L, table, "recipe", ""); if(recipe == "") throw LuaError("Crafting definition (cooking)" " is missing a recipe" " (output=\"" + output + "\")"); float cooktime = getfloatfield_default(L, table, "cooktime", 3.0); CraftReplacements replacements; lua_getfield(L, table, "replacements"); if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) throw LuaError("Invalid replacements" " (cooking output=\"" + output + "\")"); } CraftDefinition *def = new CraftDefinitionCooking( output, recipe, cooktime, replacements); craftdef->registerCraft(def, getServer(L)); } /* CraftDefinitionFuel */ else if(type == "fuel"){ std::string recipe = getstringfield_default(L, table, "recipe", ""); if(recipe == "") throw LuaError("Crafting definition (fuel)" " is missing a recipe"); float burntime = getfloatfield_default(L, table, "burntime", 1.0); CraftReplacements replacements; lua_getfield(L, table, "replacements"); if(!lua_isnil(L, -1)) { if(!readCraftReplacements(L, -1, replacements)) throw LuaError("Invalid replacements" " (fuel recipe=\"" + recipe + "\")"); } CraftDefinition *def = new CraftDefinitionFuel( recipe, burntime, replacements); craftdef->registerCraft(def, getServer(L)); } else { throw LuaError("Unknown crafting definition type: \"" + type + "\""); } lua_pop(L, 1); return 0; /* number of results */ } // get_craft_result(input) int ModApiCraft::l_get_craft_result(lua_State *L) { NO_MAP_LOCK_REQUIRED; int input_i = 1; std::string method_s = getstringfield_default(L, input_i, "method", "normal"); enum CraftMethod method = (CraftMethod)getenumfield(L, input_i, "method", es_CraftMethod, CRAFT_METHOD_NORMAL); int width = 1; lua_getfield(L, input_i, "width"); if(lua_isnumber(L, -1)) width = luaL_checkinteger(L, -1); lua_pop(L, 1); lua_getfield(L, input_i, "items"); std::vector<ItemStack> items = read_items(L, -1,getServer(L)); lua_pop(L, 1); // items IGameDef *gdef = getServer(L); ICraftDefManager *cdef = gdef->cdef(); CraftInput input(method, width, items); CraftOutput output; std::vector<ItemStack> output_replacements; bool got = cdef->getCraftResult(input, output, output_replacements, true, gdef); lua_newtable(L); // output table if (got) { ItemStack item; item.deSerialize(output.item, gdef->idef()); LuaItemStack::create(L, item); lua_setfield(L, -2, "item"); setintfield(L, -1, "time", output.time); push_items(L, output_replacements); lua_setfield(L, -2, "replacements"); } else { LuaItemStack::create(L, ItemStack()); lua_setfield(L, -2, "item"); setintfield(L, -1, "time", 0); lua_newtable(L); lua_setfield(L, -2, "replacements"); } lua_newtable(L); // decremented input table lua_pushstring(L, method_s.c_str()); lua_setfield(L, -2, "method"); lua_pushinteger(L, width); lua_setfield(L, -2, "width"); push_items(L, input.items); lua_setfield(L, -2, "items"); return 2; } void push_craft_recipe(lua_State *L, IGameDef *gdef, const CraftDefinition *recipe, const CraftOutput &tmpout) { CraftInput input = recipe->getInput(tmpout, gdef); CraftOutput output = recipe->getOutput(input, gdef); lua_newtable(L); // items std::vector<ItemStack>::const_iterator iter = input.items.begin(); for (u16 j = 1; iter != input.items.end(); iter++, j++) { if (iter->empty()) continue; lua_pushstring(L, iter->name.c_str()); lua_rawseti(L, -2, j); } lua_setfield(L, -2, "items"); setintfield(L, -1, "width", input.width); switch (input.method) { case CRAFT_METHOD_NORMAL: lua_pushstring(L, "normal"); break; case CRAFT_METHOD_COOKING: lua_pushstring(L, "cooking"); break; case CRAFT_METHOD_FUEL: lua_pushstring(L, "fuel"); break; default: lua_pushstring(L, "unknown"); } lua_setfield(L, -2, "type"); lua_pushstring(L, tmpout.item.c_str()); lua_setfield(L, -2, "output"); } void push_craft_recipes(lua_State *L, IGameDef *gdef, const std::vector<CraftDefinition*> &recipes, const CraftOutput &output) { lua_createtable(L, recipes.size(), 0); if (recipes.empty()) { lua_pushnil(L); return; } std::vector<CraftDefinition*>::const_iterator it = recipes.begin(); for (unsigned i = 0; it != recipes.end(); ++it) { lua_newtable(L); push_craft_recipe(L, gdef, *it, output); lua_rawseti(L, -2, ++i); } } // get_craft_recipe(result item) int ModApiCraft::l_get_craft_recipe(lua_State *L) { NO_MAP_LOCK_REQUIRED; std::string item = luaL_checkstring(L, 1); Server *server = getServer(L); CraftOutput output(item, 0); std::vector<CraftDefinition*> recipes = server->cdef() ->getCraftRecipes(output, server, 1); lua_createtable(L, 1, 0); if (recipes.empty()) { lua_pushnil(L); lua_setfield(L, -2, "items"); setintfield(L, -1, "width", 0); return 1; } push_craft_recipe(L, server, recipes[0], output); return 1; } // get_all_craft_recipes(result item) int ModApiCraft::l_get_all_craft_recipes(lua_State *L) { NO_MAP_LOCK_REQUIRED; std::string item = luaL_checkstring(L, 1); Server *server = getServer(L); CraftOutput output(item, 0); std::vector<CraftDefinition*> recipes = server->cdef() ->getCraftRecipes(output, server); push_craft_recipes(L, server, recipes, output); return 1; } void ModApiCraft::Initialize(lua_State *L, int top) { API_FCT(get_all_craft_recipes); API_FCT(get_craft_recipe); API_FCT(get_craft_result); API_FCT(register_craft); }