Ed fix
This commit is contained in:
parent
697ff6f977
commit
974d2d8874
|
|
@ -69,3 +69,4 @@ Rewrited to use SDL3 libc methods instead default
|
||||||
Removed useless debug logs
|
Removed useless debug logs
|
||||||
Glen reworked
|
Glen reworked
|
||||||
GLLogger \n bug fix
|
GLLogger \n bug fix
|
||||||
|
Removed text size limit in Ed Message
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
# Displays Ed message boxes
|
# Displays Ed message boxes
|
||||||
class Ed_Message
|
class Ed_Message
|
||||||
HEIGHT = 160
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Object Initialization
|
# * Object Initialization
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def initialize
|
def initialize
|
||||||
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||||
@sprite_bg = Sprite.new(@viewport)
|
@sprite_bg = Sprite.new(@viewport)
|
||||||
@sprite_bg.bitmap = Bitmap.new(Graphics.width, Graphics.height)
|
@sprite_bg.bitmap = Bitmap.new(1, 1)
|
||||||
@sprite_bg.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0, 128))
|
@sprite_bg.bitmap.fill_rect(0, 0, 1, 1, Color.new(0, 0, 0, 128))
|
||||||
|
@sprite_bg.zoom_x = Graphics.width
|
||||||
|
@sprite_bg.zoom_y = Graphics.height
|
||||||
@sprite_text = Sprite.new(@viewport)
|
@sprite_text = Sprite.new(@viewport)
|
||||||
@contents = Bitmap.new(Graphics.width, HEIGHT)
|
@contents = Bitmap.new(Graphics.width, Graphics.height)
|
||||||
Language.register_text_sprite(self.class.name + "_contents", @contents)
|
Language.register_text_sprite(self.class.name + "_contents", @contents)
|
||||||
@sprite_text.bitmap = @contents
|
@sprite_text.bitmap = @contents
|
||||||
@sprite_text.y = (Graphics.height - HEIGHT) / 2
|
|
||||||
@sprite_bg.z = 0
|
@sprite_bg.z = 0
|
||||||
@sprite_text.z = 1
|
@sprite_text.z = 1
|
||||||
@viewport.z = 9999
|
@viewport.z = 9999
|
||||||
|
|
@ -28,12 +28,26 @@ class Ed_Message
|
||||||
@fade_out = false
|
@fade_out = false
|
||||||
@fade_in_text = false
|
@fade_in_text = false
|
||||||
@fade_out_text = false
|
@fade_out_text = false
|
||||||
|
|
||||||
|
@resize_connection = Graphics.viewport_resized do |w, h|
|
||||||
|
@viewport.rect.width = w
|
||||||
|
@viewport.rect.height = h
|
||||||
|
|
||||||
|
@sprite_bg.zoom_x = w
|
||||||
|
@sprite_bg.zoom_y = h
|
||||||
|
|
||||||
|
@contents.dispose
|
||||||
|
@contents = Bitmap.new(w, h)
|
||||||
|
@sprite_text.bitmap = @contents
|
||||||
|
end
|
||||||
|
|
||||||
RPG::Mod.exec_hooks("hooks/Ed_Message/init", binding)
|
RPG::Mod.exec_hooks("hooks/Ed_Message/init", binding)
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Dispose
|
# * Dispose
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def dispose
|
def dispose
|
||||||
|
@resize_connection.disconnect
|
||||||
terminate_message
|
terminate_message
|
||||||
$game_temp.message_window_showing = false
|
$game_temp.message_window_showing = false
|
||||||
@contents.dispose
|
@contents.dispose
|
||||||
|
|
@ -93,7 +107,7 @@ class Ed_Message
|
||||||
widths << x
|
widths << x
|
||||||
x = 0
|
x = 0
|
||||||
y += 1
|
y += 1
|
||||||
break if y >= 4
|
#break if y >= 4
|
||||||
else
|
else
|
||||||
newline = true
|
newline = true
|
||||||
end
|
end
|
||||||
|
|
@ -105,7 +119,7 @@ class Ed_Message
|
||||||
widths << x
|
widths << x
|
||||||
x = 0
|
x = 0
|
||||||
y += 1
|
y += 1
|
||||||
break if y >= 4
|
#break if y >= 4
|
||||||
end
|
end
|
||||||
|
|
||||||
# Append word to list
|
# Append word to list
|
||||||
|
|
@ -116,14 +130,14 @@ class Ed_Message
|
||||||
end
|
end
|
||||||
x += width + spacewidth
|
x += width + spacewidth
|
||||||
end
|
end
|
||||||
break if y >= 4
|
#break if y >= 4
|
||||||
end
|
end
|
||||||
widths << x if y < 4
|
widths << x# if y < 4
|
||||||
|
|
||||||
# Prepare renderer
|
# Prepare renderer
|
||||||
@contents.clear
|
@contents.clear
|
||||||
@contents.font.color = Color.new(255, 255, 255, 255)
|
@contents.font.color = Color.new(255, 255, 255, 255)
|
||||||
y_top = (HEIGHT - widths.length * 24) / 2
|
y_top = (Graphics.height - widths.length * 24) / 2
|
||||||
x = (Graphics.width - widths[0]) / 2
|
x = (Graphics.width - widths[0]) / 2
|
||||||
y = 0
|
y = 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue