This is a base class for custom converter windows. More...
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... | |
This is a base class for custom converter windows.
|
protectedvirtual |
|
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.
|
protectedvirtual |
Copies the source to the dialogue database.
You must implement this. You can use the helper methods LoadSourceFile(), IsSourceAtEnd(), PeekNextSourceLine(), and GetNextSourceLine().
database | Database. |
Reimplemented in PixelCrushers.DialogueSystem.CSVConverterWindow.
|
protectedvirtual |
Draws the Clear button that clears the prefs.
|
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".
|
protectedvirtual |
Draws the conversion buttons.
You can override this to change what buttons are drawn.
|
protectedvirtual |
Draws the Convert button that calls Convert().
|
protectedvirtual |
Draws the dialogue database save-to filename.
|
protectedvirtual |
Draws the destination section.
You can override this if you want to draw more than the default controls.
Reimplemented in PixelCrushers.DialogueSystem.CSVConverterWindow.
|
protectedvirtual |
Draws the encoding type popup.
|
protectedvirtual |
Draws the output folder selection field.
|
protectedvirtual |
Draws the overwrite checkbox, and merge checkbox if overwrite is ticked.
|
protectedvirtual |
Draws the source section.
You can override this if you want to draw more than the Source File selection field.
|
protectedvirtual |
Finds an actor's portrait texture.
actor | Actor. |
portraitFolder | Portrait folder. |
|
protectedvirtual |
Finds the actors' portrait textures, given a source portrait folder.
database | Database. |
portraitFolder | Portrait folder. |
|
protectedvirtual |
Gets the next source line and removes it from the buffer.
|
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.
true
if this instance is ready to convert; otherwise, false
.
|
protectedvirtual |
Determines whether the source is assigned.
Override this if, for example, your converter pulls from more than one source file.
true
if this instance is source assigned; otherwise, false
.
|
protectedvirtual |
Determines whether the source data's memory buffer is at the end.
true
if source at end; otherwise, false
.
|
protectedvirtual |
Loads the dialogue database if it already exists and overwrite is ticked; otherwise creates a new one.
filename | Asset filename. |
|
protectedvirtual |
|
protectedvirtual |
Loads the source file into memory.
Reimplemented in PixelCrushers.DialogueSystem.CSVConverterWindow.
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Peeks the next source line without removing it from the buffer.
|
protectedvirtual |
|
protectedvirtual |
Sets a conversation's START entry's Sequence to None().
conversation | Conversation. |
|
protectedvirtual |
Sets the START dialogue entries' Sequences to None().
database | 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.
database | Database. |
|
protected |
The prefs for the converter window.
|
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.
|
protected |
The source lines.
|
protected |
A reference to the Dialogue System template, used to create new dialogue database assets such as Actors, Items, and Conversations.
|
get |
The line number in the source file of the current source line.
|
get |
The most recent line retrieved through the GetNextSourceLine() method.
|
get |
Gets the EditorPrefs key to save the converter window's settings under.
The EditorPrefs key.
|
get |
Gets the source file extension.
The source file extension (e.g., 'xml' for XML files).