2000-03-13  Stan Shebs  <shebs@shebs.cnchost.com>

	* version.h: Bump to 7.2.96.

	* refman.texi: Document many added symbols.

2000-03-12  Stan Shebs  <shebs@shebs.cnchost.com>

	* unit.h (has_acp_left): Test against 0 instead of acp-min.
	* unit.c (change_unit_type): Make side change to indepside
	instead of NULL.
	* skelconq.c, cconq.c (unit_research_dialog, side_research_dialog):
	Add dummy versions.
	* actions.c, combat.c: Cosmetic changes.
	* iplayer.c: Remove unneeded decls.

	* cobra.g: Make self-contained.
	* ob-nor-alld.g, ob-nor-axis.g: Remove, not really used or useful.

	* PROJECTS: Contrib dir exists, add proposal to remove
	create-units-from-specs.

2000-03-11  Stan Shebs  <shebs@shebs.cnchost.com>

	* mkroads.c (make_roads): Use actual value of K_ROAD_X.
	* move.c (total_move_cost): Add effect of coating types.
	* mplayer.c (update_side_strategy): Add per-side research
	decision.
	(add_goal): Warn about goal overflow.
	(mplayer_decide_plan): Use for advanced units unless auto
	constructing/researching, decide to collect materials if
	there is a goal to have some.
	(mplayer_adjust_plan): Similarly, plus add a goal to get
	materials if units to be constructed need them.
	(assign_to_collection, mp_collect_here,
	assign_to_colonization support): New functions.
	* plan.c (execute_plan): Use for advanced units unless auto
	constructing/researching.
	(plan_colonize): Call plan_colonize_support if unit not
	a mobile type.
	* run.c (run_game): Stop game action if any designers active.
	* run2.c (run_environment): Add special code to detect and
	use mud and snow coating types.
	* task.c (do_build_task): Test requested location before
	doing create-in, try all directions if no location for a
	create_at.

	* tkmap.c (GRAY): Add darkgray option.
	(cell_drawing_info): Add overlay color result, make coatings
	override other overlay types.
	(draw_terrain_row, draw_terrain_transitions): Fix coating
	drawing.

	* ancient.g: Make units vanish in forest (prevents attempts
	to construct there), adjust hit chances on animals vs people,
	change Mitanni side color.
	* civ2.g: Default variants to off, change settlers image,
	let cities see whole area, let units build roads and rails,
	lower cost of movement on them.
	* ww2-adv.g: Add mud/snow effects.
	* ww2-eur-42.g: Add/adjust temperature stations, add in
	ww2-sides.g.
	* images/settler.gif: New image.
	* imf.dir, people.imf: Add it.

	* PROJECTS: Remove some more unmotivated items, reflect
	accomplishment of basic Civ emulation.

2000-03-09  Stan Shebs  <shebs@shebs.cnchost.com>

	* ai.c (goal_truth): Handle GOAL_HAS_MATERIAL_TYPE.
	(colonizing_worth): Also consider a unit to be a colonizer
	if it can build any type that can build more of it.

	* tkcmd.c (aux_add_terrain_2): Require linear types to be
	specified by clicking on adjacent cell.
	* tkinit.c (init_display): Call init_ui_chars.
	* tkmain.c (ask_unit_type): Use unitchars array.
	(ask_terrain_type): Use terrchars array.
	* cconq.c, xmap.c: Similarly.

2000-03-05  Stan Shebs  <shebs@shebs.cnchost.com>

	* task.def (TASK_BUILD): Add args for location at which to build.
	* task.c (do_build_task): Pass location to create-at action.
	* iplayer.c, mplayer.c, kpublic.h, plan.c, task.c, tp.c,
	ccmd.c, macunit.c, macwins.c, tkcmd.c, xcmd.c: Update all calls.

	* task.def (TASK_DO_ACTION): Remove, never used.
	* task.c (do_action_task): Remove.
	* xcloseup.c: Remove ref.

	* cmd.c (do_research): Let "research nothing" stop research.
	* run.c (units_still_acting): Don't end turn if research topic
	still needs to be chosen.
	(run_population): Add a hack for effects of "Granary".
	* run2.c (run_side_research): Skip if researchers resting.

	* tkconq.tcl (popup_splash_screen): Improve button names.
	(fill_in_side_list): Omit default scorekeeper text.
	(popup_research_dialog): Add "Rest" button.
	(rest_research): New proc.
	* tkmain.c (update_side_display): Move research popup to here
	from update_turn_display.
	(tk_set_side_research): Handle resting case.

	* civ2.g: Rename "fishery" to "ocean/fish", limit number
	of wonders, forbid multiple improvements of the same type
	in a city, make research go faster.

	* ww2-div-eur.g: Limit number of battleship attacks.
	* nw-europe.g: Add London.
	* t-nw-eur.g: Add beaches.
	* ww2-adv.g: Remove cliffs and salt-marsh terrain types,
	add beach terrain type, constrain transports to only be
	able to unload across beaches.
	* ww2-eur-42.g: Similarly, for the actual terrain layers.

	* PROJECTS: Reflect beach additions, remove redundant build
	item.

2000-02-29  Stan Shebs  <shebs@shebs.cnchost.com>

	* table.def (mp-to-enter-terrain): Allow negative values.
	* move.c (do_move_action): Tweak argument names for consistency,
	comment out tests of vanishing on terrain being left from.
	* run2.c (interpolate_temperature): Rewrite to fix/simplify.
	(try_sharing_with_cell): Share with all trusted units.
	(run_economy): Don't round capacities of 1 to 0.
	* ai.c (next_ai_type): New function.
	* tkconq.tcl (cycle_ai_cmd): Rewritten, was toggle_ai_cmd.
	* tkmain.c (tk_set_ai_for_player): Rewrite to use -cycle
	argument.
	* tkmap.c (any_coating_at): New function.
	(cell_drawing_info, draw_terrain_row): Use to detect and draw
	coatings.
	(handle_designer_mouse_down, paint_on_drag): Add ability to
	paint coatings.

	* game.dir: Remove unfinished games empire.g and postmodern.g.
	* ww2-adv.g: Add snow terrain, remove port cities, let sub
	and asw fleets see farther, let ground units build bases,
	tinker with combat odds, add temperature model.
	* ww2-eur-42.g: Add key points for temperatures, add more
	German subs, make France be controlled by Germany, add
	instructions.
	* ww2-stdunit.g: Remove, not very useful.
	* ww2s-42.g, ww2s-eur-42.g, ww2s-pac-41.g: Add contents of
	ww2-stdunit.g, make standard game be base module.
	* ww2-div-eur.g: Let ground types land through beach borders.
	* ww2-div-eur.g, ww2-bn.g: Don't use large speeds.

	* PROJECTS: Reflect above work.

2000-02-23  Stan Shebs  <shebs@shebs.cnchost.com>

	* combat.c (check_attack_action, check_fire_at_action,
	capture_unit_2): Fix independent unit tests.

	* tkimf.c (tk_make_color_pixmap): Use endian-portable code
	to fill in ximbuf.
	* tkmain.c (initial_ui_init): Provide more info about why
	tcl files couldn't be loaded.
	* tkmap.c (draw_units): Fix visibility tests so that
	named visible units can get their names displayed.
	(handle_designer_mouse_down): Make the newly-created unit
	the current unit.

	* nat-names.g, ng-african.g, ng-american.g, ng-asian.g,
	ng-european.g, ng-misc.g: Add rest of per-nation random
	place names.
	* stdunit.g: Add more independent towns.

	* images/dwellings32.imf: New file.
	* dwellings.imf: Use it for walltown, rename b/w image to
	walltown-s, also rename b/w parthenon image.
	* ancient.imf, ships.imf: Similarly for hoplite and trireme.

	* PROJECTS: Reflection of above projects, plus general sweep
	of junky ideas.

2000-02-16  Stan Shebs  <shebs@shebs.cnchost.com>

	* task.c (do_produce_task): Adjust correct task argument.

	* refman.texi (material-to-produce): Clarify behavior.

2000-02-06  Hans Ronne  <hronne@pp.sbbs.se>

	Mac interface improvements: Integrate advanced unit (city) dialog
	with normal unit closeup and make it non-modal. Add a new list for
	setting research tasks to the construction window. Improve help
	window and make it floating. Add help buttons to unit
	closeups. Rewrite event_loop and handle_event for better support
	of non-modal dialogs. Add dialog support to floating window
	code. Add support for Return, Escape and Up and Down Arrow keys to
	player setup dialog. Add support for Page Up Page Down and Escape
	keys to list scrolling code.
	
	Kernel improvements: Add network support for curadvance,
	autobuild, autoresearch and autoplan. Other new functions:
	research_desc and researchible_desc.

	* Floating.c (IsDialog): New function.
	(UpdateFloats): Test for IsDialog.
	(MakeDialogFloat): New function.
	(SelectTheWindow): Test for IsDialog.

	* Floating.h: include <Dialogs.h>.
	(IsDialog): Prototype.
	(MakeDialogFloat): Prototype.

	* macconq.c (handle_keystroke): New function and prototype.
	(drag_window): New function and prototype.
	(event_loop): Call get_global_mouse & adjust_cursor first of all.
	Rewrite handling of keystrokes and dialog events.
	Comment out redundant adjust_cursor call.
	(adjust_cursor): Add work around for Appearance Manager bug.
	(handle_event): Use MacFindWindow instead of FindWindow.
	Call drag_window instead of DragTheWindow.
	Add case inCollapseBox. Comment out case keyDown and case autoKey.
	Test for IsDialog on suspend/resume events.
	(grow_window): Add call to update_all_visible_dialogs.
	(zoom_window): Add call to update_all_visible_dialogs.
	(close_window): Call update_all_visible_dialogs instead of update_all_map_windows.
	(update_unit_display): Check if closeup is visible before updating.
	Use update_window instead of draw_unit_closeup.
	(update_unit_acp_display): Use update_window instead of draw_unit_closeup.
	(force_update): Use update_window instead of EraseRect.
	
	* macconq.h (do_key_down_list): New prototype.
	(hit_player_setup_dialog): Change prototype to return void.
	(hit_closeup_dialog): New prototype.
	(do_key_down_closeup): New prototype.
	(do_key_down_help): New prototype.
	(update_all_dialogs): New prototype.
	(update_all_visible_dialogs): New prototype.
	
	* macdefs.h (HelpButton): Define as 3.
	(mAdvancePopup): Rename to mResearchPopup.
	(diCityBuildTimes): Define as 97.
	(diCityMap): Change from 3 to 98.
	(dCloseup): Define as 810.
	(cDevelopButton): Define as 136.
	
	* macgworld.c (handle_numeric_keypad): Remove list window code.
	Remove gworld snapshot and debugger key code.
	(update_all_dialogs): New function.
	(update_all_visible_dialogs): New function.
	
	* machelp.c (create_help_window): Tweak helptopicrect.
	Use floatsbarwid instead of sbarwid everywhere.
	Tweak viewrect and vscrollrect. Call MakeFloat at end.
	(draw_help): Use floatsbarwid instead of sbarwid.
	Draw a default line around the close button.
	(help_vscroll_fn): Change jump size from 1 to 2.
	(do_key_down_help): New function.
	(grow_help): Use floatsbarwid instead of sbarwid. Tweak viewRect.
	(zoom_help): Use floatsbarwid instead of sbarwid. Tweak viewRect.
	
	* macinit.c (player_setup_dialog): Change selectedplayer from 0 to 1.
	Call MakeDialogFloat at end.
	(handle_player_setup_event): Cancel on cmd-dot.
	Add support for Return, Esc, Up arrow and Down arrow keys.
	(hit_player_setup_dialog): Change "pt" to "mouse" everywhere.
	Save and restore the graphics port.
	Call launch_game_2 directly at the end.
	
	* maclist.c (scroll_list_using_key): Remove function and prototype.
	(do_key_down_list): New function based on scroll_list_using_key.
	Remove support fort list scrolling from the numeric keypad.
	Add support for PageDown PageUp and Escape keys.
	
	* macmenus.c (city_dialog): Remove prototype.
	(global_advance_dialog): Rename prototype to side_research_dialog.
	(do_city_dialog_mi): Remove function and prototype.
	(do_menu_command): Remove City Dialog from Play menu.
	Change global_advance_dialog to side_research_dialog.
	
	* macmouse.c (city_dialog): Remove prototype.
	(do_mouse_down_map_content): Remove city dialog code.
	
	* macunit.c: New name for macadv.c. Now contains all windows
	and dialogs that refer to individual units in one place. The closeup
	code from macwins.c has been moved here and integrated with the
	advanced unit (city) closeup code. global_advance_dialog has been
	renamed to side_research_dialog and moved to macwins.c. 
	(city_dialog): Remove function and prototype.
	(draw_simple_closeup): New prototype.
	(draw_advanced_closeup): New prototype.
	(build_construction_menu): New function and prototype.
	(build_research_menu): New function and prototype.
	(unit_advance_win): New global.
	(unit_build_win): New global.
	(unit_plan_win): New global.
	(lastunitcloseuph): Move here from macwins.c.
	(lastunitcloseupv): Move here from macwins.c.
	(m_per_row): Move here from macwins.c.
	(nummrows): Move here from macwins.c.
	(closeup_spacing): Move here from macwins.c.
	(closeupwinwid):  Move here from macwins.c.
	(find_unit_closeup): Move here from macwins.c.
	(create_unit_closeup): Move here from macwins.c.
	(unit_closeup_from_window): Move here from macwins.c.
	Use dCity and dCloseup for advanced and non-advanced units.
	Use MakeDialogFloat instead of MakeFloat.
	(preferred_closeup_size): Move here from macwins.c.
	(draw_unit_closeup): First part of same function from macwins.c.
	Add test for side_sees_unit. Move update_cell_display call first.
	Call either draw_simple_closeup or draw_advanced_closeup.
	(destroy_unit_closeup): Move here from macwins.c.
	(do_mouse_down_unit_closeup): Move here from macwins.c.
	(do_key_down_closeup): New function.
	(hit_closeup_dialog): New function. Second half of old city_dialog.
	(draw_advanced_closeup): New function. First half of old city_dialog.
	Use last_task->args[3] instead of tasks->args[3] for runlength field.
	Use unit->plan->type + 1 to set the plan menu control value.
	Don't hide diCityBuildEdit. Hilite it instead.
	(draw_city_statistics): Rename to draw_closeup_content.
	Change first argument to DialogPtr. 
	Add tmprect. Enable draw_unit_size call.
	(draw_unit_size): Add support for unit closeups.
	Save and restore current font, style and size.
	(unit_advance_dialog): Rename to unit_research_dialog.
	Change mAdvancePopup to mResearchPopup.
	(global_advance_dialog): Move to macwins.c.
	
	* macwins.c (has_advance_to_research): Prototype extern.
	(get_selected_construction_advance): New function and prototype.
	(update_unit_list_for_advance): New function and prototype.
	(select_advance_in_construction_window): New function and prototype.
	(update_construction_advance_list): New function and prototype.
	(update_advance_list_for_unit): New function and prototype.
	(construction_advance_list): New global ListHandle.
	(*research_units): New global UnitVector.
	(numpossadvances): New global int.
	(*possibleadvances): New global int.
	(researchbutton): New global ControlHandle.
	(advancelistrect): New global rect.
	(lastunitcloseuph): Move to macunit.c.
	(lastunitcloseupv): Move to macunit.c.
	(m_per_row): Move to macunit.c.
	(nummrows): Move to macunit.c.
	(closeup_spacing): Move to macunit.c.
	(closeupwinwid):  Move to macunit.c.
	(create_construction_window): Handle research button and advances list.
	(init_construction_lists): Update construction_advance_list.
	(draw_construction): Update advancelistrect.
	(calc_construction_rects): Make room for construction_advance_list.
	(activate_construction): Activate construction_advance_list.
	(do_mouse_down_construction): Handle research button and advances list.
	(update_construction_unit_list): Test for can_research.
	(maybe_add_unit_to_construction_list): Test for can_research.
	(adjust_construction_controls): Add support researchbutton.
	(adjust_construction_items): Add support for construction_advance_list.
	(side_research_dialog): Move global_advance_dialog here and rename it.
	Change mAdvancePopup to mResearchPopup.
	(find_unit_closeup): Move to macunit.c.
	(create_unit_closeup): Move to macunit.c.
	(preferred_closeup_size): Move to macunit.c.
	(draw_unit_closeup): Move to macunit.c.
	(unit_closeup_from_window): Move to macunit.c.
	(do_mouse_down_unit_closeup): Move to macunit.c.
	(destroy_unit_closeup): Move to macunit.c.
	
	* XconqProj.rsrc (CNTL 129 "Research Button"): Tweak position.
	(CNTL 130 "Close Button"): Tweak position.
	(CNTL 136 "Develop Button"): New control.
	(CNTL 714 "Runlengh Popup"): New control.
	(dctb 803 "City"): Rename to "Advanced Closeup".
	(DITL 803 "City"): Rename to "Advanced Closeup". Add Help button.
	(DITL 804 "City Research"): Rename to "Unit Research".
	(DITL 807 "City Build"): Rename to "Unit Build".
	(DITL 808 "City Plan"): Rename to "Unit Plan".
	(DITL 810 "Simple Closeup"): New dialog item list.
	(DLOG 803 "City"): Rename to "Advanced Closeup".
	(DLOG 804 "City Research"): Rename to "Unit Research".
	(DLOG 807 "City Build"): Rename to "Unit Build".
	(DLOG 808 "City Plan"): Rename to "Unit Plan".
	(DLOG 810 "Simple Closeup"): New dialog.
	(ictb 803 "City"): Rename to "Advanced Closeup".
	(MENU 714 "Runlengh Popup"): New menu.
	
	* Xconq.r: Update from XconqProj.rsrc.

	* conq.h (research_desc): New prototype.
	(researchible_desc): New prototype.
	(can_research): New prototype.
	
	* kernel.h (set_unit_curadvance): New prototype.
	(set_unit_autoplan): New prototype.
	(set_unit_autoresearch): New prototype.
	(set_unit_autobuild): New prototype.
	
	* kpublic.h (net_set_unit_curadvance): New prototype.
	(net_set_unit_autoplan): New prototype.
	(net_set_unit_autoresearch): New prototype.
	(net_set_unit_autobuild): New prototype.
	
	* nlang.c (research_desc): New function.
	(researchible_desc): New function.

	* plan.c (set_unit_curadvance): New function.
	(set_unit_autoplan): New function.
	(set_unit_autoresearch): New function.
	(set_unit_autobuild): New function.
	(can_research): New function.
	
	* run.c (unit_advance_dialog): Rename to unit_research_dialog.
	(global_advance_dialog): Rename to side_research_dialog.

	* tp.c (net_set_unit_curadvance): New function.
	(net_set_unit_autoplan): New function.
	(net_set_unit_autoresearch): New function.
	(net_set_unit_autobuild): New function.
	(receive_unit_prop): Handle curadvance, autoplan, autoresearch & autobuild.
	
	* tkmain.c (unit_advance_dialog): Rename to unit_research_dialog.
	(global_advance_dialog): Rename to side_research_dialog.
	
	* xtconq.c (unit_advance_dialog): Rename to unit_research_dialog.
	(global_advance_dialog): Rename to side_research_dialog.
	
2000-02-06  Hans Ronne  <hronne@pp.sbbs.se>
	
	Fix terrain images related problems on the mac. Allocate cicns
	using xmalloc instead of hanging them at the top of the heap. Remove
	heap gymnastics code. 
	* macconq.h (interp_named_color): Remove prototype.
	(reinit_all_emblem_images): Remove prototype.
	(init_emblem_cicns): Remove prototype.
	(init_unit_cicns): Remove prototype.
	(dispose_emblem_cicns): Remove prototype.
	(dispose_unit_cicns): Remove prototype.
	* macconq.c (update_side_display): Remove argument in init_emblem_images.
	* macimf.c (mac_interp_image_1): Fix 88x96 bug. Remove special case.
	(mac_create_cicn): xmalloc cicnhandle & datahandle instead of using heap.
	(mac_init_cicn_1): Remove heap gymnastics code.
	(interp_ctab): xmalloc ctabhandle instead of using heap.
	* macinit.c: (dispose_unit_images): Prototype.
	(dispose_emblem_images): Prototype.
	(dispose_terrain_images): Prototype.
	(hit_player_setup_dialog): Call init_emblem_images instead.
	(launch_game): Call init_emblem_images instead.
	(launch_game): Remove call to init_emblem_cicns.
	(interp_named_color): Remove function.
	(reinit_all_emblem_images): Remove function.
	(reinit_all_emblem_images): Remove function.
	(reinit_all_terrain_images): Remove function.
	(init_all_emblem_images): Move content to init_emblem_images.
	(init_unit_cicns): Remove function.
	(init_emblem_cicns): Remove function.
	(init_terrain_cicns): Remove function.
	(init_unit_images): First call dispose_unit_images.
	(init_emblem_images): First call dispose_emblem_images.
	(init_terrain_images): First dispose_terrain_images.
	(dispose_unit_images): Old dispose_unit_cicns. Now also frees uimages.
	(dispose_emblem_images): Old dispose_emblem_cicns. Now also frees eimages.
	(dispose_terrain_images): New function.
	* macprefs.c (set_preferences): Call init_unit_images instead.
	* macwins.c (side_rename_dialog): Call init_emblem_images instead.

2000-01-05  Hans Ronne  <hronne@pp.sbbs.se>
	
	Fix problem with city development and upgrades in "time" game.
	* mplayer.c (review_units): Use PLAN_IMPROVING for upgrading cities.
	(assign_to_develop_on): Use PLAN_IMPROVING for developing cities.
	(assign_to_develop_on): Call net_clear_task_agenda before pushing new task.
	* plan.c (plan_improve): Call execute_task and return if we have a task.
	
	Fix bad mtype errors in non-civ2 games.
	* side.c (create_side): Initialize m to NONMTYPE.
