Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #898696 ยป 0027-sdl2-Rename-pOwner-as-owner.patch

Marko Lindqvist, 2020-11-19 04:14 PM

View differences:

client/gui-sdl2/citydlg.c
struct widget *add_dock, *pBuf, *pLast;
SDL_Surface *logo = NULL;
utf8_str *pstr = NULL;
struct player *pOwner = city_owner(pCity);
struct player *owner = city_owner(pCity);
int prev_y = 0;
if (!pcity_dlg->pImprv) {
......
pBuf->action = sell_imprvm_dlg_callback;
if (!pcity_dlg->pCity->did_sell
&& !is_wonder(pimprove) && (pOwner == client.conn.playing)) {
&& !is_wonder(pimprove) && (owner == client.conn.playing)) {
set_wstate(pBuf, FC_WS_NORMAL);
}
......
SDL_Surface *logo = NULL;
utf8_str *pstr = NULL;
int cs;
struct player *pOwner = city_owner(pCity);
struct player *owner = city_owner(pCity);
SDL_Rect area;
if (pcity_dlg) {
......
pcity_dlg->pResource_Map = pBuf;
pBuf->action = resource_map_city_dlg_callback;
if (!cma_is_city_under_agent(pCity, NULL) && (pOwner == client.conn.playing)) {
if (!cma_is_city_under_agent(pCity, NULL) && (owner == client.conn.playing)) {
set_wstate(pBuf, FC_WS_NORMAL);
}
pBuf->size.x = area.x + adj_size(193) + (adj_size(249) - pBuf->size.w) / 2;
......
pBuf->size.x =
area.x + adj_size(4) + 5 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 4 * pBuf->size.w;
pBuf->size.y = area.y + adj_size(2);
if (pOwner == client.conn.playing) {
if (owner == client.conn.playing) {
set_wstate(pBuf, FC_WS_NORMAL);
}
add_to_gui_list(ID_CITY_DLG_OPTIONS_BUTTON, pBuf);
......
pBuf->action = change_prod_dlg_callback;
pBuf->size.x = area.x + adj_size(7);
pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5);
if (pOwner == client.conn.playing) {
if (owner == client.conn.playing) {
set_wstate(pBuf, FC_WS_NORMAL);
}
pBuf->key = SDLK_c;
......
pBuf->key = SDLK_a;
pBuf->size.x = area.x + adj_size(7) + (pBuf->size.w + adj_size(2)) * 2;
pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5);
if (pOwner == client.conn.playing) {
if (owner == client.conn.playing) {
set_wstate(pBuf, FC_WS_NORMAL);
}
add_to_gui_list(ID_CITY_DLG_CMA_BUTTON, pBuf);
......
pBuf->action = next_prev_city_dlg_callback;
pBuf->size.x = area.x + adj_size(220) - pBuf->size.w - adj_size(8);
pBuf->size.y = area.y + area.h - pBuf->size.h;
if (pOwner == client.conn.playing) {
if (owner == client.conn.playing) {
set_wstate(pBuf, FC_WS_NORMAL);
}
pBuf->key = SDLK_LEFT;
......
pBuf->action = next_prev_city_dlg_callback;
pBuf->size.x = area.x + adj_size(420) + adj_size(2);
pBuf->size.y = area.y + area.h - pBuf->size.h;
if (pOwner == client.conn.playing) {
if (owner == client.conn.playing) {
set_wstate(pBuf, FC_WS_NORMAL);
}
pBuf->key = SDLK_RIGHT;
......
pBuf->action = new_name_city_dlg_callback;
pBuf->size.x = area.x + (area.w - pBuf->size.w) / 2;
pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(2);
if (pOwner == client.conn.playing) {
if (owner == client.conn.playing) {
set_wstate(pBuf, FC_WS_NORMAL);
}
client/gui-sdl2/mapview.c
if (pCity) {
/* Look at city owner, not tile owner (the two should be the same, if
* borders are in use). */
struct player *pOwner = city_owner(pCity);
struct player *owner = city_owner(pCity);
const char *diplo_city_adjectives[DS_LAST] =
{Q_("?city:Neutral"), Q_("?city:Hostile"),
Q_("?city:Neutral"), Q_("?city:Peaceful"),
......
/* This has hardcoded assumption that EFT_LAND_REGEN is always
* provided by *building* named *Barracks*. Similar assumptions for
* other effects. */
if (pplayers_allied(client.conn.playing, pOwner)) {
if (pplayers_allied(client.conn.playing, owner)) {
barrack = (get_city_bonus(pCity, EFT_LAND_REGEN) > 0);
airport = (get_city_bonus(pCity, EFT_AIR_VETERAN) > 0);
port = (get_city_bonus(pCity, EFT_SEA_VETERAN) > 0);
......
}
#endif /* 0 */
if (pOwner && pOwner != client.conn.playing) {
if (owner && owner != client.conn.playing) {
struct player_diplstate *ds
= player_diplstate_get(client.conn.playing, pOwner);
= player_diplstate_get(client.conn.playing, owner);
/* TRANS: (<nation>,<diplomatic_state>)" */
cat_snprintf(buffer, sizeof(buffer), _("\n(%s,%s)"),
nation_adjective_for_player(pOwner),
nation_adjective_for_player(owner),
diplo_city_adjectives[ds->type]);
}
}
    (1-1/1)