mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-22 23:06:18 +00:00
Fixing textbox width issue
This commit is contained in:
parent
2a03b10d7c
commit
01b4e7e2a0
1 changed files with 5 additions and 4 deletions
|
|
@ -119,12 +119,13 @@ class Window_Message < Window_Selectable
|
||||||
spacewidth = self.contents.text_size(' ').width
|
spacewidth = self.contents.text_size(' ').width
|
||||||
text.split("\n").each do |line|
|
text.split("\n").each do |line|
|
||||||
line.split(' ').each do |word|
|
line.split(' ').each do |word|
|
||||||
if word.start_with?('\003')
|
|
||||||
#ignore new facepics
|
|
||||||
next
|
|
||||||
end
|
|
||||||
# Get width of this word and insert a newline if it goes out of bounds
|
# Get width of this word and insert a newline if it goes out of bounds
|
||||||
width = self.contents.text_size(word.gsub(/(\000\[[0-9]+\]|\001|\002)/, '')).width
|
width = self.contents.text_size(word.gsub(/(\000\[[0-9]+\]|\001|\002)/, '')).width
|
||||||
|
if word.include?("\003")
|
||||||
|
#ignore new facepics
|
||||||
|
width = 0
|
||||||
|
end
|
||||||
if x + width > maxwidth
|
if x + width > maxwidth
|
||||||
@text << "\n"
|
@text << "\n"
|
||||||
x = 0
|
x = 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue