"""
Copyright 2001-2002 Andrew Jones

This file is part of Pyzzle.

    Pyzzle is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    Pyzzle is distributed in the hope that it will be useful,
    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 Pyzzle; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


"""

#sound functions

import pygame, os, gfx, nodedata, paths
from pygame.locals import *

def change(newfile):
    currentview = nodedata.currentslide
    currentview.slidefile = newfile
    file = os.path.join(paths.current_slide_path, newfile)
    gfx.showslide(file)
    
    if currentview != None:
        currentview.file = newfile

def changecustmap(pos,newmap):
    currentview = nodedata.currentslide
    if currentview != None:
        if nodedata.hastype('custom'):
           currentview.custmaps[pos] = newmap

def changestate(pos,newstate):
    currentview = nodedata.currentslide
    if currentview != None:
        if nodedata.hastype('state'):
            currentview.state[pos] = newstate

