##############################################################################
#
# This is the Infernal Contractor II configuration file, and may be edited to
# control game options.  If damaged, a backup can be found in the same
# directory, named start_backup.txt.
#
##############################################################################

##############################################################################
#
# This file contains original work by Andy Southgate.  Contact details can be
# found at http://www.mushware.co.uk.  This file was placed in the Public
# Domain by Andy Southgate and Mushware Limited in 2002.
#
# This software carries NO WARRANTY of any kind.
#
##############################################################################
#
# $Id: start.txt,v 1.44 2003/04/13 11:25:09 southa Exp $
# $Log: start.txt,v $
# Revision 1.44  2003/04/13 11:25:09  southa
# Pre-release tweaks
#
# Revision 1.43  2003/04/06 12:35:23  southa
# Fixes for release
#
# Revision 1.42  2003/03/10 21:57:10  southa
# ic2 revisions
#
# Revision 1.41  2003/01/13 23:05:21  southa
# Mustl test application
#
# Revision 1.40  2002/12/14 15:04:33  southa
# Mustl fixes
#
# Revision 1.39  2002/11/27 13:23:26  southa
# Server and client data exchange
#
# Revision 1.38  2002/11/25 18:02:55  southa
# Mushware ID work
#
# Revision 1.37  2002/11/24 22:32:42  southa
# Host and join displays
#
# Revision 1.36  2002/11/24 12:57:02  southa
# Added configuration host protection
#
# Revision 1.35  2002/11/22 11:42:05  southa
# Added developer controls
#
# Revision 1.34  2002/11/21 18:06:17  southa
# Non-blocking network connection
#
# Revision 1.33  2002/11/20 22:35:25  southa
# Multiplayer setup
#
# Revision 1.32  2002/11/17 13:38:30  southa
# Game selection
#
# Revision 1.31  2002/11/15 18:58:33  southa
# Configuration mode
#
# Revision 1.30  2002/11/14 20:24:43  southa
# Configurable config elements
#
# Revision 1.29  2002/11/14 17:29:07  southa
# Config database
#
# Revision 1.28  2002/11/07 00:53:34  southa
# localweb work
#
# Revision 1.27  2002/10/17 15:50:58  southa
# Config saving, pause and quit
#
# Revision 1.26  2002/10/17 12:35:29  southa
# Save path and update check
#
# Revision 1.25  2002/10/14 15:12:31  southa
# Frame rate tweaks for Mac
#
# Revision 1.24  2002/10/12 11:22:20  southa
# GraphicModel work
#
# Revision 1.23  2002/10/11 20:10:14  southa
# Various fixes and new files
#
# Revision 1.22  2002/10/06 22:09:58  southa
# Initial lighting test
#
# Revision 1.21  2002/09/07 09:54:01  southa
# Tweaks to Mandrake RPM
#
# Revision 1.20  2002/09/03 10:34:38  southa
# Converted save path to Unix
#
# Revision 1.19  2002/09/01 22:00:38  southa
# Moved to real install paths
#
# Revision 1.18  2002/09/01 16:29:18  southa
# Support Redhat paths for include files
#
# Revision 1.17  2002/08/26 17:54:06  southa
# Reduce display to 640x480 medium ready for release
#
# Revision 1.16  2002/08/24 15:02:44  southa
# Removed dodgy line endings
#
# Revision 1.15  2002/08/22 10:33:05  southa
# Added GLOBAL_SAVE_PATH
#
# Revision 1.14  2002/08/09 17:09:02  southa
# GameDialogue added
#
# Revision 1.13  2002/08/07 11:48:23  southa
# Preparation for release 0.0.3
#
# Revision 1.12  2002/07/31 16:27:15  southa
# Collision checking work
#
# Revision 1.11  2002/07/19 18:35:02  southa
# More texture tweaks
#
# Revision 1.10  2002/07/19 15:44:39  southa
# Graphic optimisations
#
# Revision 1.9  2002/07/16 17:48:06  southa
# Collision and optimisation work
#
# Revision 1.8  2002/07/10 18:17:58  southa
# Prelude to release 0_0_2
#
# Revision 1.7  2002/07/08 16:02:24  southa
# Contract design
#
# Revision 1.6  2002/07/08 14:22:02  southa
# Rotated desks
#
# Revision 1.5  2002/07/08 11:18:06  southa
# Graphic handling for desks
#
# Revision 1.4  2002/07/07 13:44:18  southa
# Screen size config variables
#
# Revision 1.3  2002/07/07 13:25:56  southa
# Template designer
#
# Revision 1.2  2002/07/02 15:48:29  southa
# Floor map designer
#

# Change the paths here if you detach the application from its data directory

# On entry APPLPATH is set to the directory above the one the executable is in
# configset("APPLPATH","/usr/local/bin/ic2")

configset("CONTRACT_ROOT",$APPLPATH+"/contracts")
configset("GLOBAL_SPACES_PATH",$APPLPATH+"/spaces") 
configset("GLOBAL_PIXELS_PATH",$APPLPATH+"/pixels") 
configset("GLOBAL_WAVES_PATH",$APPLPATH+"/waves") 
configset("SYSTEM_PATH",$APPLPATH+"/system") 
configset("MUSTL_WEB_PATH",$APPLPATH+"/localweb") 
 
# Find somewhere to save our files
setsavepath(".ic2", $HOME, $SYSTEM_PATH, "/tmp")
updatecheck

# Set configuration file path
configset("CONFIG_FILENAME", $GLOBAL_SAVE_PATH+"/config.xml")

# Options for DISPLAY_QUALITY are low, medium or high
configset("DISPLAY_QUALITY", "medium")

# Network setup
configset('NET_DEFAULT_PORT', 9144)
configset('WEB_DEFAULT_PORT', 7200)

# Mutate the application into a game
game

# Read the contracts directory
readdirectorytomenu('SP_CONTRACT_MENU', $CONTRACT_ROOT, '^(?!dev-)')
readdirectorytomenu('MP_CONTRACT_MENU', $CONTRACT_ROOT, '^mp-')

# Add config elements
configvalueadd('displaymode', 0, 0, 0)
configstringadd('displayquality','medium', 'low=Low&medium=Medium&high=High')
configstringadd('displaylighting', 'dynamic', 'none=None&dynamic=Dynamic')
configstringadd('networkperms', 'normal', 'none=None&normal=Normal&debug=Debug')
configstringadd('networkspeed', '56k', '56k=56k Modem&cable=Cable/DSL&t1=LAN/T1/Infinite')
configstringadd('httpproxy', '')
configstringadd('configperms', 'local', 'local=Allow Localhost&all=Allow All')
configstringadd('configextra', '')
configvalueadd('configport', $WEB_DEFAULT_PORT, 512, 65536)
configvalueadd('multiport', $NET_DEFAULT_PORT, 0, 65536)
configbooladd('savepasswords', 1)

# Add log control elements
mustlconfigbool('mustlnetlog', 0)
mustlconfigbool('mustlweblog', 0)
mustlconfigbool('mustlverboselog', 0)
mustlconfigbool('mustltrafficlog', 0)
mustlconfigbool('mustlcommandlog', 0)
mustlconfigbool('mustllogfullip', 0)

# Add MP window elements
configstringadd('mpplayername', 'localplayer')
configpasswordadd('mpplayerpassword', '')
configstringadd('mpjoinserver', 'localhost')
configstringadd('mpservername', 'Anonymous server')
configstringadd('mpservermessage', '')
configvalueadd('mpjoinport', $NET_DEFAULT_PORT, 0, 65536)
configvalueadd('mpplayerlimit', 4, 1, 16)
 
# Add level choice elements
configstringadd('spcontractname', '', $SP_CONTRACT_MENU)
configstringadd('mpcontractname', '', $MP_CONTRACT_MENU)

# Tweak the config values
gameconfigspecial

# Load up the config
configload($CONFIG_FILENAME)

# Load the system font
loadfontmap('font-system1',$GLOBAL_PIXELS_PATH+'/font-mono1.tiff',8,12,337,768)

