Exemplo n.º 1
0
def save_options(file_name):
    """
    Saves the options into a file

    :param file_name:
    """

    # write to file
    utils.write_to_file(file_name, options)
Exemplo n.º 2
0
            'offset': [421, 459],
            'label': 'Game Lobby'
        },
        'editor': {
            'overlay': 'start.overlay.map.png',
            'offset': [821, 60],
            'label': 'Scenario Editor'
        },
        'options': {
            'overlay': 'start.overlay.fireplace.png',
            'offset': [832, 505],
            'label': 'Preferences'
        }
    }

    # exit

    # help browser

    # game lobby

    # editor

    # options

    # write
    file_name = os.path.join(constants.GRAPHICS_UI_FOLDER,
                             'start.overlay.info')
    print('write to {}'.format(file_name))
    utils.write_to_file(file_name, map)
    rules['workforce_action_cursors'] = workforce_action_cursors

    structure_settings = {
        StructureType.WAREHOUSE.value: {
            'name': 'Warehouse',
            'texture_filename': 'engineer.warehouse.png'
        },
        StructureType.FARM_ELEVATOR.value: {
            'name': 'Elevator',
            'texture_filename': 'farmer.elevator.png'
        },
        StructureType.LOGGING.value: {
            'name': 'Logging',
            'texture_filename': 'forester.logging.png'
        },
        StructureType.MINE.value: {
            'name': 'Mine',
            'texture_filename': 'miner.mine.png'
        },
        StructureType.RANCH.value: {
            'name': 'Ranch',
            'texture_filename': 'rancher.ranch.png'
        }
    }
    rules['structure_settings'] = structure_settings

    # save
    file = constants.SCENARIO_RULESET_STANDARD_FILE
    print('write to {}'.format(file))
    utils.write_to_file(file, rules)
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>
"""
Generate the default scenario client configuration file.
"""

import os, sys

if __name__ == '__main__':

    # add source directory to path if needed
    source_directory = os.path.realpath(
        os.path.join(os.path.abspath(os.path.dirname(__file__)),
                     os.path.pardir, 'source'))
    if source_directory not in sys.path:
        sys.path.insert(0, source_directory)

    from imperialism_remake.lib import utils
    from imperialism_remake.base import constants

    config = {constants.ClientConfiguration.OVERVIEW_WIDTH: 300}

    # save
    file = constants.SCENARIO_CLIENT_STANDARD_FILE
    print('write to {}'.format(file))
    utils.write_to_file(file, config)
Exemplo n.º 5
0
# along with this program.  If not, see <http://www.gnu.org/licenses/>
"""
Generates the playlist of the soundtrack (file names and titles displayed
in the game).

Phonon cannot read metadata under Windows sometimes, see:
http://stackoverflow.com/questions/23288557/phonon-cant-get-meta-data-of-audio-files-in-python
"""

import os, sys

if __name__ == '__main__':

    # add source directory to path if needed
    source_directory = os.path.realpath(
        os.path.join(os.path.abspath(os.path.dirname(__file__)),
                     os.path.pardir, 'source'))
    if source_directory not in sys.path:
        sys.path.insert(0, source_directory)

    from imperialism_remake.lib import utils
    from imperialism_remake.base import constants

    # create the playlist, a list of (filename, title)
    playlist = [['01 Imperialism Theme.ogg', 'Imperialism Theme']]
    playlist.append(['02 Silent Ashes.ogg', 'Silent Ashes'])

    # write
    print('write to {}'.format(constants.SOUNDTRACK_INFO_FILE))
    utils.write_to_file(constants.SOUNDTRACK_INFO_FILE, playlist)