Time Nick Message 00:01 nekobit Oh hell yeah, managed to get a formspec working now 00:03 MTDiscord nekobit : what is your goal exactly, like what is the problem you're trying to solve? 00:03 nekobit Well, got sidetracked, and wanted to add the Settings menu to the pause menu 00:04 nekobit but to do so, I have to port the current menu to C++, which isn't hard, considering a majority of the lua file is formspec with a bit of core functions sprinkled in (which are literally just barebone wrappers to C++ functions anwyay...) 00:04 MTDiscord That does sound interesting, wouldn't that expose mid rendering changes that would require a restart? Does the engine even support reloading textures? Say if you change the transparency of leaves, wouldn't that break something? 00:05 nekobit I imagine that could be a roadblock, however, if such a thing were to happen i could just say "restart required" given i were lazy, however, I doubt its impossible, I could just reinitialize everything. 00:06 nekobit But whats more important out of this would be the ability to change the fov, merge the keybinds interface and audio interface 00:07 nekobit i think this is worth it though 00:07 MTDiscord If you do add a way to reinitialize everything, did you also add a key bind you can do it without changing settings or going into the menus? 00:07 nekobit like a restart engine keybind or something? 00:08 nekobit dunno what u mean... 00:09 MTDiscord https://cdn.discordapp.com/attachments/747163566800633906/1255313971074830377/Screenshot_20240625-200859_1.png?ex=667cadbd&is=667b5c3d&hm=371663c0136da3e992680001b75760ba7db7af8d575e99601229e9799223d4b5& 00:09 nekobit yeah i figured this is what u meant. I guess so, but I don't think it'd be very useful incase glitches were occuring 00:10 nekobit but adding the settings menu into the pause menu would let me remove the sound and keybinds thing, well, id need to merge the keybinds into the settings, but that would obviously be more consistent 00:11 MTDiscord That's not the use case, it would make texture pack creation easier that you could see what you were doing as you were saving it to disk without reloading the whole client. 00:11 nekobit idk if such a thing is even possible in minetest atm 00:11 nekobit at that point it would just be live mod reloading 00:11 nekobit which is a separate issue at hand 00:11 MTDiscord Feature request? 00:11 nekobit for texture updates that would work (but it depends on if the textures are loaded into memory) 00:11 nekobit what about a Feature request? 00:12 MTDiscord I was implying that once you're finished what you're doing, you just keep doing cool things until you hit the end of the possibility space ?šŸ˜ 00:13 nekobit maybe i can do such a thing, but id prefer to stay away from any engine tomfoolery 00:14 MTDiscord Bur tom-foolery is the reason why you're on an IRC in the first place, your username gave you the NoIRC tag 00:14 MTDiscord I thought you were cool 00:15 nekobit heh 00:15 nekobit i mean, its probably not hard to add a button to do it, i think its possible for sure 00:15 nekobit for now i wanna get this out of the way 00:15 MTDiscord K 00:15 nekobit need to eat thou 00:20 nekobit https://files.catbox.moe/39u2v4.png 02:09 nekobit is there a c++ fmt function anywheer so i can avoid using the dreaded stringstream 02:09 nekobit or like a snprintf function 02:12 MTDiscord std::format 02:13 MTDiscord But we canā€™t use it yet. 02:13 nekobit yeah ik 02:14 nekobit a portable asprintf-like function would work for me though 02:14 MTDiscord A C sprintf type function might work best, although you canā€™t use it to write to a std::string data buffer directly. 02:14 nekobit yes, so im asking if such a function exists in the codebase already 02:15 MTDiscord Ah yeah, thatā€™s clearer now. 02:16 MTDiscord Itā€™d probably be in our string.h header if we had one. Thatā€™s where it should be anyway, unless we have a format.h header but I think we donā€™t. 02:16 MTDiscord To clarify we do have a string.h header. 02:59 nekobit https://files.catbox.moe/65w9eb.png 02:59 nekobit :) 02:59 nekobit All C++ 03:15 nekobit I'll call it quit for the night as i got work, but I think I will be able to get this finished in 2 days (if i focus) 03:27 nekobit https://github.com/minetest/minetest/pull/14781 03:37 MTDiscord seems it would be easier and more sensible to just move the pause menu to lua anyways, and call the settings menu 03:38 MTDiscord iirc didnt you hack the setting menu into the pause menu already @rollerozxa ? 03:47 nekobit wsor4035: Yes, we already talked about that 03:47 nekobit tbh im not rewriting much, so i figured it wouldnt be hard 08:03 MTDiscord yeah moving any of this that's in lua back into C++ is completely the wrong approach, I thought I could steer you in the right direction 08:09 MTDiscord you don't need to rewrite the entire pause menu into lua to make it possible though, but just add a button in the pause menu that calls a lua callback in C++ that you then implement in builtin. but once the politics of always enabling client modding for builtin regardless of what stuck-up server admins think gets sorted out I'd have both a pause menu rewritten in lua as well as a password change dialog waiting to be merged 12:33 nekobit Okay, thankyou gusy. 12:33 nekobit I did not sleep well, so will not w9rk on anything today 13:22 grorp sfan5: can I merge #14772? 13:22 ShadowBot https://github.com/minetest/minetest/issues/14772 -- Make button sprites (scrollbar arrows) DPI-aware by grorp 13:22 sfan5 yews 13:22 sfan5 -w 13:23 grorp nice, merging then 15:08 nekobit rollerozxa, rubenwardy: How exactly would I go about bring Lua to game.cpp? In my past attempt, it would segfault when i attempted to do lua_getglobal 15:09 nekobit game.cpp houses the pause menu and such 15:09 nekobit Ofc, id need a separate lua environment I think, one that exposes more client-side functions 15:09 nekobit but I am not sure how to do this, and I cant find any examples of such besides s_base.cpp (?) 15:10 nekobit rubenwardy 15:10 nekobit idk why thats not pinging 15:11 nekobit The most that game.cpp already does is call a lua function when a modded death screen is displayed, but thats barebones and only works with a precondition 15:23 sfan5 I suggest not doing that, the implications are far too wide 15:25 nekobit sfan5: See the GitHub issue. I was asked to not port my settings in pause to C++ 15:28 nekobit unless youre implying to just remove the c++ and implement pausing client side 15:30 nekobit but then i couldnt use the main menu stuff... 15:31 rubenwardy We want two client side environments - trusted and untrusted. Trusted would contain pause menu settings and always be loaded 15:32 rubenwardy That's the eventual state 15:32 rubenwardy Untrusted would be for SSCSM 15:32 rubenwardy Which doesn't exist yet 15:34 nekobit thats what i was intending by that. 15:35 nekobit i want to expose setting and such in its own lua environment 15:36 nekobit My only issue is, how do i do it? Create a new lua stack in game.cpp? 15:38 nekobit I think itd be a good opportunity to redesign the pause menu anyway. The current one is pretty barebones.. 16:38 [MTMatrix] Start by giving modders the chance to override it 16:38 [MTMatrix] That would be a great feature to have 17:11 nekobit That sounds like a good idea, kinda like sfinv 17:11 nekobit Something to add buttons 17:13 nekobit Actually, overriding isnt a good idea... servers could be ugly and remove the ability to quit or something 17:14 nekobit But adding buttons could work 17:19 pgimeno I'd suggest keeping feature creep to the minimum, lest the PR stays there forever and a day 17:20 nekobit Its cool. Adding buttons is probably all ill do, which isnt necessarily a big feature 17:20 nekobit i.e. a server could add an admin menu or login history 17:41 [MTMatrix] RE "servers could be ugly and remove the ability to quit": that's not engine's responsibility. I can already do pretty nasty stuff without the custom pause menu 17:56 Mantar I think it makes sense to not allow removing (or altering) the exit button 17:57 ROllerozxa you can already destroy the ability to exit through the pause menu by repeatedly sending a formspec on every step or by setting a formspec prepend that will put the entire pause menu in an off-screen formspec container 17:57 Mantar that's rude 17:58 Mantar seems like a misfeature to me 17:59 MTDiscord That's how you perma unban people, make it so they can't leave 17:59 Mantar lol 18:00 Mantar yeah let me reskin the other bits of the pause menu, shuffle buttons around, that's all fine, but the quit button should remain no matter what 18:01 Mantar then if people hate my game at least they don't have the extra irritation of finding what I've turned the quit button into 18:05 MTDiscord If we remove this feature we'll end up in a situation where people are making massive hacks to reimplement it 18:07 Mantar maybe, who all is using it though? 18:07 Mantar I don't think I've seen anything do more than reskin the exit button 18:08 Mantar doubt it'd be even remotely as big a deal than the sneak glitch was 18:08 nekobit ,/qiut 18:09 nekobit whoops 18:11 MTDiscord You can move the menu around to make it fancy like hug the left side of the window 18:12 MTDiscord The quit button is not a major issue. It's super rude to hide it, but there aren't really any comsumer-level OSs that don't offer some kind of "kill the misbehaving application" for stuff that livelocks and doesn't let you quit. We shouldn't be treating it like it's some kind of security risk. 18:12 MTDiscord There's really no need to be able to hide or remove it, but if somebody figures out a way to do so, it's still not the end of the world. 18:13 MTDiscord And not being a dick to the user is the responsibility of game creators / server owners, not necessarily the engine. 18:16 Mantar I don't think anybody's saying it's a security risk, just that it would be totally reasonable to have the quit button be immutable 18:25 nekobit literally why would anyone override the pause menu 18:25 nekobit just let them add buttons, which is likely what they want to do anyway 18:29 Mantar reskinning can be nice, but otherwise yeah, adding buttons is the thing I'd want. I don't see much value in altering the quit button in particular vs the likely nuisance factor it holds 18:30 Mantar on the subject of adding buttons, Exile could also really stand to add extra buttons on the "create new world" page 18:31 nekobit I can only imagine a mod improperly hooking the pause menu to add some extra thing which only makes it inconsistent or harder for other mods to override 18:31 nekobit so im against the idea, unless someone else says its harmless 18:32 nekobit i care less about people being an ass with it and more about how modders would even utilize it 18:33 nekobit And honestly, itd be weird joining a server only for it to change up the pause menu which imo would just make things less consistent. This is already the case with the inventory 18:34 [MTMatrix] I highly disagree, especially when the current standard is, professionaly speaking, pure shit 18:35 nekobit current standard of what? 18:35 [MTMatrix] Game creators should be able to customise basically everything 18:35 [MTMatrix] Inventory and pause menu 18:35 Mantar mostly agree 18:36 [MTMatrix] The former is Minecraft done worse, the latter is "dev designing interfaces" 18:36 nekobit i guess it could be useful for minigame-type mods, maybe to add a built-in game list 18:37 nekobit i feel like pause menu customization should be limited to games only, not mods 18:37 Mantar but I don't think customizing the quit button is necessary, or even worth it 18:38 Mantar and "games not mods" sounds reasonable, too. mods fighting over the pause menu sounds like a bad time 18:39 MTDiscord nekobit: don't overthink it IMHO 18:39 nekobit mods can still add pause menu buttons btw, its not the end of the world. Games would just offer full control 18:39 MTDiscord games are composed of mods 18:39 MTDiscord how do you tell a game apart from a mod? it would require whole new APIs, probably 18:40 MTDiscord not worth it, random mods aren't going to alter the pause menu, like most mods aren't touching inventory 18:41 MTDiscord anyway 18:41 MTDiscord If you wanted games to have a privilege that add-on mods don't, the closest you'd do that wouldn't feel weird in our paradigm might be to offer an API that lets you disable certain types of further changes from being made. Which, I guess, you could probably already do by just patching out the API methods for them. 18:41 MTDiscord It's also possible that a game might choose NOT to alter the pause menu specifically because they WANT an external mod to make that decision. 18:41 MTDiscord Mantar: you mentioned altering the world creation window, or just adding game-specific settings to it, and that sounds even more important than custom pause window to me 18:42 nekobit cant the world creation window already do some things like that? 18:42 MTDiscord no, it can't 18:42 nekobit also, there is the settings page for mods, but ofc thats limited to every mod 18:42 MTDiscord unless you repurpose existing feature toggles, which is... 18:42 nekobit i think some mods that poke world generation have settings 18:42 MTDiscord no 18:42 MTDiscord If you can just add buttons to the pause menu that have a simple text label, and can either show a formspec (instant client-side) or trigger an event like a formspec send (allowing server-side control but with latency) that would probably be plenty to enable a lot of stuff. 18:43 nekobit thats what i wanted to do initially, like how sfinv tabs work 18:44 MTDiscord well, currently you technically can put in-game game-specific settings in the inventory formspec, or such 18:44 MTDiscord what you can't do is changing (or at least adding to) the world creation settings 18:44 Mantar yeah I'm stoked for that feature, I can add my player settings button to the pause menu. it's currently stuck in the character tab for lack of a better place 18:45 nekobit Mantar: I think the idea would be useful for an admin menu tbh 18:45 nekobit the current method is adding inventory tabs or a command 18:45 Mantar neko: yeah, that too 18:45 nekobit Then Ill start to work on it in a little, i just got off work. 18:47 MTDiscord The inventory screen is currently the way we often handle per-game/mod settings and such, it just sucks that users need to know to access a separate menu with a separate hotkey. Often they'll see the main pause menu and assume that's the only menu. 19:12 [MTMatrix] I think it doesn't make much sense to assume that servers/games/mods will abuse customisation opportunities to make the user experience worse. Of course they could, but it's in their best interest not to do that if they want to be played/installed. 19:15 Mantar if I hate a game and want to quit, having to figure out that they've moved the exit button into this pink cube labeled "Fin" on the bottom right is just unnecessary irritation 19:16 Mantar I'd prefer if it was like fire exits. you can design your store logos and signage any way you like, but not the fire exit signs, those have legal requirements 19:16 celeron55_ my rule of thumb would be, make everything customizable that's possible to do in a future proof and secure way. the ones making the customizations will have user experience in their best interest so it will be taken care of automatically 19:16 celeron55_ there's a chance of some mobile vs. desktop "fights" there though. that's part of future proofness, in a way 19:18 MTDiscord It's already better than the way fire exits are designed, because you have to follow different signs for each building you're in, you can't just hit Alt+F4 from anywhere. 19:18 Mantar I can attest that some of our younger mobile users already have trouble exiting as-is, which I admit colors my perception of the idea of potentially raising the bar for them 19:20 nekobit I think i should pull a GNOME and just not let people customize it. Plus, there's a chance people just wont test things on mobile too 19:20 nekobit Mods can add buttons if they want 19:52 MTDiscord nekobit: mobile doesn't bring problems with any designs I'm aware of and the button customization 19:52 MTDiscord there are two problems on mobile 19:53 nekobit one of those is playing minetest on mobile 19:54 MTDiscord firstly, mobile needs to expand the bottom panel (to access the "back" button) or the left-hand in-game menu to access the new (in MTE 5.8) in-game "back" button 19:54 MTDiscord (the button shows the pause menu on mobile) 19:56 MTDiscord secondly, if somebody does mess up the pause screen, mobile users need to expand the bottom panel to force quitting the app, because that's their Alt+F4 19:56 MTDiscord IMHO if somebody doesn't know how to do that, it's not our fault though 19:57 MTDiscord it's on par with not knowing Alt+F4, which some people don't know too 19:57 MTDiscord hence the "Press Alt+F4 to get free " jokes on various in-game chats 19:57 MTDiscord they sometimes actually work 19:58 nekobit does anyone know where the client-side lua is initialized? 20:52 nekobit so if im understanding correctly, absolutely zero Lua runs on the client (outside of the main menu), right? 20:52 nekobit Which means if i want to make a pause menu in Lua, i'd need to initialize a new Lua stack? 20:55 MTDiscord nekobit: there is the client mod environment. i believe it would make sense to introduce a "builtin" client mod as a counterpart to our "builtin" serverside mod, and to make the client mod environment mandatory rather than gating it via a setting. 20:56 MTDiscord you will want to take a look at src/script/scripting_client.(h|cpp) 20:58 nekobit luatic: I've already looked at scripting_client. My issue though is around src/client/game.cpp. The pause stuff is already implemented there. 20:58 nekobit But there is no lua there, besides the scripting_client, which only works if modsLoaded() is true (which isn't in my case as an example) 20:59 nekobit is there a client-side Lua stack I can use? 21:00 MTDiscord nekobit: the plan is to always make "modsLoaded" be true. 21:00 MTDiscord by having a mandatory clientside builtin mod which is always loaded, akin to the serverside builtin mod. 21:01 MTDiscord this also makes sense for implementing some other things, such as chat autocompletion, in lua. 21:01 nekobit Does the main menu not already do this? 21:02 MTDiscord the main menu uses a different environment than clientside mods 21:03 nekobit Well.. how should i accomplish this "client mod environment"? 21:03 nekobit I don't even see a setting you are talking about regarding client side mods 21:05 MTDiscord nekobit: enable_client_modding. 21:07 nekobit I see. Alright, now client->modsLoaded() is returning true. 21:08 nekobit Wait. So the custom death formspec which is called via lua is a client side thing? 21:08 nekobit I think things are starting to make sense then... 21:16 MTDiscord fwiw, making that return true was meant figuratively :P 21:16 MTDiscord (of course it should then be refactored to entirely remove that function) 21:16 MTDiscord (and any related checks, which should now assume that the client environment is present) 22:38 nekobit luatic Thank you buddy i got it working now 22:39 nekobit I'm calling client->getScript()->show_pause_menu() now which i'll move all the formspec to Lua 22:44 MTDiscord Where does devtest define the modification to the world creation screen that allows it to say this game is intended for developers go download a different one here? 22:44 MTDiscord https://cdn.discordapp.com/attachments/747163566800633906/1255655056498364548/Screenshot_20240626-184412.png?ex=667deb66&is=667c99e6&hm=43cfed0c8484b02f698b0afba6dec5ed02797408e60fae88f1c7a4bb463f198a& 22:45 MTDiscord I already looked in the game configuration files I can't find it 22:45 MTDiscord I'm pretty sure it's engine having it hardcoded. 22:45 nekobit builtin/mainmenu/dlg_create_world.lua 22:46 nekobit line 311 22:46 MTDiscord Can we have a flag in the engine that does the same thing but isn't hard coding? 22:46 nekobit From what i've picked up today, the world creation screen could use a revamp 22:46 MTDiscord It would be nice for things like void game, and other similar games that aren't intended for playing but more for testing. 22:48 nekobit is y++ possible in Lua? something like (y = y+1) that gives me the original value of y 22:48 MTDiscord My to do list just keeps getting longer and longer. 22:49 MTDiscord there's no increment operator in Lua 22:49 MTDiscord and I'm not sure if assignment returns anything 22:49 nekobit domb 22:49 MTDiscord I don't think there's a short hand, you could probably operate or overload but I don't think they would appreciate it 22:51 nekobit is there a strgettext like function I can use in Lua? Trying to convert the c++ formspec to Lua and i need translation 23:09 nekobit So uh, how exactly do I just "show" a formspec to the client? minetest.show_formspec doesn't seem like it's going to suffice since it expects a username (putting "singleplayer" does work though) 23:11 nekobit Ah, the client api is different 23:42 nekobit https://github.com/minetest/minetest/pull/14785 23:42 nekobit Alright, still need to move settings and a few other things in Lua, but seems to be working. 23:42 nekobit Only thing I'm not sure about is what to do with the `enable_client_modding` setting. Remove it?