I want to set a word for e.g. "MP, Object, Ability, Axe" from a script.
It should overwrite whatever is in the database.
Thank you for your help! 😍
It should overwrite whatever is in the database.
Thank you for your help! 😍
class Window_Base
TEXT_SWITCH_ID = 99 # if switch on, replace text
TEXT_REPLACER = {
# original => Replacer
"Item" => "Item2"
}
alias textreplacer_draw_text draw_text
def draw_text(*args)
if $game_switches[TEXT_SWITCH_ID]
if args[0].is_a?(Rect)
args[1] = TEXT_REPLACER[args[1]] if TEXT_REPLACER[args[1]]
else
args[4] = TEXT_REPLACER[args[4]] if TEXT_REPLACER[args[4]]
end
end
textreplacer_draw_text(*args)
end
end
#-------
# * Display Skill/Item Use
#-------
def display_use_items(subject, item)
if item.is_a?(RPG::Skill)
add_text(subject.name + item.message1)
unless item.message2.empty?
wait
add_text(item.message2)
end
else
add_text(sprintf(Vocab::UseItem, subject.name, item.name))
end
end
Original thread: https://forums.rpgmakerweb.com/threads/translate-a-word-from-system.164694/