Freeciv-3.3
|
#include <stdlib.h>
#include <SDL2/SDL.h>
#include "fcintl.h"
#include "log.h"
#include "game.h"
#include "movement.h"
#include "unit.h"
#include "client_main.h"
#include "climisc.h"
#include "global_worklist.h"
#include "citydlg.h"
#include "colors.h"
#include "graphics.h"
#include "gui_id.h"
#include "gui_main.h"
#include "gui_tilespec.h"
#include "helpdlg.h"
#include "mapview.h"
#include "sprite.h"
#include "themespec.h"
#include "widget.h"
#include "wldlg.h"
Go to the source code of this file.
Data Structures | |
struct | wl_editor |
Macros | |
#define | TARGETS_COL 4 |
#define | TARGETS_ROW 4 |
Variables | |
struct wl_editor * | editor = NULL |
Add global worklist to city worklist starting from last free entry. Add only avilable targets in current game state. If global worklist have more targets that city worklist have free entries then we adding only first part of global worklist.
Definition at line 670 of file wldlg.c.
Referenced by global_worklist_callback().
Change production of city but only in Editor. You must commit this changes by exit editor via OK button (commit function).
This function don't remove double imprv./wonder target entry from worklist and allow more entry of such target (In Production and worklist - this is fixed by commit function).
Definition at line 350 of file wldlg.c.
Referenced by worklist_editor_targets_callback().
Add target to worklist.
Definition at line 206 of file wldlg.c.
Referenced by worklist_editor_targets_callback().
|
static |
Find if two targets are the same class (unit, imprv. , wonder). This is needed by calculation of change production shields penalty. [similar to are_universals_equal()]
Definition at line 303 of file wldlg.c.
Referenced by change_production().
Change production in editor shell, calculate production shields penalty and refresh production progress label
Definition at line 325 of file wldlg.c.
Referenced by add_target_to_production(), remove_item_from_worklist(), swap_item_down_from_worklist(), and swap_item_up_from_worklist().
|
static |
Return full unit/imprv. name and build cost in "cost" pointer.
Definition at line 880 of file wldlg.c.
Referenced by add_target_to_production(), and refresh_production_label().
|
static |
Return progress icon (bar) of current production state stock - current shields stocks cost - unit/imprv. cost function return in "progress" pointer (0 - 100 %) progress in numbers
Definition at line 900 of file wldlg.c.
Referenced by popup_worklist_editor(), and refresh_production_label().
Get Help Info about target
Definition at line 388 of file wldlg.c.
Referenced by worklist_editor_targets_callback().
Global worklist callback left mouse button -> add global worklist to current city list right mouse button -> clear city worklist and copy here global worklist.
There are problems with imprv./wonder targets because those can't be doubled on worklist and adding/setting can give you situation that global worklist have imprv./wonder entry that exist on city worklist or in building state. I don't make such check here and allow this "functionality" because doubled imprv./wonder entry are removed from city worklist during "commit" phase.
Definition at line 851 of file wldlg.c.
Referenced by popup_worklist_editor().
Commit changes to city/global worklist. In City Mode Remove Double entry of Imprv/Woder Targets from list.
Definition at line 124 of file wldlg.c.
Referenced by add_target_to_production(), and popup_worklist_editor().
Close worklist from view.
Definition at line 1870 of file wldlg.c.
Referenced by ok_worklist_editor_callback(), popdown_all_game_dialogs(), and popdown_worklist_editor_callback().
Popdwon Worklist Editor
Definition at line 111 of file wldlg.c.
Referenced by popup_worklist_editor().
void popup_worklist_editor | ( | struct city * | pcity, |
struct global_worklist * | gwl | ||
) |
Global/City worklist editor. if pcity == NULL then function takes worklist as global worklist. worklist must be not NULL.
Definition at line 1061 of file wldlg.c.
Referenced by button_up_on_map(), change_prod_dlg_callback(), change_production_callback(), edit_worklist_callback(), and popup_worklist_from_city_report_callback().
Update and redraw production name label in worklist editor. stock - pcity->shields_stock or current stock after change production lost.
Definition at line 937 of file wldlg.c.
Referenced by change_production().
Update and redraw worklist length counter in worklist editor
Definition at line 1018 of file wldlg.c.
Referenced by add_global_worklist(), add_target_to_worklist(), remove_item_from_worklist(), and set_global_worklist().
Remove element from worklist or remove currently building imprv/unit and change production to first worklist element (or Capitalizations if worklist is empty)
Definition at line 454 of file wldlg.c.
Referenced by swap_item_down_from_worklist(), swap_item_up_from_worklist(), and worklist_editor_item_callback().
Rename Global Worklist
Definition at line 183 of file wldlg.c.
Referenced by popup_worklist_editor().
Clear city worklist and copy here global worklist. Copy only available targets in current game state. If all targets are unavilable then leave city worklist untouched.
Definition at line 749 of file wldlg.c.
Referenced by global_worklist_callback().
Swap worklist entries DOWN. Fuction swap current element with next element of worklist.
If item is last widget or there is only one widget on widgets list fuction remove this widget from widget list and target from worklist
In City mode, when item is first worklist element, function make change production (currently building is moved to first element of worklist and first element of worklist is build).
Definition at line 530 of file wldlg.c.
Referenced by worklist_editor_item_callback().
Swap worklist entries UP. Fuction swap current element with prev. element of worklist.
If item is first widget on widgets list fuction remove this widget from widget list and target from worklist (global mode) or from production (city mode)
In City mode, when item is first worklist element, function make change production (currently building is moved to first element of worklist and first element of worklist is build).
Definition at line 587 of file wldlg.c.
Referenced by worklist_editor_item_callback().
Worklist Editor Window Callback
Definition at line 103 of file wldlg.c.
Referenced by popup_worklist_editor().
worklist callback left mouse button -> swap entries up. middle mouse button -> remove element from list right mouse button -> swap entries down.
Definition at line 639 of file wldlg.c.
Referenced by add_global_worklist(), add_target_to_worklist(), popup_worklist_editor(), and set_global_worklist().
Targets callback left mouse button -> In city mode change production to target. In global mode add target to worklist. middle mouse button -> get target "help" right mouse button -> add target to worklist.
Definition at line 415 of file wldlg.c.
Referenced by popup_worklist_editor().