calref / cboe

Classic Blades of Exile
http://spiderwebforums.ipbhost.com/index.php?/forum/12-blades-of-exile/
Other
173 stars 42 forks source link

Does not build with recent TGUI #284

Closed x-qq closed 1 year ago

x-qq commented 2 years ago

TGUI 0.9 has introduced some breaking changes, our code will need to be adapted to them.

build/obj/game/boe.menu.cpp:200:52: error: cannot convert ‘const sf::String’ to ‘const tgui::String&’
  200 |         return this->tgui.get<tgui::MenuBar>(this->internal_menubar_widget_name);
      |                                              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    const sf::String
build/obj/game/boe.menu.cpp:238:30: error: ‘using element_type = class tgui::MenuBar’ {aka ‘class tgui::MenuBar’} has no member named ‘disconnect’
  238 |                 if(!menubar->disconnect(connection_id))
      |                              ^~~~~~~~~~

and possibly more.

szymor commented 2 years ago

Unfortunately, it still does not build. Is there a chance it would work with TGUI v0.8?

x-qq commented 2 years ago

It should build using TGUI 0.8.7 without issues.

szymor commented 2 years ago

Well, I managed to partially build it using TGUI 0.8.7 - I got some binaries but the process finished with some errors in the end. After some wandering through the menu, the game crashed. It might have been caused by aforementioned issues though.

I use ArchLinux on x64 platform, the build was done using the command: scons INCLUDEPATH=/home/szymek/repos/TGUI/include/ LIBPATH=/home/szymek/repos/TGUI/build/lib/ and I needed to add the line: #include <memory> to the file src/tools/winutil.hpp .

NQNStudios commented 1 year ago

Looks like a lot of the errors with 0.9.x are because TGUI added their own String class. This change is written about here: https://tgui.eu/tutorials/0.9/strings/

It says an implicit conversion exists:

TGUI was required to have its own string class, but I wanted to hide it as much as possible. So whether you are using char, whar_t, char8_t char16_t, char32_t*, std::string, std::wstring, std::u8string, std::u16string, std::u32string or sf::String, there is an implicit constructor for it.

So the solution might be to simply include tgui::String to fix all these type errors.