#--------------------------------------------------------------------------
# * Main Database
#--------------------------------------------------------------------------
alias_method :trick_aibc_title_main_database, :main_database
def main_database
# The Usual
trick_aibc_title_main_database
# Setup Load Commands Flag
@load_commands = true
# Load Command Data
load_command_data
# If Load Commands Flag
if @load_commands
# IF Save Data Option
if Battle_Command_Setup::Save_Data
# Save a copy
save_data($data_commands, "Data/Commands.rxdata")
end
# Project Encrypted
else
# Load from Data Commands
$data_commands = load_data("Data/Commands.rxdata")
end
end
#--------------------------------------------------------------------------
# * Battle Test
#--------------------------------------------------------------------------
alias_method :trick_aibc_title_battletest_database, :battletest_database
def battletest_database
# The Usual
trick_aibc_title_battletest_database
# Setup Load Commands Flag
@load_commands = true
# Load Command Data
load_command_data
# If Load Commands Flag
if @load_commands
# IF Save Data Option
if Battle_Command_Setup::Save_Data
# Save a copy
save_data($data_commands, "Data/Commands.rxdata")
end
# Project Encrypted
else
# Load from Data Commands
$data_commands = load_data("Data/Commands.rxdata")
end
end
#--------------------------------------------------------------------------
# * Load Command Data
#--------------------------------------------------------------------------
def load_command_data
# Setup Data Commands
$data_commands = []
begin
# Get Data from Text File
data = Trickster.load_data_from_txt("Data\\BattleCommands.rxdata",
Battle_Command_Setup::Line, [0,1,3], [], 2)
# Run Through data loaded
data.each_with_index do |command_data, index|
# Create RPG::BattleCommand Object sending loaded hash as an argument
$data_commands[index+1] = RPG::BattleCommand.new(command_data)
end
rescue Errno::ENOENT
# project is encrypted or file not found
@load_commands = false
end
end