Re: [Freeciv-Dev] (PR#40482) 2.1.6 RC2 OSX SDL
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40482 Am Sonntag, 7. September 2008 12:11:47 schrieb François Marlier: -As the SDL version of Freeciv was first aimed at small screen devices, I'd felt free to relocate the Message widget in this new version as well as making it auto resizing in between the minimap widget and the unit info widget. This means, the first time you start the game, the Message will fit according to the screen resolution, giving you more reading outputs. I have yet to fix it to auto resize when you change the screen resolution while in game (you'll have to save, quit and relaunch for the Message widget to resize according to the new screen resolution when you change it when the game allready started, for now). -I removed the Message widget label bar, finding it useless. This also allows to give more outputs. -I also changed the Message widget colors to a more readable one. Yellow was not imho really readable on land tiles… Due to the fact I choose a dark translucent background (making the widget less intrusive) for the Message widget background, I had to create two more colors for other types of messages to avoid changing ALL the game texts to a fainted color (by default, some outputs are colored with the main text color). In the end you'll now see 4 different colors in the Message widget: -fainted yellow which shows clickable messages/your civ turn report. -medium gold which shows clickable messages once beeing clicked. -redish shows other civs reports and possibly other things. -blueish shows yet to find other infos. Way to go Francois! Would you mind posting your changes to the source code as patch/diff file as well? If you don't know how you can read on http://freeciv.wikia.com/wiki/How_to_Contribute (sure there is an equivalent of the diff tool on the Mac). That way your changes on the interface could be adopted by the SDL client regardless of the platform it is compiled for. Greetings, Nico ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40447) Adding number of traderoutes to map, comparing with production and granary counts
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40447 Attached patch incorporates the previous patches of this ticket and adds an extra checkbox entry to the map options dialog for this option. Additionally I made a minor update to the doc referring to the different shortcut key combos of this and #40458. Am Sonntag, 24. August 2008 20:33:06 schrieb Madeline Book: URL: http://bugs.freeciv.org/Ticket/Display.html?id=40447 Maybe there is a list of shortcuts mandatory for all clients available in the documentation? None that I know of. It would be a good idea to create such a page in the wiki though. It should be according to the gtk client, and the other guis made to follow it. Well. I can't find any such list on the wikia as well, just I dunno how to create a new page for this. Maybe you need to have an account on wikia for this? I don't really have a sensible explenation for not signing up there except that I just hate the idea of giving my (yet still spam free) e-mail address to a comercial web host. Maybe you would be so kind to create such a page? I'd add my input there later as anonymus guest account seems to be enabled. Greetings, Nico diff -Nur -X.diff_ignore trunk/client/control.c changed/client/control.c --- trunk/client/control.c 2008-08-23 15:52:24.0 +0200 +++ changed/client/control.c 2008-08-29 00:54:24.0 +0200 @@ -1683,6 +1683,19 @@ } /** + Toggle display of city traderoutes +**/ +void request_toggle_city_traderoutes(void) +{ + if (!can_client_change_view()) { +return; + } + + draw_city_traderoutes ^= 1; + update_map_canvas_visible(); +} + +/** Toggle display of terrain **/ void request_toggle_terrain(void) @@ -2760,6 +2773,15 @@ } /** + Handle client request to toggle drawing of traderoute information + by the city name for cities visible on the main map view. +**/ +void key_city_traderoutes_toggle(void) +{ + request_toggle_city_traderoutes(); +} + +/** ... **/ void key_terrain_toggle(void) diff -Nur -X.diff_ignore trunk/client/control.h changed/client/control.h --- trunk/client/control.h 2008-07-27 21:46:43.0 +0200 +++ changed/client/control.h 2008-08-29 00:54:24.0 +0200 @@ -98,6 +98,7 @@ void request_toggle_city_names(void); void request_toggle_city_growth(void); void request_toggle_city_productions(void); +void request_toggle_city_traderoutes(void); void request_toggle_terrain(void); void request_toggle_coastline(void); void request_toggle_roads_rails(void); @@ -142,6 +143,7 @@ void key_city_names_toggle(void); void key_city_growth_toggle(void); void key_city_productions_toggle(void); +void key_city_traderoutes_toggle(void); void key_terrain_toggle(void); void key_coastline_toggle(void); void key_roads_rails_toggle(void); diff -Nur -X.diff_ignore trunk/client/gui-gtk-2.0/menu.c changed/client/gui-gtk-2.0/menu.c --- trunk/client/gui-gtk-2.0/menu.c 2008-08-02 22:46:09.0 +0200 +++ changed/client/gui-gtk-2.0/menu.c 2008-08-29 00:54:24.0 +0200 @@ -106,6 +106,7 @@ MENU_VIEW_SHOW_CITY_NAMES, MENU_VIEW_SHOW_CITY_GROWTH_TURNS, MENU_VIEW_SHOW_CITY_PRODUCTIONS, + MENU_VIEW_SHOW_CITY_TRADEROUTES, MENU_VIEW_SHOW_TERRAIN, MENU_VIEW_SHOW_COASTLINE, MENU_VIEW_SHOW_ROADS_RAILS, @@ -334,6 +335,7 @@ * city name), can draw the city growth even without drawing * the city name. But the old method cannot. */ menus_set_sensitive(main/_View/City G_rowth, draw_city_names); +menus_set_sensitive(main/_View/City _Traderoutes, draw_city_names); } } break; @@ -345,6 +347,11 @@ if (draw_city_productions ^ GTK_CHECK_MENU_ITEM(widget)-active) key_city_productions_toggle(); break; + case MENU_VIEW_SHOW_CITY_TRADEROUTES: +if (draw_city_traderoutes ^ GTK_CHECK_MENU_ITEM(widget)-active) { + key_city_traderoutes_toggle(); +} +break; case MENU_VIEW_SHOW_TERRAIN: if (draw_terrain ^ GTK_CHECK_MENU_ITEM(widget)-active) { key_terrain_toggle(); @@ -822,7 +829,7 @@ NULL, 0, Tearoff }, { / N_(View) / N_(City Outlines), controly, view_menu_callback, MENU_VIEW_SHOW_CITY_OUTLINES, CheckItem}, - { / N_(View) / N_(City Output), controlt, + { / N_(View) / N_(City Output), controlw, view_menu_callback, MENU_VIEW_SHOW_CITY_OUTPUT, CheckItem}, { / N_(View) / N_(Map _Grid), controlg, view_menu_callback,
Re: [Freeciv-Dev] (PR#40467) [Patch] Wonder status character in German translation
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40467 Am Donnerstag, 28. August 2008 02:26:02 schrieb Madeline Book: URL: http://bugs.freeciv.org/Ticket/Display.html?id=40467 Of course, I would perfer if a translator could had a look and possibly think of better abbreviations that would be both intuitive and consistent with the rest of the German translation. Well, I'm not really a translator but I happen to be able to understand german, although not always really understanding Germans. ;) Germans really do like abbreviations, but to me that is mostly more confusing than helping. Maybe that is just because I have to memorize dozens of germans and english abbreviations... I always wondered about the w in the english native version as well as about the + in the translation. Now you posted this I finally get it. :D Is it really so crucial for the length of a message string that you can't just write wonder or built in it? Though I don't really see why this info text is particulary necessary anyways, as this particulary piece of news is the very reason of the message itself. I would like to see it only in the production info or progress bar as available (verfügbar) or built (gebaut), but that would mean some more work for all the other language translators... Greetings, Nico ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40447) Adding number of traderoutes to map, comparing with production and granary counts
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40447 Am Sonntag, 24. August 2008 02:06:30 schrieb Christian Prochaska: URL: http://bugs.freeciv.org/Ticket/Display.html?id=40447 [book - Sa 23. Aug 2008, 23:51:51]: Generally I think it would be good if all clients used the same shortcuts. I agree with that, too. It would probably be a good idea to implement the shortcuts used by the SDL client exclusively (yet) to the GTK client as well. Most, if not all, of these features are already present there as menu entries, just without shortcuts attached to them. That seems to be a simple task, and I'd be happy to do it, but I just don't feel sure about which client to give the priority to keep their native shortcuts. As GTK is the default GUI and the SDL client is only advertised as experimental on the download page I would give GTK the preference with this. Maybe there is a list of shortcuts mandatory for all clients available in the documentation? I agree with that. BTW, a checkbox in the SDL client's map options (as in PR#40458) would be nice here, too ;-) This options dialog menu is quite tricky to change, as everything is hardcoded. So every entry depends on length, position and so of all the other entries, making it annoying to add / move them at will. That's why I'd like to wait before fidling in this again to see when or if PR#40458 will be commited to trunk. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40458) [Patch] SDL GUI implementation of city output from #40213
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40458 Am Mittwoch, 20. August 2008 05:17:28 schrieb Madeline Book: the shortcut for city worker output having been moved to ctrl-w). (The sdl gui seems to be missing the city output toggle shortcut...?) Attached patch implements this option on the SDL client as extra check box option in the Map options menu dialog and via the ctrl-w key combo. However in order to keep this GTK compatibility I had to move the SDL client's own key combo for displaying the fog of war to ctrl-shift-w. Leaving the combo for worker output on ctrl-t wouldn't be helpful anyways, as this is also used by the SDL client for toggling the terrain on/off. Greetings, Nico diff -Nur -X.diff_ignore trunk/client/gui-sdl/gui_id.h changed/client/gui-sdl/gui_id.h --- trunk/client/gui-sdl/gui_id.h 2008-07-27 21:46:35.0 +0200 +++ changed/client/gui-sdl/gui_id.h 2008-08-23 19:06:30.0 +0200 @@ -96,6 +96,8 @@ ID_OPTIONS_MAP_CITY_NAMES_CHECKBOX, ID_OPTIONS_MAP_CITY_PROD_LABEL, ID_OPTIONS_MAP_CITY_PROD_CHECKBOX, + ID_OPTIONS_MAP_CITY_OUTPUT_CHECKBOX, + ID_OPTIONS_MAP_CITY_OUTPUT_LABEL, ID_OPTIONS_MAP_BORDERS_CHECKBOX, ID_OPTIONS_MAP_BORDERS_LABEL, ID_OPTIONS_MAP_CITY_CIV3_TEXT_STYLE_LABEL, diff -Nur -X.diff_ignore trunk/client/gui-sdl/mapctrl.c changed/client/gui-sdl/mapctrl.c --- trunk/client/gui-sdl/mapctrl.c 2008-07-27 21:46:35.0 +0200 +++ changed/client/gui-sdl/mapctrl.c 2008-08-23 19:31:41.0 +0200 @@ -2439,10 +2439,15 @@ /* (show focus unit) */ - /* show fog of war - Ctrl+w */ + /* show city output - Ctrl+w + * show fog of war - Ctrl+Shift+w */ case SDLK_w: if (LCTRL || RCTRL) { - key_fog_of_war_toggle(); + if (LSHIFT || RSHIFT) { +key_fog_of_war_toggle(); + } else { +key_city_output_toggle(); + } } return FALSE; diff -Nur -X.diff_ignore trunk/client/gui-sdl/optiondlg.c changed/client/gui-sdl/optiondlg.c --- trunk/client/gui-sdl/optiondlg.c 2008-07-27 21:46:35.0 +0200 +++ changed/client/gui-sdl/optiondlg.c 2008-08-23 19:05:38.0 +0200 @@ -1302,6 +1302,20 @@ /** ... **/ +static int draw_city_output_callback(struct widget *pWidget) +{ + if (Main.event.button.button == SDL_BUTTON_LEFT) { +widget_redraw(pWidget); +widget_flush(pWidget); +draw_city_output ^= 1; +update_map_canvas_visible(); + } + return -1; +} + +/** + ... +**/ static int borders_callback(struct widget *pWidget) { if (Main.event.button.button == SDL_BUTTON_LEFT) { @@ -1586,11 +1600,38 @@ pTmpGui-size.x = pWindow-size.x + adj_size(55); -add_to_gui_list(ID_OPTIONS_MAP_CITY_NAMES_LABEL, pTmpGui); +add_to_gui_list(ID_OPTIONS_MAP_CITY_PROD_LABEL, pTmpGui); pTmpGui-size.y = pTmpGui-next-size.y + ((pTmpGui-next-size.h - pTmpGui-size.h) / 2); +/* 'draw city worker output on map' */ +/* check box */ +pTmpGui = create_checkbox(pWindow-dst, draw_city_output, + WF_RESTORE_BACKGROUND); + +pTmpGui-action = draw_city_output_callback; +set_wstate(pTmpGui, FC_WS_NORMAL); + +pTmpGui-size.x = pWindow-size.x + adj_size(15); + +add_to_gui_list(ID_OPTIONS_MAP_CITY_OUTPUT_CHECKBOX, pTmpGui); +pTmpGui-size.y = pTmpGui-next-next-size.y + pTmpGui-size.h + adj_size(4); + +/* label */ +pStr = create_str16_from_char(_(City Output), adj_font(10)); +pStr-style |= TTF_STYLE_BOLD; +pStr-fgcol = text_color; +pTmpGui = create_iconlabel(NULL, pWindow-dst, pStr, 0); + +pTmpGui-size.x = pWindow-size.x + adj_size(55); + +add_to_gui_list(ID_OPTIONS_MAP_CITY_OUTPUT_LABEL, pTmpGui); + +pTmpGui-size.y = pTmpGui-next-size.y + +((pTmpGui-next-size.h - pTmpGui-size.h) / 2); + + /* 'draw borders' */ /* check box */ pTmpGui = create_checkbox(pWindow-dst, draw_borders, ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40447) Adding number of traderoutes to map, comparing with production and granary counts
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40447 Am Mittwoch, 20. August 2008 05:17:28 schrieb Madeline Book: Attached patch adds the display of the number of traderoutes to both the full and small citybars. A view option controls whether it is displayed (shortcut ctrl-t; This shortcut is used by the SDL client to toggle the terrain on/off. In order to keep the ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40407) Wishlist for Freeciv
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40407 [EMAIL PROTECTED] - Sa 26. Jul 2008, 23:03:29]: Hmmm, I can't remember if you can see the strongest unit inside ANY city (sorry). I guess from a tactical/logical point of view it doesn't make sense that you can see what the 'enemy' has in its defences. However I think it's definitely required for your own cities - OK, I'll make a wish-list request. I dunno how it was in civ2 but in civ3 you could only see the strongest enemy unit defending a city on top of the sprite of the city, while you could always see your full stacks of units. Attached patch is one way of how this feature could be implemented in current trunk version. I created two new options in the game for this: one on the server side called seecitydefender, which is disabled by default. Once enabled the server will send the info about the strongest unit occupying any city within vision so it can be displayed. For the displaying on the client there is the second option draw_units_in_cities that I incorporated so far only in the gtk-2.0 GUI. This is the reason why I enabled it by default, so players using other GUI's that have no way yet to change this view option will have no drawback when playing on a server with seecitydefender enabled. If this option is disabled on the server side you should still be able to see full unit stacks on top of own and allied cities with the client side option enabled. Greetings, Nico diff -Nur -X.diff_ignore trunk/client/control.c changed/client/control.c --- trunk/client/control.c 2008-07-27 21:46:43.0 +0200 +++ changed/client/control.c 2008-08-10 22:03:55.0 +0200 @@ -602,7 +602,7 @@ } /* If a city is here, return nothing (unit hidden by city). */ - if (tile_city(ptile)) { + if (tile_city(ptile) !draw_units_in_cities) { return NULL; } @@ -1833,6 +1833,19 @@ } /** + Toggle option to display units on top of cities +**/ +void request_toggle_units_in_cities(void) +{ + if (!can_client_change_view()) { +return; + } + + draw_units_in_cities ^= 1; + update_map_canvas_visible(); +} + +/** ... **/ void request_center_focus_unit(void) @@ -2849,6 +2862,14 @@ } /** +... +**/ +void key_units_in_cities_toggle(void) +{ + request_toggle_units_in_cities(); +} + +/** Toggle editor mode in the server. **/ void key_editor_toggle(void) diff -Nur -X.diff_ignore trunk/client/control.h changed/client/control.h --- trunk/client/control.h 2008-07-27 21:46:43.0 +0200 +++ changed/client/control.h 2008-08-10 21:59:47.0 +0200 @@ -110,6 +110,7 @@ void request_toggle_units(void); void request_toggle_focus_unit(void); void request_toggle_fog_of_war(void); +void request_toggle_units_in_cities(void); void wakeup_sentried_units(struct tile *ptile); @@ -154,6 +155,7 @@ void key_units_toggle(void); void key_focus_unit_toggle(void); void key_fog_of_war_toggle(void); +void key_units_in_cities_toggle(void); void key_end_turn(void); void key_city_outlines_toggle(void); void key_city_output_toggle(void); diff -Nur -X.diff_ignore trunk/client/gui-gtk-2.0/menu.c changed/client/gui-gtk-2.0/menu.c --- trunk/client/gui-gtk-2.0/menu.c 2008-08-02 22:46:09.0 +0200 +++ changed/client/gui-gtk-2.0/menu.c 2008-08-10 22:12:48.0 +0200 @@ -118,6 +118,7 @@ MENU_VIEW_SHOW_UNITS, MENU_VIEW_SHOW_FOCUS_UNIT, MENU_VIEW_SHOW_FOG_OF_WAR, + MENU_VIEW_SHOW_UNITS_IN_CITIES, MENU_VIEW_FULL_SCREEN, MENU_VIEW_CENTER_VIEW, @@ -397,6 +398,10 @@ if (draw_fog_of_war ^ GTK_CHECK_MENU_ITEM(widget)-active) key_fog_of_war_toggle(); break; + case MENU_VIEW_SHOW_UNITS_IN_CITIES: +if (draw_units_in_cities ^ GTK_CHECK_MENU_ITEM(widget)-active) + key_units_in_cities_toggle(); +break; case MENU_VIEW_FULL_SCREEN: if (fullscreen_mode ^ GTK_CHECK_MENU_ITEM(widget)-active) { fullscreen_mode ^= 1; @@ -862,7 +867,9 @@ { / N_(View) / N_(Units), NULL, view_menu_callback, MENU_VIEW_SHOW_UNITS, CheckItem }, { / N_(View) / N_(Focus Unit), NULL, - view_menu_callback, MENU_VIEW_SHOW_FOCUS_UNIT, CheckItem }, + view_menu_callback, MENU_VIEW_SHOW_FOCUS_UNIT, CheckItem }, + { / N_(View) / N_(Units in Cities), NULL, +view_menu_callback, MENU_VIEW_SHOW_UNITS_IN_CITIES, CheckItem }, { / N_(View) / N_(Fog of War), NULL, view_menu_callback,
Re: [Freeciv-Dev] Freeciv - VERY annoynig gameplay bug
Hello! There is a bug: if enemy founds a city on your territory and you destroy this city, you will NEVER be able to get resourses from destroyed city's square - it is no more your territory forever Screenshots attached. Hi, Do you have a savegame for checking that? I failed to reproduce the bug, however the latest development version appears to have went through some heavy development especially regarding the ownership of tiles. So maybe this issue as been solved accidentally... Greetings, Nico ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40408) [Patch] Updating problem in trunk when capturing enemy cities
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40408 Oh, my bad actually. I didn't notice there was a ticket already describing exactly the same bug as I was tackling with. ;) Your patch seems to be more thoroughly cleaning up some messy code while I was just looking for a quickdirty solution, as always. So no complaints from me, go ahaed and close the tickets (if you can delete mine I won't mind either ;) ), we should stick with your patch. I haven't tested it totally in depth, but it seems to be working quite fine. Greetings, Nico ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40408) [Patch] Updating problem in trunk when capturing enemy cities
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40408 [EMAIL PROTECTED] - So 27. Jul 2008, 17:10:31]: Depending on the order of packets being correct is, in general, very bad. Each packet should be independent. I agree on that so it is probably most sensible to let the apropiate function processing the city_info packet check for the change of the owner of the city instead of the tile. I also deleted a comment suggesting that tile owner should be the same as city owner, which clearly didn't seem to be the case without my previous patch. Greetings, Nico diff -Nur -X.diff_ignore trunk/client/packhand.c changed/client/packhand.c --- trunk/client/packhand.c 2008-07-27 21:46:43.0 +0200 +++ changed/client/packhand.c 2008-08-03 21:28:58.0 +0200 @@ -509,8 +509,7 @@ pcity-original = powner; tile_set_owner(pcenter, powner); -} else if (tile_owner(ptile) != powner) { - /* assumes the tile properly reflects city_owner() */ +} else if (city_owner(pcity) != powner) { client_remove_city(pcity); pcity = NULL; city_has_changed_owner = TRUE; ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40411) Bug: irrigation has no effect
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40411 Hi, well in my self compiled version of the 2.1.5 bundle (GTK client) the irrigation works and is displayed correctly. As in the original civ the food output can only exceed 2 if your current government system is neither anarchy nor despotism. At which government type did you notice the bug? Greetings, Nico ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40316) enemy cities not shown in fogged tiles
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40316 tile_city() returns real current situation. Instead server should send to client what player knows. Player may think there is a city in fogged tile, when in reality city has been destroyed since last seen, or new city has been founded to tile that previously had none. Player knowledge should be available from player_tile. Cities are one kind of vision_site, I think. That means that the way the owner is communicated by the server on fogged tiles is currently also wrong, as it uses the tile_owner function returning also the real current situation and not what the client is supposed to know. I haven't realised up till now that the borders are also updated on fogged tiles despite not having sent units to recon the new changes. I tried to solve this right along when getting the cities working, however the owner member of the vision_site struct seems not beeing set correctly at some other place in the code, while the identity member seems to be working just like it should be. So when applying this patch you would see the borders only on not fogged tiles. I'm still trying for the right place in the code to set the owner property, but as I don't have much of a clue I'm open for suggestions as always. ;) Greetings, Nico diff -Nur -X.diff_ignore trunk/server/maphand.c changed/server/maphand.c --- trunk/server/maphand.c 2008-07-27 21:44:04.0 +0200 +++ changed/server/maphand.c 2008-07-27 23:32:28.0 +0200 @@ -406,13 +406,16 @@ } else if (pplayer map_is_known(ptile, pplayer) map_get_seen(ptile, pplayer, V_MAIN) == 0) { struct player_tile *plrtile = map_get_player_tile(ptile, pplayer); + struct vision_site *psite = map_get_player_base(ptile, pplayer); info.known = TILE_KNOWN_UNSEEN; info.continent = tile_continent(ptile); - info.owner = (NULL != tile_owner(ptile)) - ? player_number(tile_owner(ptile)) + info.owner = (NULL != psite NULL != psite- owner) + ? player_number(psite-owner) : MAP_TILE_OWNER_NULL; - info.worked = IDENTITY_NUMBER_ZERO; + info.worked = (NULL != psite) +? psite-identity +: IDENTITY_NUMBER_ZERO; info.terrain = (NULL != plrtile-terrain) ? terrain_number(plrtile-terrain) ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40386) [Patch] overview border layers not on ocean tiles
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40386 Hi, If you play a lot with islands (especially with the 1x1 tiny_isles option activated) the overview map tend to look a little bit ugly with borders on, since ocean tiles are marked with the color of the player owning the tiles and you can't see the normal coasts anymore. This patch comes with a new option called Borders layer on ocean tiles that should be activated by default letting every thing just like it used to be before. Once you deactivate this option the color marked territory on the map should appear only on land tiles, letting you see the normal coastlines. Greetings, Nico diff -Nur -X.diff_ignore trunk/client/options.c changed/client/options.c --- trunk/client/options.c 2008-07-20 13:05:16.0 +0200 +++ changed/client/options.c 2008-07-20 13:31:33.0 +0200 @@ -257,6 +257,13 @@ N_(The borders layer of the overview shows which tiles are owned by each player.), COC_OVERVIEW, overview_redraw_callback), + GEN_BOOL_OPTION_CB(overview.layers[OLAYER_BORDERS_ON_OCEAN], + N_(Borders layer on ocean tiles), + N_(The borders layer of the overview are drawn on +ocean tiles as well (this may look ugly with many +islands). This option is only of interest if you +have set the option \Borders layer\ already.), + COC_OVERVIEW, overview_redraw_callback), GEN_BOOL_OPTION_CB(overview.layers[OLAYER_UNITS], N_(Units layer), N_(Enabling this will draw units on the overview.), diff -Nur -X.diff_ignore trunk/client/overview_common.c changed/client/overview_common.c --- trunk/client/overview_common.c 2008-07-20 13:05:16.0 +0200 +++ changed/client/overview_common.c 2008-07-20 13:33:57.0 +0200 @@ -31,7 +31,8 @@ .fog = TRUE, .layers = {[OLAYER_BACKGROUND] = TRUE, [OLAYER_UNITS] = TRUE, - [OLAYER_CITIES] = TRUE} + [OLAYER_CITIES] = TRUE, + [OLAYER_BORDERS_ON_OCEAN] = TRUE} }; /* @@ -142,7 +143,11 @@ struct player *owner = tile_owner(ptile); if (owner) { - return get_player_color(tileset, owner); + if(overview.layers[OLAYER_BORDERS_ON_OCEAN]) { +return get_player_color(tileset, owner); + } else if(!is_ocean_tile(ptile)) { +return get_player_color(tileset, owner); + } } } if (overview.layers[OLAYER_RELIEF] tile_terrain(ptile) != T_UNKNOWN) { diff -Nur -X.diff_ignore trunk/client/overview_common.h changed/client/overview_common.h --- trunk/client/overview_common.h 2008-07-20 13:05:16.0 +0200 +++ changed/client/overview_common.h 2008-07-20 13:29:27.0 +0200 @@ -24,6 +24,7 @@ OLAYER_BACKGROUND, OLAYER_RELIEF, OLAYER_BORDERS, + OLAYER_BORDERS_ON_OCEAN, OLAYER_UNITS, OLAYER_CITIES, OLAYER_COUNT ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40374) [Editor] build city improvements in the cityreport dialog
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40374 Hi, This feature may have been in the editor previously but is probably commented out now, so I tried to implement it the proper way. With this patch you can let cities build items like improvements and units while in editor mode by clicking on the buy button of the general cityreport dialog (Hotkey F4 in the GTK GUI, where you get a list of all cities of one player). This will cost nothing for the player owning the city and the improvements/units will be immediately added to the given city without having to wait one turn like in the usual context of this button. This feature should work with any clients supporting the Editor mode however, it won't affect the buy button you get in the normal city dialog when double clicking on a city (either on the map or in the general cityreport). That's what I'm currently looking after to change, but it looks like this button and it's callback is implemented GUI specific, but that is just guessing of mine. As you may have thought I'm completely new to this project and am just mostly busy trying to learn to look through the existing code and guessing how I could work with it. So any further contributions may take some time. ;) Greetings Nico diff -Nur -Xdiff_ignore trunk/client/climisc.c changed/client/climisc.c --- trunk/client/climisc.c 2008-07-05 19:58:11.0 +0200 +++ changed/client/climisc.c 2008-07-13 22:47:33.0 +0200 @@ -1023,25 +1023,36 @@ **/ void cityrep_buy(struct city *pcity) { - int value; - - if (city_production_has_flag(pcity, IF_GOLD)) { -create_event(pcity-tile, E_BAD_COMMAND, - _(You don't buy %s in %s!), - improvement_name_translation(pcity-production.value.building), - city_name(pcity)); -return; - } - value = city_production_buy_gold_cost(pcity); - - if (city_owner(pcity)-economic.gold = value) { -city_buy_production(pcity); + if (!can_conn_edit(client.conn)) { +int value; + +if (city_production_has_flag(pcity, IF_GOLD)) { + create_event(pcity-tile, E_BAD_COMMAND, + _(You don't buy %s in %s!), + improvement_name_translation( + pcity-production.value.building), + city_name(pcity)); + return; +} +value = city_production_buy_gold_cost(pcity); + +if (city_owner(pcity)-economic.gold = value) { + city_buy_production(pcity); +} else { + create_event(NULL, E_BAD_COMMAND, + _(%s costs %d gold and you only have %d gold.), + city_production_name_translation(pcity), + value, + city_owner(pcity)-economic.gold); +} } else { -create_event(NULL, E_BAD_COMMAND, - _(%s costs %d gold and you only have %d gold.), - city_production_name_translation(pcity), - value, - city_owner(pcity)-economic.gold); +/* Editor mode can build without any cost or waiting for next turn */ +if (client.conn.playing != NULL) { + /* Not a global observer */ + dsend_packet_edit_city_build(client.conn, + player_number(client.conn.playing), + pcity-id); +} } } diff -Nur -Xdiff_ignore trunk/common/packets.def changed/common/packets.def --- trunk/common/packets.def 2008-07-11 21:46:56.0 +0200 +++ changed/common/packets.def 2008-07-13 22:32:38.0 +0200 @@ -1551,10 +1551,15 @@ UINT8 size; end +PACKET_EDIT_CITY_BUILD=168;cs,handle-per-conn,dsend + PLAYER playerno; + CITY cityID; +end + /* Always keep this as the last edit type packet, * so that the test in server/srv_main.c +1203 * is easy to write. */ -PACKET_EDIT_PLAYER_TECH=168;cs,handle-per-conn,dsend +PACKET_EDIT_PLAYER_TECH=169;cs,handle-per-conn,dsend PLAYER playerno; TECHtech; EDIT_TECH_MODE mode; diff -Nur -Xdiff_ignore trunk/server/edithand.c changed/server/edithand.c --- trunk/server/edithand.c 2008-07-05 19:56:36.0 +0200 +++ changed/server/edithand.c 2008-07-13 22:42:53.0 +0200 @@ -627,6 +627,43 @@ #endif / + Build the item currently in production of a given city immediately +/ +void handle_edit_city_build(struct connection *pc, int playerno, int cityID) +{ + if (!can_conn_edit(pc)) { +notify_conn(pc-self, NULL, E_BAD_COMMAND, +_(You are not allowed to edit.)); +return; + } + struct city *pcity = game_find_city_by_number(cityID); + struct player *pplayer = player_by_number(playerno); + if (city_production_has_flag(pcity, IF_GOLD)) { +notify_conn(pc-self, pcity-tile, E_CITY_CANTBUILD, + _(Cannot \build\ coinage in %s),