Code: Select all
on exportToHtml
global tMainArrayInc
global tPassDocNumber
global tMainArray
global tMapAreaParses
global tAdventureName
ask "Please name your adventure"
put it into tAdventureName
--Creates folders main html and mainmap description files
do "create folder " & quote & tAdventureName & quote
do "create folder " & quote & tAdventureName & "/docs" & quote
do "create folder " & quote & tAdventureName & "/docs/maps" & quote
put "<HTML>"& cr &"<HEAD> "& cr &"</HEAD> "& cr &"<FRAMESET rows=" & quote & ",66%,33%" & quote & "> "& cr &"<FRAMESET cols=" & quote & "66%,33%" & quote & ">"& cr &"<FRAME src =" & quote & "docs/mainmap.html" & quote & " name=" & quote & "map" & quote & ">"& cr &"<FRAME src =" & quote & "docs/mainmapnotes.html" & quote & " name=" & quote & "notes" & quote & ">"& cr &"</FRAMESET>"& cr &"<FRAME src = " & quote & "docs/mainmapdmnotes.html" & quote & " name=" & quote & "dmnotes" & quote & ">"& cr &"</FRAMESET>"& cr &"<BODY>"& cr &"</BODY>"& cr &"</HTML>" into tIndex
put tIndex into url ("file:" & tAdventureName & "/"& tAdventureName & ".html")
put "<HTML>"& cr &"<HEAD>"& cr &"</HEAD>"& cr &"<BODY background=" & quote & "bg.jpg"& quote &">" into tNotesHead
put "</BODY>"& cr &"</HTML>" into tNotesFoot
put tNotesHead & tMainArray[mainmapnotes] & tNotesFoot into url ("file:" & tAdventureName & "/docs/MainmapNotes.html")
put tNotesHead & tMainArray[mainmapdmnotes] & tNotesFoot into url ("file:" & tAdventureName & "/docs/MainmapDMNotes.html")
do "revCopyFile " & quote & "images\bg.jpg" & quote & ", " & quote & tAdventureName & "\docs\bg.jpg" & quote
--Creates Map Html Documents
repeat with x =1 to the value of tMainArrayInc
do "put tMainArray[" & x & "][tParentName] into tDocName"
do "put tMainArray[" & x & "][mapfile] into tMapLoc"
put "<HTML>"& cr &"<HEAD> "& cr &"</HEAD>"& cr &"<BODY background=" & quote &"bg.jpg" & quote &">"& cr &"<IMG SRC=" & quote & "maps\" & tDocName & ".jpg" & quote &" USEMAP=" & quote &"#" & tDocName & quote &" BORDER=" & quote &"0" & quote &">"& cr &"<MAP NAME=" & quote & tDocName & quote &">" into tHtmlHead
put "</MAP>" & cr & "<BODY>"& cr &"</BODY>"& cr &"</HTML>" into tHtmlFoot
do "revCopyFile " & quote & tMapLoc & quote & "," & quote & tAdventureName & "\docs\maps\" & tDocName &".jpg" & quote
put x into tPassDocNumber
parseMapAreas
parseNotes
--Combines all parts of map and writes it to html document
put tHtmlHead & tMapAreaParses & tHtmlFoot into url ("file:" & tAdventureName & "/docs/" & tDocName & ".html")
end repeat
end exportToHtml