Henningstone / tw_netgui

!! DISCONTINUED !! [0.7] Teeworlds NetGUI project. Server can send custom GUIs to the client.
Other
4 stars 2 forks source link

Make NetGUI usable through config files #2

Open Henningstone opened 8 years ago

Henningstone commented 8 years ago

It would be a lot more convenient if the GUI wouldn't be hardcoded. May do it using config files or even teeworlds console commands (the last one seems as the worse solution to me, since it would add a load of console commands…) Also, these files should be loaded at startup once to save performance.

Thought about something "teeworlds/netgui/example1.cfg" or something like that :)

H-M-H commented 8 years ago

As you normally use a gui for interactions I do not think that a configfile or servercommands would be sufficient. Maybe you could use something like lua. Would probably be an awful lot of work but I think there is no other way for non hardcoded guis that allow proper interaction.

Henningstone commented 8 years ago

Yeah, I also thought about Lua yet, but I thing that'd be a bit overdue. Especially because it was intended to be implemented into other mods... I don't want to force them to implement Lua aswell :/

As I intended the thingy with configfiles: They just store the same stuff like we currently hardcode, so that recompiling is not necessary anymore, you'd just have to clear the cache and reload the file. But I also think that servercommands would be insufficient. And to be honest, I'm not really keen on writing some algorithm to parse my own kind of files… It's difficult :/

Henningstone commented 8 years ago

Oh, I just realized that it would be quite impossible to do anything apart from Lua. I forgot the fact that we don't only have to just create the elements, but we have to handle them if the client client clicks the controls, damn. (see this line: https://github.com/Henningstone/tw_netgui/blob/master/src/game/server/netgui.cpp#L130-L170)

H-M-H commented 8 years ago

That is why I wrote "interactions" ^^