Freeciv-tao-client
Re: Freeciv-tao-client
I have one question. Where was image displayed on start screen of gtk3 client? Which file should I include and which macrodefinition/string use?
Re: Freeciv-tao-client
I assume you're speaking about something like this: Which image to use is actually defined by the tileset, you can get the file name from tileset_main_intro_filename (tilespec.h:395). The tileset needs to be initialized for this to work. The client startup procedure is as follows:Lachu wrote:I have one question. Where was image displayed on start screen of gtk3 client? Which file should I include and which macrodefinition/string use?
- (UI side) main() is called
- (UI) main() calls client_main (client_main.h:51)
- (common side) client_main() calls gui_init
- (co) client_main() loads some things
- (co) client_main() calls ui_main
- (co) client_main() finishes loading
- (UI) ui_main creates the GUI. The application exits when it returns
After initialization is done, it's up to the UI to call the common code when needed, including map rendering functions (the only exception to this is the metaserver, which lives in its own thread). The common code will call add_idle_callback (gui_main_g.h:41) when a function needs to be called "at some moment in the future". The real_timer_callback (client_main.h:111) needs to be called by the UI code at specified time intervals.
Louis
Re: Freeciv-tao-client
Yes, I spoke about image you attached. I copy files *.c and *.h from client/gui-stub into clien/gui-tao, change Makefile.am, ran ./autogen.sh --gui-client=tao and try to compile, but compiler complains about missing symbols.
Re: Freeciv-tao-client
Submit you current work to a patch ticket ( https://gna.org/patch/?func=additem&group=freeciv ), patch as attachment, and I can have a look of what it needs.
Re: Freeciv-tao-client
It now compile. I copy source from stub, but didn't add some sources into list of sources to compile for tao client in client/Makefile.am. I have in mind gui_interface.c and gui_cb_setter.c
Re: Freeciv-tao-client
I cannot find a callback for start window/screen. Where it should be created?
Re: Freeciv-tao-client
Everything can be created in ui_main(). real_set_client_page() is called on page switching (see pages_g.h, notably enum client_pages at line 19).Lachu wrote:I cannot find a callback for start window/screen. Where it should be created?
Louis
Re: Freeciv-tao-client
So I would create windows in real_set_client_page. I have another questions. Why in options.h are options separately for each client? How to select one kind of options, like theme string?
Re: Freeciv-tao-client
Because not all clients support the same options.Lachu wrote:Why in options.h are options separately for each client?
Lachu wrote:How to select one kind of options, like theme string?
Code: Select all
char *value;
options_iterate(client_optset, poption) {
if (option_type(poption) == OT_STRING
&& strcmp(option_name(poption), "gui_tao_an_option")) {
value = option_str_get(poption);
/* Do something */
}
} options_iterate_end;
Re: Freeciv-tao-client
I updated data/gui-tao/Freeciv/gui-gtk-3.0/Makefile.am and ran ./autogen --enable-client=tao, but Makefile/Makefile.in wasn't update. I decided to remove dirty files and ran ./autogen --enable-client=tao, but missing files wasn't recreated.