示例#1
0
文件: wldlg.c 项目: jheusala/freeciv
/****************************************************************
  "Change Production" clicked
*****************************************************************/
static void change_callback(GtkWidget *w, gpointer data)
{
  struct worklist_data *ptr;
  GtkTreeSelection *selection;
  GtkTreeModel *model;
  GtkTreeIter it;

  ptr = data;
  selection = ptr->src_selection;

  if (gtk_tree_selection_get_selected(selection, &model, &it)) {
    gint cid;

    gtk_tree_model_get(model, &it, 0, &cid, -1);

    city_change_production(ptr->pcity, cid_production(cid));
  }
}
示例#2
0
void city_change_production_type(struct city* pCity, int type, long value) {
    struct universal u;
    u.kind = type;
    u.value = (universals_u)((struct impr_type *)value);
    city_change_production(pCity, u);
}