Added Luka's console message colouring code

This commit is contained in:
Maruno17
2021-11-02 23:27:42 +00:00
parent 50d999e7da
commit c392f8c236
11 changed files with 223 additions and 74 deletions

View File

@@ -700,25 +700,24 @@ module Compiler
# Compile all data
#=============================================================================
def compile_pbs_file_message_start(filename)
# Filename is in magenta
echo _INTL(" -> Compiling PBS file {1}\"{2}\"{3}...", "\e[36m", filename.split("/").last, "\e[0m")
# The `` around the file's name turns it cyan
ConsoleRGB.echo_li _INTL("Compiling PBS file `{1}`...", filename.split("/").last)
end
def write_pbs_file_message_start(filename)
# Filename is in magenta
echo _INTL(" -> Writing PBS file {1}\"{2}\"{3}...", "\e[36m", filename.split("/").last, "\e[0m")
# The `` around the file's name turns it cyan
ConsoleRGB.echo_li _INTL("Writing PBS file `{1}`...", filename.split("/").last)
end
def process_pbs_file_message_end
echoln_good _INTL("done")
ConsoleRGB.echo_complete(true)
Graphics.update
end
def compile_all(mustCompile)
return if !mustCompile
FileLineData.clear
echoln_warn _INTL("*** Starting full compile ***")
echoln ""
ConsoleRGB.echo_h1 _INTL("Starting full compile")
compile_town_map # No dependencies
compile_connections # No dependencies
compile_phone # No dependencies
@@ -741,17 +740,16 @@ module Compiler
compile_map_metadata # No dependencies
compile_animations
compile_trainer_events(mustCompile)
echo _INTL(" -> Saving messages...")
ConsoleRGB.echo_li _INTL("Saving messages...")
pbSetTextMessages
MessageTypes.saveMessages
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
echoln_good _INTL("done")
echo _INTL(" -> Reloading cache...")
ConsoleRGB.echo_complete(true)
ConsoleRGB.echo_li _INTL("Reloading cache...")
System.reload_cache
echoln_good _INTL("done")
echoln ""
echoln_good _INTL("Successfully fully compiled")
ConsoleRGB.echo_complete(true)
echoln ""
ConsoleRGB.echo_h2("Successfully fully compiled", text: :green)
end
def main

View File

@@ -1692,7 +1692,7 @@ module Compiler
# Compile battle animations
#=============================================================================
def compile_animations
echo _INTL(" -> Compiling animations...")
ConsoleRGB.echo_li _INTL("Compiling animations...")
begin
pbanims = load_data("Data/PkmnAnimations.rxdata")
rescue

View File

@@ -889,9 +889,7 @@ module Compiler
# Save all data to PBS files
#=============================================================================
def write_all
echoln ""
echoln_warn _INTL("*** Writing all PBS files ***")
echoln ""
ConsoleRGB.echo_h1 _INTL("Writing all PBS files")
write_town_map
write_connections
write_phone
@@ -913,7 +911,6 @@ module Compiler
write_metadata
write_map_metadata
echoln ""
echoln_good _INTL("Successfully rewrote all PBS files")
echoln ""
ConsoleRGB.echo_h2("Successfully rewrote all PBS files", text: :green)
end
end

View File

@@ -1445,7 +1445,7 @@ module Compiler
Graphics.update
trainerChecker = TrainerChecker.new
change_record = []
echo _INTL(" -> Processing {1} maps...", mapData.mapinfos.keys.length)
ConsoleRGB.echo_li _INTL("Processing {1} maps...", mapData.mapinfos.keys.length)
idx = 0
for id in mapData.mapinfos.keys.sort
echo "." if idx % 20 == 0
@@ -1485,15 +1485,15 @@ module Compiler
if changed
mapData.saveMap(id)
mapData.saveTilesets
change_record.push(_INTL(" Map {1}: '{2}' was modified and saved.", id, mapData.mapinfos[id].name))
change_record.push(_INTL("Map {1}: '{2}' was modified and saved.", id, mapData.mapinfos[id].name))
end
end
echoln_good "done"
change_record.each { |msg| echoln_warn msg }
ConsoleRGB.echo_complete(true)
change_record.each { |msg| ConsoleRGB.echo_warn msg }
changed = false
Graphics.update
commonEvents = load_data("Data/CommonEvents.rxdata")
echo _INTL(" -> Processing common events...")
ConsoleRGB.echo_li _INTL("Processing common events...")
for key in 0...commonEvents.length
newevent = fix_event_use(commonEvents[key],0,mapData)
if newevent
@@ -1502,9 +1502,9 @@ module Compiler
end
end
save_data(commonEvents,"Data/CommonEvents.rxdata") if changed
echoln_good "done"
ConsoleRGB.echo_complete(true)
if change_record.length > 0 || changed
echoln_bad _INTL("!!! RMXP data was altered. Close RMXP now to ensure changes are applied. !!!")
ConsoleRGB.echo_warn _INTL("RMXP data was altered. Close RMXP now to ensure changes are applied.")
end
end
end