PixelCrushers.DialogueSystem.AbstractConverterWindow Class Reference

This is a base class for custom converter windows. More...

Inheritance diagram for PixelCrushers.DialogueSystem.AbstractConverterWindow:
Collaboration diagram for PixelCrushers.DialogueSystem.AbstractConverterWindow:

Classes

class  Prefs
 This is the base prefs (converter window settings) class. More...
 

Public Member Functions

virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void OnGUI ()
 

Protected Member Functions

virtual void ClearPrefs ()
 
virtual void LoadPrefs ()
 
virtual void SavePrefs ()
 
virtual void DrawControls ()
 Draws the contents of the converter window. More...
 
virtual void DrawSourceSection ()
 Draws the source section. More...
 
virtual void DrawDestinationSection ()
 Draws the destination section. More...
 
virtual void DrawOutputFolder ()
 Draws the output folder selection field. More...
 
virtual void DrawDatabaseFilename ()
 Draws the dialogue database save-to filename. More...
 
virtual void DrawEncodingPopup ()
 Draws the encoding type popup. More...
 
virtual void DrawOverwriteCheckbox ()
 Draws the overwrite checkbox, and merge checkbox if overwrite is ticked. More...
 
virtual void DrawConversionButtons ()
 Draws the conversion buttons. More...
 
virtual void DrawClearButton ()
 Draws the Clear button that clears the prefs. More...
 
virtual void DrawConvertButton ()
 Draws the Convert button that calls Convert(). More...
 
virtual bool IsReadyToConvert ()
 Determines whether the window is ready to convert. More...
 
virtual bool IsSourceAssigned ()
 Determines whether the source is assigned. More...
 
virtual void Convert ()
 Converts the source into a dialogue database. More...
 
virtual DialogueDatabase LoadOrCreateDatabase ()
 Loads the dialogue database if it already exists and overwrite is ticked; otherwise creates a new one. More...
 
virtual void TouchUpDialogueDatabase (DialogueDatabase database)
 Touches up dialogue database after conversion. More...
 
virtual void SetStartCutscenesToNone (DialogueDatabase database)
 Sets the START dialogue entries' Sequences to None(). More...
 
virtual void SetConversationStartCutsceneToNone (Conversation conversation)
 Sets a conversation's START entry's Sequence to None(). More...
 
virtual void FindPortraitTextures (DialogueDatabase database, string portraitFolder)
 Finds the actors' portrait textures, given a source portrait folder. More...
 
virtual void FindPortraitTexture (Actor actor, string portraitFolder)
 Finds an actor's portrait texture. More...
 
virtual void CopySourceToDialogueDatabase (DialogueDatabase database)
 Copies the source to the dialogue database. More...
 
virtual void LoadSourceFile ()
 Loads the source file into memory. More...
 
virtual bool IsSourceAtEnd ()
 Determines whether the source data's memory buffer is at the end. More...
 
virtual string PeekNextSourceLine ()
 Peeks the next source line without removing it from the buffer. More...
 
virtual string GetNextSourceLine ()
 Gets the next source line and removes it from the buffer. More...
 

Protected Attributes

Prefs prefs = null
 The prefs for the converter window. More...
 
Template template = null
 A reference to the Dialogue System template, used to create new dialogue database assets such as Actors, Items, and Conversations. More...
 
Vector2 scrollPosition = Vector2.zero
 The current scroll position of the converter window. More...
 
List< string > sourceLines = new List<string>()
 The source lines. More...
 

Properties

virtual string SourceFileExtension [get]
 Gets the source file extension. More...
 
virtual string PrefsKey [get]
 Gets the EditorPrefs key to save the converter window's settings under. More...
 
string currentSourceLine [get]
 The most recent line retrieved through the GetNextSourceLine() method. More...
 
int currentLineNumber [get]
 The line number in the source file of the current source line. More...
 

Detailed Description

This is a base class for custom converter windows.

Member Function Documentation

◆ ClearPrefs()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.ClearPrefs ( )
protectedvirtual

◆ Convert()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.Convert ( )
protectedvirtual

Converts the source into a dialogue database.

This method does housekeeping such as creating the empty asset and saving it at the end, but the main work is done in the CopySourceToDialogueDatabase() method that you must implement.

◆ CopySourceToDialogueDatabase()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.CopySourceToDialogueDatabase ( DialogueDatabase  database)
protectedvirtual

Copies the source to the dialogue database.

You must implement this. You can use the helper methods LoadSourceFile(), IsSourceAtEnd(), PeekNextSourceLine(), and GetNextSourceLine().

Parameters
databaseDatabase.

Reimplemented in PixelCrushers.DialogueSystem.CSVConverterWindow.

◆ DrawClearButton()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawClearButton ( )
protectedvirtual

Draws the Clear button that clears the prefs.

◆ DrawControls()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawControls ( )
protectedvirtual

Draws the contents of the converter window.

You can override this if you want to draw more than the "source section" and "destination section".

◆ DrawConversionButtons()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawConversionButtons ( )
protectedvirtual

Draws the conversion buttons.

You can override this to change what buttons are drawn.

◆ DrawConvertButton()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawConvertButton ( )
protectedvirtual

Draws the Convert button that calls Convert().

◆ DrawDatabaseFilename()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawDatabaseFilename ( )
protectedvirtual

Draws the dialogue database save-to filename.

◆ DrawDestinationSection()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawDestinationSection ( )
protectedvirtual

Draws the destination section.

You can override this if you want to draw more than the default controls.

Reimplemented in PixelCrushers.DialogueSystem.CSVConverterWindow.

◆ DrawEncodingPopup()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawEncodingPopup ( )
protectedvirtual

Draws the encoding type popup.

◆ DrawOutputFolder()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawOutputFolder ( )
protectedvirtual

Draws the output folder selection field.

◆ DrawOverwriteCheckbox()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawOverwriteCheckbox ( )
protectedvirtual

Draws the overwrite checkbox, and merge checkbox if overwrite is ticked.

◆ DrawSourceSection()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.DrawSourceSection ( )
protectedvirtual

Draws the source section.

You can override this if you want to draw more than the Source File selection field.

◆ FindPortraitTexture()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.FindPortraitTexture ( Actor  actor,
string  portraitFolder 
)
protectedvirtual

Finds an actor's portrait texture.

Parameters
actorActor.
portraitFolderPortrait folder.

◆ FindPortraitTextures()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.FindPortraitTextures ( DialogueDatabase  database,
string  portraitFolder 
)
protectedvirtual

Finds the actors' portrait textures, given a source portrait folder.

Parameters
databaseDatabase.
portraitFolderPortrait folder.

◆ GetNextSourceLine()

virtual string PixelCrushers.DialogueSystem.AbstractConverterWindow.GetNextSourceLine ( )
protectedvirtual

Gets the next source line and removes it from the buffer.

Returns
The next source line.

◆ IsReadyToConvert()

virtual bool PixelCrushers.DialogueSystem.AbstractConverterWindow.IsReadyToConvert ( )
protectedvirtual

Determines whether the window is ready to convert.

Override this if you need to check more than the source, output folder, and database filename.

Returns
true if this instance is ready to convert; otherwise, false.

◆ IsSourceAssigned()

virtual bool PixelCrushers.DialogueSystem.AbstractConverterWindow.IsSourceAssigned ( )
protectedvirtual

Determines whether the source is assigned.

Override this if, for example, your converter pulls from more than one source file.

Returns
true if this instance is source assigned; otherwise, false.

◆ IsSourceAtEnd()

virtual bool PixelCrushers.DialogueSystem.AbstractConverterWindow.IsSourceAtEnd ( )
protectedvirtual

Determines whether the source data's memory buffer is at the end.

Returns
true if source at end; otherwise, false.

◆ LoadOrCreateDatabase()

virtual DialogueDatabase PixelCrushers.DialogueSystem.AbstractConverterWindow.LoadOrCreateDatabase ( )
protectedvirtual

Loads the dialogue database if it already exists and overwrite is ticked; otherwise creates a new one.

Returns
The database.
Parameters
filenameAsset filename.

◆ LoadPrefs()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.LoadPrefs ( )
protectedvirtual

◆ LoadSourceFile()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.LoadSourceFile ( )
protectedvirtual

Loads the source file into memory.

Reimplemented in PixelCrushers.DialogueSystem.CSVConverterWindow.

◆ OnDisable()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.OnDisable ( )
virtual

◆ OnEnable()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.OnEnable ( )
virtual

◆ OnGUI()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.OnGUI ( )
virtual

◆ PeekNextSourceLine()

virtual string PixelCrushers.DialogueSystem.AbstractConverterWindow.PeekNextSourceLine ( )
protectedvirtual

Peeks the next source line without removing it from the buffer.

Returns
The next source line.

◆ SavePrefs()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.SavePrefs ( )
protectedvirtual

◆ SetConversationStartCutsceneToNone()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.SetConversationStartCutsceneToNone ( Conversation  conversation)
protectedvirtual

Sets a conversation's START entry's Sequence to None().

Parameters
conversationConversation.

◆ SetStartCutscenesToNone()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.SetStartCutscenesToNone ( DialogueDatabase  database)
protectedvirtual

Sets the START dialogue entries' Sequences to None().

Parameters
databaseDatabase.

◆ TouchUpDialogueDatabase()

virtual void PixelCrushers.DialogueSystem.AbstractConverterWindow.TouchUpDialogueDatabase ( DialogueDatabase  database)
protectedvirtual

Touches up dialogue database after conversion.

This base version sets the START dialogue entries' Sequence fields to None(). Override this method if you want to do something different.

Parameters
databaseDatabase.

Member Data Documentation

◆ prefs

Prefs PixelCrushers.DialogueSystem.AbstractConverterWindow.prefs = null
protected

The prefs for the converter window.

◆ scrollPosition

Vector2 PixelCrushers.DialogueSystem.AbstractConverterWindow.scrollPosition = Vector2.zero
protected

The current scroll position of the converter window.

If the contents of the window are larger than the current window size, the user can scroll up and down.

◆ sourceLines

List<string> PixelCrushers.DialogueSystem.AbstractConverterWindow.sourceLines = new List<string>()
protected

The source lines.

◆ template

Template PixelCrushers.DialogueSystem.AbstractConverterWindow.template = null
protected

A reference to the Dialogue System template, used to create new dialogue database assets such as Actors, Items, and Conversations.

Property Documentation

◆ currentLineNumber

int PixelCrushers.DialogueSystem.AbstractConverterWindow.currentLineNumber
get

The line number in the source file of the current source line.

◆ currentSourceLine

string PixelCrushers.DialogueSystem.AbstractConverterWindow.currentSourceLine
get

The most recent line retrieved through the GetNextSourceLine() method.

◆ PrefsKey

virtual string PixelCrushers.DialogueSystem.AbstractConverterWindow.PrefsKey
get

Gets the EditorPrefs key to save the converter window's settings under.

The EditorPrefs key.

◆ SourceFileExtension

virtual string PixelCrushers.DialogueSystem.AbstractConverterWindow.SourceFileExtension
get

Gets the source file extension.

The source file extension (e.g., 'xml' for XML files).


The documentation for this class was generated from the following file: