Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Custom Resolution - Adjust Menu Position (Default Menu)
- # Version : 1.04
- # Author : LiTTleDRAgo
- #==============================================================================
- ($imported ||= {})[:custom_resolution_adjust_default_menu] = 1.04
- " Delete This Script if you want to use default Resolution (640 x 480) "
- text = "This Script needs at least Custom Resolution v0.96 or "
- text += "Drago - Core Engine v1.40"
- Graphics.respond_to?(:snap_to_bitmap) || raise(text)
- #==============================================================================
- # ** Object
- #------------------------------------------------------------------------------
- #
- #==============================================================================
- class Object
- #--------------------------------------------------------------------------
- # * New method: adjust_position_xy
- #--------------------------------------------------------------------------
- def adjust_position_xy(w = 640, h = 480)
- _w, _h = Graphics.width, Graphics.height
- x = (_w - w) / 2
- y = (_h - h) / 2
- return [x, y]
- end
- end
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- # This class is for all in-game windows.
- #==============================================================================
- class Window_Base
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_initialize_viewport_adjust, :initialize)
- #--------------------------------------------------------------------------
- # * Aliased method: initialize
- #--------------------------------------------------------------------------
- def initialize(x,y,width,height)
- x1, y1 = adjust_position_xy
- if @no_adjustment
- return drg_initialize_viewport_adjust(x,y,width,height)
- end
- drg_initialize_viewport_adjust(x + x1,y + y1,width,height)
- end
- end
- #==============================================================================
- # ** Window_Message
- #------------------------------------------------------------------------------
- # This message window is used to display text.
- #==============================================================================
- class Window_Message
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_win_msg_initialize_viewport_adjust, :initialize)
- $@ || alias_method(:drg_win_msg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: initialize
- #--------------------------------------------------------------------------
- def initialize(*args)
- @no_adjustment = true
- @screen_width = Graphics.width - 1
- @screen_height = Graphics.height - 1
- drg_win_msg_initialize_viewport_adjust(*args)
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- if Graphics.respond_to?(:width) &&
- (@screen_width != Graphics.width || @screen_height != Graphics.height)
- @screen_width = Graphics.width
- @screen_height = Graphics.height
- self.width = @screen_width * 0.8125
- self.height = @screen_height / 3
- self.x = @screen_width / 2 - self.width / 2
- self.y = @screen_height - self.height - 16
- if self.contents && !self.contents.disposed?
- self.contents.dispose
- end
- self.contents = Bitmap.new(width - 32, height - 32)
- end
- drg_win_msg_update_viewport_adjust(*args)
- end
- #--------------------------------------------------------------------------
- # * Aliased method: reset_window
- #--------------------------------------------------------------------------
- if method_defined?(:reset_window) && !method_defined?(:drg_rst_window_v_adj)
- alias_method(:drg_rst_window_v_adj, :reset_window)
- def reset_window(*args)
- drg_rst_window_v_adj(*args)
- if !$game_temp.in_battle
- case $game_system.message_position
- when 0 # up
- self.y = 16
- when 1 # middle
- self.y = @screen_height / 2 - self.height / 2
- when 2 # down
- self.y = @screen_height - self.height - 16
- end
- end
- end
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs menu screen processing.
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_main_viewport_adjust, :main)
- $@ || alias_method(:drg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: main
- #--------------------------------------------------------------------------
- def main(*args)
- @sprite_black = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- drg_main_viewport_adjust(*args)
- @sprite_black.disposed? || @sprite_black.dispose
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- unless @adjusted
- x, y = adjust_position_xy
- @playtime_window.x += x
- @playtime_window.y += y
- @steps_window.x += x
- @steps_window.y += y
- @gold_window.x += x
- @gold_window.y += y
- @status_window.x += x
- @status_window.y += y
- @adjusted = true
- end
- @sprite_black.opacity -= 10
- drg_update_viewport_adjust(*args)
- end
- end
- #==============================================================================
- # ** Scene_End
- #------------------------------------------------------------------------------
- # This class performs game end screen processing.
- #==============================================================================
- class Scene_End
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_main_viewport_adjust, :main)
- $@ || alias_method(:drg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: main
- #--------------------------------------------------------------------------
- def main(*args)
- @sprite_black = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- drg_main_viewport_adjust(*args)
- @sprite_black.disposed? || @sprite_black.dispose
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- unless @adjusted
- x, y = adjust_position_xy
- @command_window.x += x
- @command_window.y += y
- @adjusted = true
- end
- @sprite_black.opacity -= 10
- drg_update_viewport_adjust(*args)
- end
- end
- #==============================================================================
- # ** Scene_Shop
- #------------------------------------------------------------------------------
- # This class performs shop screen processing.
- #==============================================================================
- class Scene_Shop
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_main_viewport_adjust, :main)
- $@ || alias_method(:drg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: main
- #--------------------------------------------------------------------------
- def main(*args)
- @sprite_black = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- drg_main_viewport_adjust(*args)
- @sprite_black.disposed? || @sprite_black.dispose
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- unless @adjusted
- x, y = adjust_position_xy
- @gold_window.x += x
- @gold_window.y += y
- @adjusted = true
- end
- @sprite_black.opacity -= 10
- drg_update_viewport_adjust(*args)
- end
- end
- #==============================================================================
- # ** Scene_Gameover
- #------------------------------------------------------------------------------
- # This class performs game over screen processing.
- #==============================================================================
- class Scene_Gameover
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_main_viewport_adjust, :main)
- $@ || alias_method(:drg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: main
- #--------------------------------------------------------------------------
- def main(*args)
- @sprite_black = Sprite.new
- @sprite_death = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- @sprite_death.z = @sprite_black.z - 10
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- bitmap = RPG::Cache.gameover($data_system.gameover_name)
- object = @sprite_death.bitmap = @sprite_black.bitmap.clone
- object.stretch_blt(object.rect,bitmap,bitmap.rect)
- Graphics.transition
- 26.times { (@sprite_black.opacity -= 10) && Graphics.update }
- drg_main_viewport_adjust(*args)
- @sprite_black.disposed? || @sprite_black.dispose
- @sprite_death.disposed? || @sprite_death.dispose
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- unless @adjusted
- x, y = adjust_position_xy
- #@sprite.x += x
- #@sprite.y += y
- @sprite.bitmap.dispose
- @sprite.bitmap = @sprite_black.bitmap.dup
- @adjusted = true
- end
- @sprite_black.opacity -= 10
- drg_update_viewport_adjust(*args)
- end
- end
- #==============================================================================
- # ** Scene_Title
- #------------------------------------------------------------------------------
- # This class performs title screen processing.
- #==============================================================================
- class Scene_Title
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_main_viewport_adjust, :main)
- $@ || alias_method(:drg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: main
- #--------------------------------------------------------------------------
- def main(*args)
- @sprite_black = Sprite.new
- #@sprite_title = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- #@sprite_title.z = @sprite_black.z - 10
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- Graphics.transition
- drg_main_viewport_adjust(*args)
- @sprite_black.disposed? || @sprite_black.dispose
- #@sprite_title.disposed? || @sprite_title.dispose
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- unless @adjusted
- bitmap = @sprite.bitmap
- x, y = adjust_position_xy(bitmap.width, bitmap.height)
- if bitmap
- @sprite.x += x
- @sprite.y += y
- end
- x, y = adjust_position_xy
- @command_window.x += x
- @command_window.y += y
- @adjusted = true
- end
- @sprite_black.opacity -= 10
- drg_update_viewport_adjust(*args)
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #------------------------------------------------------------------------------
- # This class performs battle screen processing.
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_main_viewport_adjust, :main)
- $@ || alias_method(:drg_update_viewport_adjust, :update)
- #--------------------------------------------------------------------------
- # * Aliased method: main
- #--------------------------------------------------------------------------
- def main(*args)
- @sprite_black = Sprite.new
- @sprite_black.z = 0x3FFFFFFF
- @sprite_black.bitmap = Graphics.snap_to_bitmap
- drg_main_viewport_adjust(*args)
- @sprite_black.disposed? || @sprite_black.dispose
- end
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- unless @adjusted
- x, y = adjust_position_xy
- @actor_command_window.y += y
- @adjusted = true
- end
- @sprite_black.opacity -= 10
- drg_update_viewport_adjust(*args)
- end
- #--------------------------------------------------------------------------
- # * Aliased method: phase3_setup_command_window
- #--------------------------------------------------------------------------
- if method_defined?(:phase3_setup_command_window)
- $@ || alias_method(:drg_phase3_scwin_adjust, :phase3_setup_command_window)
- def phase3_setup_command_window(*args)
- drg_phase3_scwin_adjust(*args)
- x, y = adjust_position_xy
- @actor_command_window.x += x
- end
- end
- end
- #==============================================================================
- # ** Spriteset_Battle
- #------------------------------------------------------------------------------
- # This class brings together battle screen sprites. It's used within
- # the Scene_Battle class.
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- unless method_defined?(:drg_spriteset_viewport_adjust)
- alias_method :drg_spriteset_viewport_adjust, :update
- #--------------------------------------------------------------------------
- # * Aliased method: update
- #--------------------------------------------------------------------------
- def update(*args)
- if viewport_size_change?
- @viewport_screen_width = Graphics.width
- @viewport_screen_height = Graphics.height
- [@viewport1,@viewport2,@viewport3,@viewport4].compact.each do |v|
- w, h = v.rect.width, v.rect.height
- x, y = adjust_position_xy
- v.resize(Rect.new(x, y, w, h))
- end
- end
- drg_spriteset_viewport_adjust(*args)
- end
- #--------------------------------------------------------------------------
- # * New method: viewport_size_change?
- #--------------------------------------------------------------------------
- def viewport_size_change?
- return true if @viewport_screen_width != Graphics.width
- return true if @viewport_screen_height != Graphics.height
- end
- end
- end
- #==============================================================================
- # ** Window_Item
- #------------------------------------------------------------------------------
- # This window displays items in possession on the item and battle screens.
- #==============================================================================
- class Window_Item
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_initialize_item_adjust, :initialize)
- #--------------------------------------------------------------------------
- # * Aliased method: initialize
- #--------------------------------------------------------------------------
- def initialize(*args)
- drg_initialize_item_adjust(*args)
- if $game_temp.in_battle
- x, y = adjust_position_xy
- self.y += y
- end
- end
- end
- #==============================================================================
- # ** Window_Skill
- #------------------------------------------------------------------------------
- # This window displays usable skills on the skill and battle screens.
- #==============================================================================
- class Window_Skill
- #--------------------------------------------------------------------------
- # * Alias Listing
- #--------------------------------------------------------------------------
- $@ || alias_method(:drg_initialize_item_adjust, :initialize)
- #--------------------------------------------------------------------------
- # * Aliased method: initialize
- #--------------------------------------------------------------------------
- def initialize(*args)
- drg_initialize_item_adjust(*args)
- if $game_temp.in_battle
- x, y = adjust_position_xy
- self.y += y
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement