#PLEASE DO NOT REMOVE THE COMMENTS! It makes it easier to make changes to the
#books, as well as identify the version of the script in use. Thanks, Rize.

# For each occurrence of *YourAge* and *YourTexture* you have to replace this with
# the actual name of your age and your textures.

from Plasma import *
from PlasmaNetConstants import *
# Due to their length journal texts are usually stored in external Python files.
# The line below imports them. Remove this line if you do not use external journals.
from relltooJournals import *
kPublicAgeLink = 6

# Variables that can be used in BookPages:
PageStart = '<pb>'
ImgStart = '<img src="'
TransImgStart = '<img opacity=0.7 src="'
ImgEnd = '" align=center link=%d blend=alpha>'
ImgEndNoLink = '" align=center blend=alpha>'
ImgEndNoResize = '" align=center link=%d blend=alpha resize=no>'
ImgEndNoLinkNoResize = '" align=center blend=alpha resize=no>'
AlignCenter = '<p align=center>'
AlignLeft = '<p align=left>'
AlignRight = '<p align=right>'
# Variables for animated linking panels. See BikTest. Does NOT work with UU!
MovieLinkStart = '<movie src="avi\\'
MovieLinkEnd = '.bik" align=center link=%d resize=yes>'
# Retrieve local player name in case you want to fake a "personal" note
plyrName = PtGetLocalPlayer().getPlayerName()

###############################################################################
# AgeBooks Dictionary Section:                                                #
# 1 =    same names as the clickable book objects!                            #
# 2 =    book cover and margin                                                #
# 3 =    main font                                                            #
# 4 =    start book open or closed. 0 closed book, 1 open book                #
# 5 =    force owned setting. 0 off, 1 on                                     #
# 6 =    book GUI. 'BkBook' or 'bkNotebook'                                   #
# 7 =    width                                                                #
# 8 -    height                                                               #
#                                                                             #
# Notes: - The cover can have the same texture as the book object itself.     #
#        - The main font can be changed later in the BookPages definition.    #
#          If you don't need a main font (because you are changing it later), #
#          you can set an empty string.                                       #
#        - force owned: If set to 1 the code checks if the original book has  #
#          been found. A player who does not own the age will not see the     #
#          linking panel. If you need this restriction set force owned to 1.  #
#        - the 'bkBahroRockBook' GUI should work as well but it may not be a  #
#          good idea to use it with this multi-page template.                 #
###############################################################################

AgeBooks = {
    'VisitorBook':(
        '<cover src="BookCover.jpg"><margin right=32 left=42>',
        '<font size=12 face=Arial color=000000>',
        0, 0, 'bkNotebook', 1.0, 1.0,
    ),

    'JamesJournal':(
        '<cover src="jamesjournal_cover"><margin right=32 left=52>',
        '<font size=12 face=Arial color=000000>',
        0, 0, 'bkNotebook', 1.0, 1.0,
    ),
    
    'NexusLinkBook':(
        '<cover src="NexusBookMat"><margin right=32 left=42>',
        '<font size=12 face=Arial color=000000>',
        1, 0, 'bkBook', 1.0, 1.0,
    ),
    
    'FTLinkBook':(
        '<cover src="NexusBookMat"><margin right=32 left=42>',
        '<font size=12 face=Arial color=000000>',
        1, 0, 'bkBook', 1.0, 1.0,
    ),
}

###############################################################################################
# BookPages Dictionary Section:                                                               #
# 1 =    Same names as link destinations!                                                     #
# 2 =    The page layout: for linking books insert the name of your linking panel image here. #
#        This can be a seperate texture in your age prp file on a hidden Blender object.      #
#        (or use PRP Explorer to add a plain texture to the prp without modeling an object)   #
#        Once you get the hang of this you can mix and match layouts into your pages.         #
#                                                                                             #
# Notes: - AlignCenter is used to center text, for example to place below a linking panel.    #
#        - Use ImgEndNoLink to add images without a hotspot.                                  #
###############################################################################################

BookPages = {
    'relltooJournal': (DefrelltooJournal),
    'relltooJamesJournalpages': (DefJamesJournal),
    'NexusLinkPage': (PageStart + ImgStart + 'NexusLinkImage' + ImgEnd + AlignCenter),
    'FTLinkPage': (PageStart + ImgStart + 'FTLinkImage' + ImgEnd + AlignCenter)
}

###############################################################################
# LinkDestinations Dictionary Section:                                        #
# 1 =    Same names as book pages!                                            #
# 2 =    age name                                                             #
# 3 =    spawnpoint                                                           #
# 4 =    spawnpoint title                                                     #
# 5 =    linkingrule                                                          #
#                                                                             #
# Notes: - Variables for journals are dummies and must be set to None.        #
#        - Spawnpoint title None is only allowed for LinkInPointDefault       #
#          (although it would be better to set it to 'Default')               #
#          CleftFissureDrop in this example will fail due to a missing title  #
#          (the correct title is 'FissureDrop')                               #
#        - You can tie special actions to linking panels or other journal     #
#          images by defining only the age name. The other definitions must   #
#          be set to None (see 'CleftSpecial')                                #
#        - Linkingrules are only relevant for the online game. They are:      #
#            0 = PtLinkingRules.kBasicLink                                    #
#            1 = PtLinkingRules.kOriginalBook                                 #
#            2 = PtLinkingRules.kSubAgeBook                                   #
#            3 = PtLinkingRules.kOwnedBook                                    #
#            4 = PtLinkingRules.kVisitBook                                    #
#            5 = PtLinkingRules.kChildAgeBook                                 #
#          The offline game will treat all of these as kOriginalBook          #
#        - A new linkingrule is defined here for special (online) purposes:   #
#            6 = kPublicAgeLink                                               #
#          Use it without the prefix PtLinkingRules.                          #
###############################################################################

LinkDestinations = {
    'relltooJournal': (None, None, None, None),
    'relltooJamesJournalpages': (None, None, None, None),
    'NexusLinkPage': ('Nexus', 'LinkInPointDefault', None, PtLinkingRules.kOriginalBook),
    'FTLinkPage': ('City', 'LinkInPointDefault', None, PtLinkingRules.kOriginalBook)
}

