Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- EST - AUTO TEXT COLOR PLUS
- v.1.2
- Author: Estriole
- Changelog
- v1.0 2013.08.27 - Initial Release
- v1.1 2013.08.28 - Combine with regexp to recognize 'short' word.
- now it won't color damage if you put mag in the config.
- if there's bug report to me. since it's really hard dealing with regexp
- v1.2 2013.08.28 - Regexp sure is confusing. but manage to improve the regexp.
- now it should accept any character beside a-z and 0-9 and _ (underscore).
- and it just by removing one symbol from regexp that i have tried before and fail.
- Introduction
- This script created because i got tired adding \c[4]Nobita\c[0] in the show
- message box. so this script make it automatic. each time i wrote Nobita it will
- change the color to what i set in the module. useful to color actor names or
- places or important things. i also add capitalization correction too. so if you
- write nobita. it could fixed to Nobita(what you set in the config) if you want.
- both auto color and auto caps correct can be binded to switch too if you don't
- want to always using it.
- Feature
- - auto change color text you defined in the module
- - auto correct capitalization to what you defined in the module
- - have switch function for both feature (set it to 0 to make it always active).
- Author Note
- Yes... I made doraemon games.
- Feature
- =end
- module ESTRIOLE
- module AUTOCOLOR
- #PUT THE STRING YOU WANT TO AUTO COLOR BELOW. USEFUL FOR NAMES
- #FORMAT: "STRING" => COLOR_ID,
- AUTO_SETTING = { #DO NOT TOUCH THIS LINE
- "Auftrag" => 0,
- "Siegelwald" => 23,
- "Ido" => 23,
- "Elwijen" => 23,
- "Elwijens" => 23,
- "Alan" => 23,
- "Alans" => 23,
- "Antika" => 23,
- "Antikas" => 23,
- "Kastilia" => 23,
- "Kastilias" => 23,
- "Valoria" => 23,
- "Valorias" => 23,
- "Yazak" => 23,
- "Yazaks" => 23,
- "yazakischen" => 23,
- "Noce" => 23,
- "ƙrone" => 23,
- "Krone" => 23,
- "Gaststätte" => 24,
- "Monte Zuma" => 23,
- "Nimbus" => 23,
- "Banditen" => 18,
- "Legendäre Pirat" => 18,
- "Legendärer Pirat" => 18,
- "Legendären Piraten" => 18,
- "Baron von Ido" => 0,
- "ObstOase" => 24,
- "Stöberkiste" => 24,
- "Schattenflamme" => 24,
- "Vensterdam" => 23,
- "Spielhalle" => 24,
- "Leuchtturm" => 23,
- "Yarna" => 6,
- "Yarnakirche" => 6,
- "Afrasia" => 23,
- "Baikal" => 23,
- "Baikals" => 23,
- "Konzentrierter Trank" => 5,
- "Trank" => 5,
- "Feldflasche" => 5,
- "Wundertrank" => 5,
- "Muntermacher" => 5,
- "Wunderwasser" => 5,
- "Ambrosia" => 5,
- "Heilkräuter" => 5,
- "Engelsfeder" => 5,
- "Engelsschwinge" => 5,
- "Engelstränen" => 5,
- "Sanfter Bitter" => 5,
- "Flachmann" => 5,
- "Guter Reiswein" => 5,
- "Feigenschnaps" => 5,
- "Klasse Weinbrandt" => 5,
- "Vitamine" => 5,
- "Echoschirm" => 5,
- "Antidot" => 5,
- "Augentropfen" => 5,
- "Baldrian" => 5,
- "Allheilmittel" => 5,
- "Dämonenblut Phiole" => 5,
- "Unsichtbarkeitstrank" => 5,
- "Notizbuch" => 5,
- "Vermummte Puppe" => 5,
- "Passierschein" => 5,
- "Handbuch" => 5,
- "Lebensnektar" => 5,
- "Magischer Splitter" => 5,
- "Kraftextrakt" => 5,
- "Eisencocktail" => 5,
- "Ginseng" => 5,
- "Alraune" => 5,
- "Vierblättriges Kleeblatt" => 5,
- "Käfsersammelbox" => 5,
- "Leuchtturmschlüssel" => 5,
- "Ticket nach Antika" => 5,
- "Forelle" => 5,
- "Knolle" => 5,
- "Orange" => 5,
- "Trauben" => 5,
- "Apfel" => 5,
- "Goldklumpen" => 5,
- "Kristall" => 5,
- "Rubin" => 5,
- "Goldenes Kreuz" => 5,
- "Verzierter Spiegel" => 5,
- "Phönixfeder" => 5,
- "Vase" => 5,
- "Dunkelseele" => 5,
- "Lichtseele" => 5,
- "Seele" => 5,
- "Harter Hund" => 5,
- "Magisches Kaubonbon" => 5,
- "Schnellkraut" => 5,
- "Hexenschmalz" => 5,
- "Berserkertrank" => 5,
- "Kürbisknolle" => 5,
- "Mystiapilz" => 5,
- "Hitzetrank" => 5,
- "Kältetrank" => 5,
- "Nebelnuss" => 5,
- "Siegelstein" => 5,
- "Giftige Brühe" => 5,
- "Magische Sanduhr" => 5,
- "Schlafspray" => 5,
- "Fluch der Verwirrung" => 5,
- "Betäubungspfeil" => 5,
- "Wurfmesser" => 5,
- "Shuriken" => 5,
- "Geweihtes Wasser" => 5,
- "Kugelbombe" => 5,
- "Flammensplitter" => 5,
- }#DO NOT TOUCH THIS LINE
- #return to this color after the text finished. # default 0
- RETURN_COLOR = 0
- #switch to activate the auto color. if switch off then don't autocolor
- #set it to 0. if you want to use switch (will always on)
- AUTO_COLOR_SWITCH = 13
- #switch to activate the auto capitalization correction. (will use what you define
- #in AUTOSETTING #if switch off then don't auto capitalization correction.
- #set it to 0. if you want to use switch (will always on)
- CORRECT_CAP_SWITCH = 0
- START_AUTO_COLOR = true
- START_CORRECT_CAP = true
- end
- end
- class Game_Switches
- include ESTRIOLE::AUTOCOLOR
- alias est_autocolor_switch_initialize initialize
- def initialize
- est_autocolor_switch_initialize
- @data[AUTO_COLOR_SWITCH] = START_AUTO_COLOR if AUTO_COLOR_SWITCH != 0
- @data[CORRECT_CAP_SWITCH] = START_CORRECT_CAP if CORRECT_CAP_SWITCH != 0
- end
- end
- class Window_Base < Window
- include ESTRIOLE::AUTOCOLOR
- alias est_auto_text_color_convert_escape_character convert_escape_characters
- def convert_escape_characters(*args, &block)
- result = est_auto_text_color_convert_escape_character(*args, &block)
- return result if AUTO_COLOR_SWITCH != 0 && !$game_switches[AUTO_COLOR_SWITCH]
- AUTO_SETTING.each_key {|key|
- return_color = RETURN_COLOR
- color = AUTO_SETTING[key]
- if CORRECT_CAP_SWITCH!= 0 && !$game_switches[CORRECT_CAP_SWITCH]
- result.gsub!(/(?<![\w])#{key}(?![\w])/i) {"\eC[#{color}]#{$&}\eC[#{return_color}]"}
- else
- result.gsub!(/(?<![\w])#{key}(?![\w])/i) {"\eC[#{color}]#{key}\eC[#{return_color}]"}
- end
- }
- result
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement