aboutsummaryrefslogtreecommitdiff
path: root/src/gui
Commit message (Expand)AuthorAge
* Formspec: No spec ID for static text labelsSmallJoker2020-04-11
* Hypertext: Fix hovercolor not working in global tag (#9582)Pierre-Yves Rollo2020-04-05
* Fix cursor still visible after closing formspec while on HyperText (#9583)Pierre-Yves Rollo2020-04-04
* Fix GUI element click-through by changing visibility (#9534)DS2020-03-31
* Hypertext: Fix alignment tags adding unwanted newlines (#9548)Pierre-Yves Rollo2020-03-26
* Add comments for translators (#9510)Wuzzy2020-03-20
* Fix mouse events sent to wrong GUI elements when draggingsfan52020-03-16
* Formspecs: Add starting frame to `animated_image` (#9411)v-rob2020-03-16
* guiHyperText: Fix blinky cursor on link hover (#9392)SmallJoker2020-03-11
* Fix memory leak in GUIHyperText (#9489)DS2020-03-10
* GUIFormSpecMenu: Remove field_close_on_enter warning (#9501)SmallJoker2020-03-10
* GUIHyperText: Fix bug with UTF8 chars in action name + simplify UTF8 stringw ...Jean-Patrick Guerrero2020-03-07
* Add multiple element selection to `style` and `style_type` (#9380)v-rob2020-03-01
* GUIInventoryList: fix dropping items when clicking outside of formspec window...DS2020-02-26
* Refactor Script API's log_deprecatedsfan52020-02-23
* Add animated_image[] formspec element (#9258)Hugues Ross2020-02-15
* Key settings: Clear with escape (#8282)SmallJoker2020-02-14
* Formspec: Create a new class for inventorylists (#9287)DS2020-02-01
* Add 9-slice background support to button formspec elements (#9290)Hugues Ross2020-01-26
* StaticText/EnrichedString: Styling support (#9187)SmallJoker2020-01-22
* Formspec: Don't start a button click when the pointer isn't on top (#9332)Hugues Ross2020-01-22
* Replace stray tab with whitespace in guiFormSpecMenu.cpp (#9317)ANAND2020-01-18
* Make clipping of formspec elements more consistent (#9262)Hugues Ross2020-01-16
* Formspec: change the appeareance of the cursor on fields and co. (#8665)DS2020-01-11
* Formspec: Fix clicking on tooltip-obstructed elements (#9266)DS2020-01-04
* Don't override the FGIMG style property if the image parameter is nullHugues Ross2019-12-16
* Remove the dependency on FGIMG/BGIMG from the hovered/pressed variantsHugues Ross2019-12-16
* StyleSpec: 0-initialize the property_set arrayHugues Ross2019-12-16
* GUIFormSpecMenu: Fix legacy sorting using std::stable_sortSmallJoker2019-12-14
* Fix spaces breaking formspec_version[] tagrubenwardy2019-12-09
* Refactor to centralize GUIButton styling/rendering code (#9090)Hugues Ross2019-12-09
* guiConfirmRegistration: Fix hidden error messageSmallJoker2019-12-09
* Formspec: make bgcolor element less confusing and allow setting fullscreen co...DS2019-12-08
* Fix failing build due to code style errorrubenwardy2019-12-06
* Add scrollbaroptions FormSpec element (#8530)v-rob2019-12-06
* Formspec: Fix priorities for version < 3 (#9121)SmallJoker2019-11-20
* Formspec: draw order and clipping for all elements (#8740)DS2019-11-07
* Android: Fix broken double-tap after 49 days uptimeSmallJoker2019-11-03
* Clean up font caching, fix bitmap fontsSmallJoker2019-11-03
* Formspec: add hypertext elementPierre-Yves Rollo2019-11-03
* Change some rough/inappropriate language in comments (#9061)random-geek2019-10-24
* Formspecs: Reset version number on rebuildSmallJoker2019-10-20
* Add more visual feedback for button states (#8916)Hugues Ross2019-10-12
* Revert "Fix the bgcolor formspec element (#8716)" (#9018)SmallJoker2019-10-06
* Fix warnings in guiButton.hsfan52019-10-05
* label[]: Fix broken colors since 2c9edefSmallJoker2019-09-29
* Fix error message caused by adding new parameter to background (#8922)rubenwardy2019-09-29
* Fix some reference counters (memleak) (#8981)SmallJoker2019-09-24
* Fix the bgcolor formspec element (#8716)DS2019-09-15
* Fix formspec version backup in prepends losing datarubenwardy2019-09-15
an>(core.auth_table) do assert(type(name) == "string") assert(name ~= "") assert(type(stuff) == "table") assert(type(stuff.password) == "string") assert(type(stuff.privileges) == "table") assert(stuff.last_login == nil or type(stuff.last_login) == "number") end local file, errmsg = io.open(core.auth_file_path, 'w+b') if not file then error(core.auth_file_path.." could not be opened for writing: "..errmsg) end for name, stuff in pairs(core.auth_table) do local priv_string = core.privs_to_string(stuff.privileges) local parts = {name, stuff.password, priv_string, stuff.last_login or ""} file:write(table.concat(parts, ":").."\n") end io.close(file) end read_auth_file() core.builtin_auth_handler = { get_auth = function(name) assert(type(name) == "string") -- Figure out what password to use for a new player (singleplayer -- always has an empty password, otherwise use default, which is -- usually empty too) local new_password_hash = "" -- If not in authentication table, return nil if not core.auth_table[name] then return nil end -- Figure out what privileges the player should have. -- Take a copy of the privilege table local privileges = {} for priv, _ in pairs(core.auth_table[name].privileges) do privileges[priv] = true end -- If singleplayer, give all privileges except those marked as give_to_singleplayer = false if core.is_singleplayer() then for priv, def in pairs(core.registered_privileges) do if def.give_to_singleplayer then privileges[priv] = true end end -- For the admin, give everything elseif name == core.setting_get("name") then for priv, def in pairs(core.registered_privileges) do privileges[priv] = true end end -- All done return { password = core.auth_table[name].password, privileges = privileges, -- Is set to nil if unknown last_login = core.auth_table[name].last_login, } end, create_auth = function(name, password) assert(type(name) == "string") assert(type(password) == "string") core.log('info', "Built-in authentication handler adding player '"..name.."'") core.auth_table[name] = { password = password, privileges = core.string_to_privs(core.setting_get("default_privs")), last_login = os.time(), } save_auth_file() end, set_password = function(name, password) assert(type(name) == "string") assert(type(password) == "string") if not core.auth_table[name] then core.builtin_auth_handler.create_auth(name, password) else core.log('info', "Built-in authentication handler setting password of player '"..name.."'") core.auth_table[name].password = password save_auth_file() end return true end, set_privileges = function(name, privileges) assert(type(name) == "string") assert(type(privileges) == "table") if not core.auth_table[name] then core.builtin_auth_handler.create_auth(name, core.get_password_hash(name, core.setting_get("default_password"))) end core.auth_table[name].privileges = privileges core.notify_authentication_modified(name) save_auth_file() end, reload = function() read_auth_file() return true end, record_login = function(name) assert(type(name) == "string") assert(core.auth_table[name]).last_login = os.time() save_auth_file() end, } function core.register_authentication_handler(handler) if core.registered_auth_handler then error("Add-on authentication handler already registered by "..core.registered_auth_handler_modname) end core.registered_auth_handler = handler core.registered_auth_handler_modname = core.get_current_modname() handler.mod_origin = core.registered_auth_handler_modname end function core.get_auth_handler() return core.registered_auth_handler or core.builtin_auth_handler end local function auth_pass(name) return function(...) local auth_handler = core.get_auth_handler() if auth_handler[name] then return auth_handler[name](...) end return false end end core.set_player_password = auth_pass("set_password") core.set_player_privs = auth_pass("set_privileges") core.auth_reload = auth_pass("reload") local record_login = auth_pass("record_login") core.register_on_joinplayer(function(player) record_login(player:get_player_name()) end)