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 #903177 ยป 0041-sdl2-Rename-p-Dialog-to-adhere-coding-style.patch

Marko Lindqvist, 2020-12-04 08:41 PM

View differences:

client/gui-sdl2/chatline.c
LOAD GAME
**************************************************************************/
struct advanced_dialog *pLoadDialog;
struct advanced_dialog *load_dialog;
/**********************************************************************//**
User event to load game dialog window.
......
static int move_load_game_dlg_callback(struct widget *pwindow)
{
if (PRESSED_EVENT(main_data.event)) {
move_window_group(pLoadDialog->begin_widget_list, pwindow);
move_window_group(load_dialog->begin_widget_list, pwindow);
}
return -1;
......
**************************************************************************/
void popdown_load_game_dialog(void)
{
if (pLoadDialog) {
popdown_window_group_dialog(pLoadDialog->begin_widget_list, pLoadDialog->end_widget_list);
FC_FREE(pLoadDialog->scroll);
FC_FREE(pLoadDialog);
if (load_dialog) {
popdown_window_group_dialog(load_dialog->begin_widget_list, load_dialog->end_widget_list);
FC_FREE(load_dialog->scroll);
FC_FREE(load_dialog);
/* enable buttons */
set_wstate(conn_dlg->back_button, FC_WS_NORMAL);
......
int scrollbar_width = 0;
int max_label_width = 0;
if (pLoadDialog) {
if (load_dialog) {
return;
}
......
widget_mark_dirty(conn_dlg->start_button);
/* create dialog */
pLoadDialog = fc_calloc(1, sizeof(struct advanced_dialog));
load_dialog = fc_calloc(1, sizeof(struct advanced_dialog));
title = create_utf8_from_char(_("Choose Saved Game to Load"), adj_font(12));
title->style |= TTF_STYLE_BOLD;
......
add_to_gui_list(ID_WINDOW, pwindow);
pLoadDialog->end_widget_list = pwindow;
load_dialog->end_widget_list = pwindow;
area = pwindow->area;
......
area.w += close_button->size.w;
pLoadDialog->begin_widget_list = close_button;
load_dialog->begin_widget_list = close_button;
/* create scrollbar */
scrollbar_width = create_vertical_scrollbar(pLoadDialog, 1, 20, TRUE, TRUE);
hide_scrollbar(pLoadDialog->scroll);
scrollbar_width = create_vertical_scrollbar(load_dialog, 1, 20, TRUE, TRUE);
hide_scrollbar(load_dialog->scroll);
/* search for user saved games. */
files = fileinfolist_infix(get_save_dirs(), ".sav", FALSE);
......
area.w = MAX(area.w, max_label_width + scrollbar_width + 1);
if (count > 0) {
area.h = (pLoadDialog->scroll->active * filename_label->size.h) + adj_size(5);
area.h = (load_dialog->scroll->active * filename_label->size.h) + adj_size(5);
}
resize_window(pwindow, theme_get_background(theme, BACKGROUND_LOADGAMEDLG),
......
area = pwindow->area;
setup_vertical_scrollbar_area(pLoadDialog->scroll,
setup_vertical_scrollbar_area(load_dialog->scroll,
area.x + area.w - 1,
area.y + 1,
area.h - adj_size(2), TRUE);
......
del_widget_pointer_from_gui_list(filename_label);
if (filename_label == first_label) {
add_widget_to_vertical_scroll_widget_list(pLoadDialog,
add_widget_to_vertical_scroll_widget_list(load_dialog,
filename_label, close_button,
FALSE,
area.x + 1,
area.y + adj_size(2));
} else {
add_widget_to_vertical_scroll_widget_list(pLoadDialog,
add_widget_to_vertical_scroll_widget_list(load_dialog,
filename_label,
pLoadDialog->begin_active_widget_list,
load_dialog->begin_active_widget_list,
FALSE,
area.x + 1,
area.y + adj_size(2));
......
* add_widget_to_vertical_scroll_widget_list(), but the window
* is not drawn yet, so this saved background is wrong.
* Deleting it here as a workaround. */
FREESURFACE(pLoadDialog->scroll->pscroll_bar->gfx);
FREESURFACE(load_dialog->scroll->pscroll_bar->gfx);
redraw_group(pLoadDialog->begin_widget_list, pwindow, 1);
redraw_group(load_dialog->begin_widget_list, pwindow, 1);
flush_dirty();
}
client/gui-sdl2/inteldlg.c
static int intel_window_dlg_callback(struct widget *pwindow)
{
if (PRESSED_EVENT(main_data.event)) {
struct intel_dialog *pSelectedDialog = get_intel_dialog(pwindow->data.player);
struct intel_dialog *selected_dialog = get_intel_dialog(pwindow->data.player);
move_window_group(pSelectedDialog->pdialog->begin_widget_list, pwindow);
move_window_group(selected_dialog->pdialog->begin_widget_list, pwindow);
}
return -1;
client/gui-sdl2/spaceshipdlg.c
dialog_list_has_been_initialised = TRUE;
}
dialog_list_iterate(dialog_list, pDialog) {
if (pDialog->end_widget_list->data.player == pplayer) {
return pDialog;
dialog_list_iterate(dialog_list, pdialog) {
if (pdialog->end_widget_list->data.player == pplayer) {
return pdialog;
}
} dialog_list_iterate_end;
    (1-1/1)