# Path: scene_info.py
# class SceneInfo():
#   def __init__(self,
#                file_id    = -1,
#                speaker    = -1,
#                speaking   = False,
#                sprite     = SpriteId(),
#                voice      = VoiceId(),
#                bgm        = -1,
#                headshot   = -1,
#                mode       = None,
#                special    = None,
#                box_color  = common.BOX_COLORS.orange,
#                box_type   = common.BOX_TYPES.normal,
#                ammo       = -1,
#                bgd        = -1,
#                cutin      = -1,
#                flash      = -1,
#                movie      = -1,
#                img_filter = IMG_FILTERS.unfiltered,
#                chapter    = -1,
#                scene      = -1,
#                room       = -1,
#                extra_val  = -1
#               ):
#     self.file_id    = file_id
#     
#     self.speaker    = speaker
#     self.speaking   = speaking
#     self.sprite     = sprite
#     self.voice      = voice
#     self.bgm        = bgm
#     
#     self.headshot   = headshot
#     
#     self.mode       = mode
#     self.special    = special
#     self.box_color  = box_color
#     self.box_type   = box_type
#     
#     self.ammo       = ammo
#     self.bgd        = bgd
#     self.cutin      = cutin
#     self.flash      = flash
#     self.movie      = movie
#     
#     self.img_filter = img_filter
#     
#     self.chapter    = chapter
#     self.scene      = scene
#     self.room       = room
#     
#     self.extra_val  = extra_val


import os
import re
from text_files import load_text, save_text
from scene_info import SceneInfo
### GNU General Public License for more details.
### 
### You should have received a copy of the GNU General Public License
### along with the Super Duper Script Editor.
### If not, see <http://www.gnu.org/licenses/>.
################################################################################


# import mecab_parser

# Some regexes for our enjoyment.
LINE_BREAKS = re.compile(ur"\r\n?", re.UNICODE | re.DOTALL)
TEXT_PARSER = re.compile(ur"([^\u0000\u0001]+)[\u0000\u0001]+[\n\r]*([^\[]+)?[\n\r]*(\[(.+)\])?", re.UNICODE | re.DOTALL)
TAG_KILLER  = re.compile(ur"\<CLT\>|\<CLT (?P<CLT_INDEX>\d+)\>|<DIG.*?>", re.UNICODE | re.DOTALL)

class ScriptFile():
  def __init__(self, filename = None, scene_info = None):
    self.translated = ""
    self.translated_notags = ""
    self.original = ""
    self.original_notags = ""
    self.comments = ""
    
    self.filename = None
    
    if not filename == None:
      self.open(filename)
    
      if scene_info == None:
        # Squeeze the file ID out of the filename.

# Path: scene_info.py
# class SceneInfo():
#   def __init__(self,
#                file_id    = -1,
#                speaker    = -1,
#                speaking   = False,
#                sprite     = SpriteId(),
#                voice      = VoiceId(),
#                bgm        = -1,
#                headshot   = -1,
#                mode       = None,
#                special    = None,
#                box_color  = common.BOX_COLORS.orange,
#                box_type   = common.BOX_TYPES.normal,
#                ammo       = -1,
#                bgd        = -1,
#                cutin      = -1,
#                flash      = -1,
#                movie      = -1,
#                img_filter = IMG_FILTERS.unfiltered,
#                chapter    = -1,
#                scene      = -1,
#                room       = -1,
#                extra_val  = -1
#               ):
#     self.file_id    = file_id
#     
#     self.speaker    = speaker
#     self.speaking   = speaking
#     self.sprite     = sprite
#     self.voice      = voice
#     self.bgm        = bgm
#     
#     self.headshot   = headshot
#     
#     self.mode       = mode
#     self.special    = special
#     self.box_color  = box_color
#     self.box_type   = box_type
#     
#     self.ammo       = ammo
#     self.bgd        = bgd
#     self.cutin      = cutin
#     self.flash      = flash
#     self.movie      = movie
#     
#     self.img_filter = img_filter
#     
#     self.chapter    = chapter
#     self.scene      = scene
#     self.room       = room
#     
#     self.extra_val  = extra_val


# Path: script_file.py
import os
import re
from text_files import load_text, save_text
from scene_info import SceneInfo

### GNU General Public License for more details.
### 
### You should have received a copy of the GNU General Public License
### along with the Super Duper Script Editor.
### If not, see <http://www.gnu.org/licenses/>.
################################################################################


# import mecab_parser

# Some regexes for our enjoyment.
LINE_BREAKS = re.compile(ur"\r\n?", re.UNICODE | re.DOTALL)
TEXT_PARSER = re.compile(ur"([^\u0000\u0001]+)[\u0000\u0001]+[\n\r]*([^\[]+)?[\n\r]*(\[(.+)\])?", re.UNICODE | re.DOTALL)
TAG_KILLER  = re.compile(ur"\<CLT\>|\<CLT (?P<CLT_INDEX>\d+)\>|<DIG.*?>", re.UNICODE | re.DOTALL)

class ScriptFile():
  def __init__(self, filename = None, scene_info = None):
    self.translated = ""
    self.translated_notags = ""
    self.original = ""
    self.original_notags = ""
    self.comments = ""
    
    self.filename = None
    
    if not filename == None:
      self.open(filename)
    
      if scene_info == None:
        # Squeeze the file ID out of the filename.

        scene_info = SceneInfo(file_id = int(os.path.splitext(os.path.basename(filename))[0]))