Module: Studio::Text

Defined in:
docs/3_Studio.rb

Overview

Module that helps the game to get text in various langages

Author:

  • Nuri Yuri

Constant Summary collapse

Available_Langs =

List of lang id available in the game

Configs.language.choosable_language_code
CSV_BASE =

Base index of pokemon text in csv files

100_000
VD_TEXT_FILENAME =

Name of the file containing all the dialogs

'Data/2.dat'

Class Method Summary collapse

Class Method Details

.build_dialog_from_csv_rows(rows, lang_index) ⇒ Array<String>

Build the text array from the csv rows

Parameters:

  • rows (Array)
  • lang_index (Integer)

Returns:



216
217
# File 'docs/3_Studio.rb', line 216

def build_dialog_from_csv_rows(rows, lang_index)
end

.compile

Marshalize the dialogs



219
220
# File 'docs/3_Studio.rb', line 219

def compile
end

.compile_csv(filename)

Compile a single csv file

Parameters:

  • filename (String) —

    name of the csv file



223
224
# File 'docs/3_Studio.rb', line 223

def compile_csv(filename)
end

.default_lang ⇒ String

Return the default game lang

Returns:



176
177
# File 'docs/3_Studio.rb', line 176

def default_lang
end

.get(file_id, text_id) ⇒ String

Get a text front the text database

Parameters:

  • file_id (Integer) —

    ID of the text file

  • text_id (Integer) —

    ID of the text in the file

Returns:



182
183
# File 'docs/3_Studio.rb', line 182

def get(file_id, text_id)
end

.get_dialog_message(file_id, text_id) ⇒ String Also known as: get_external

Get a dialog message

Parameters:

  • file_id (Integer) —

    id of the dialog file

  • text_id (Integer) —

    id of the dialog message in the file (0 = 2nd line of csv, 1 = 3rd line of csv)

Returns:



193
194
# File 'docs/3_Studio.rb', line 193

def get_dialog_message(file_id, text_id)
end

.get_file(file_id) ⇒ Array<String>

Get a list of text from the text database

Parameters:

  • file_id (Integer) —

    ID of the text file

Returns:

  • (Array<String>) —

    the list of text contained in the file.



187
188
# File 'docs/3_Studio.rb', line 187

def get_file(file_id)
end

.load

load text in the correct lang ($options.language or LANG in game.ini)



172
173
# File 'docs/3_Studio.rb', line 172

def load
end

.marshalized_text_file_exist?(filename) ⇒ Boolean

Test if a marshalized text file exist

Parameters:

  • filename (String) —

    name of the file in Data/text/Dialogs

Returns:

  • (Boolean)


205
206
# File 'docs/3_Studio.rb', line 205

def marshalized_text_file_exist?(filename)
end

.reload_rh_texts

Reload texts from Ruby Host



226
227
# File 'docs/3_Studio.rb', line 226

def reload_rh_texts
end

.try2get_csv_dialog(file_id) ⇒ Boolean

Try to load a csv dialog file

Parameters:

  • file_id (Integer) —

    id of the dialog file

Returns:

  • (Boolean) —

    if the operation was a success



210
211
# File 'docs/3_Studio.rb', line 210

def try2get_csv_dialog(file_id)
end

.try2get_marshalized_dialog(file_id) ⇒ Boolean

Try to load a preprocessed dialog file (Marshal)

Parameters:

  • file_id (Integer) —

    id of the dialog file

Returns:

  • (Boolean) —

    if the operation was a success



200
201
# File 'docs/3_Studio.rb', line 200

def try2get_marshalized_dialog(file_id)
end