Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Spriteset_Map
- #------------------------------------------------------------------------------
- # This class brings together map screen sprites, tilemaps, etc. It's used
- # within the Scene_Map class.
- #==============================================================================
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # * Retreive a correct rect
- #--------------------------------------------------------------------------
- def correct_rect
- real_w = $game_map.width * 32
- real_h = $game_map.height * 32
- loop_h = $game_map.loop_vertical?
- loop_w = $game_map.loop_horizontal?
- coeffx = coeffy = 0
- coeffx = (Graphics.width - real_w)/2 if Graphics.width > real_w && !loop_w
- coeffy = (Graphics.height - real_h)/2 if Graphics.height > real_h && !loop_h
- coeffw = (loop_w) ? Graphics.width : [Graphics.width, real_w].min
- coeffh = (loop_h) ? Graphics.height : [Graphics.height, real_h].min
- Rect.new(coeffx, coeffy, coeffw, coeffh)
- end
- #--------------------------------------------------------------------------
- # * Create Viewport
- #--------------------------------------------------------------------------
- def create_viewports
- r = correct_rect
- @viewport1 = Viewport.new(r)
- @viewport2 = Viewport.new(r)
- @viewport3 = Viewport.new(r)
- @viewport2.z = 50
- @viewport3.z = 100
- end
- #--------------------------------------------------------------------------
- # * Refresh viewports
- #--------------------------------------------------------------------------
- def incubator_refresh_viewports
- r = correct_rect
- [@viewport1, @viewport2, @viewport3].each do |vp|
- vp.rect.set(r)
- end
- end
- end
- #==============================================================================
- # ** Game_Map
- #------------------------------------------------------------------------------
- # This class handles maps. It includes scrolling and passage determination
- # functions. The instance of this class is referenced by $game_map.
- #==============================================================================
- class Game_Map
- #--------------------------------------------------------------------------
- # * Scroll Down
- #--------------------------------------------------------------------------
- def scroll_down(distance)
- if loop_vertical?
- @display_y += distance
- @display_y %= @map.height * 256
- @parallax_y += distance if @parallax_loop_y
- else
- last_y = @display_y
- tile_y = (Graphics.height > (height * 32)) ? height : screen_tile_y
- @display_y = [@display_y + distance, (height - tile_y)].min
- @parallax_y += @display_y - last_y
- end
- end
- #--------------------------------------------------------------------------
- # * Scroll Right
- #--------------------------------------------------------------------------
- def scroll_right(distance)
- if loop_horizontal?
- @display_x += distance
- @display_x %= @map.width * 256
- @parallax_x += distance if @parallax_loop_x
- else
- last_x = @display_x
- tile_x = (Graphics.width > (width * 32)) ? width : screen_tile_x
- @display_x = [@display_x + distance, (width - tile_x)].min
- @parallax_x += @display_x - last_x
- end
- end
- end
- #==============================================================================
- # ** Resolution
- #------------------------------------------------------------------------------
- # Hack in the matrice :'( :'(
- #==============================================================================
- module Resolution
- extend self
- #------------------------------------------------------------------------
- # * ... no idea
- #------------------------------------------------------------------------
- def fresh_pointer(reg, v)
- ptr = DL::CPtr.new(268435456 + reg)
- ptr[0, v.size] = v
- end
- #------------------------------------------------------------------------
- # * ... pack dimension
- #------------------------------------------------------------------------
- def pack_dimension(width, height)
- [
- [width, height],[width+32, height+32],
- [-(~(width/32)), -(~(height/32))]
- ].collect{|elt| elt.pack('ll').scan(/..../)}
- end
- #------------------------------------------------------------------------
- # * ... Oh yeah, i'm currently listening a nice song !
- #------------------------------------------------------------------------
- def map_reg(width, height)
- empty_buff = [].pack('x4')
- (buff_aa, buff_ab), (buff_ba, buff_bb),
- (buff_ca, buff_cb) = *pack_dimension(width, height)
- {
- 6495 => "\x90"*5, 6564 => buff_ab, 6569 => buff_aa,
- 6742 => buff_ab, 6747 => buff_aa, 8438 => buff_aa,
- 8447 => buff_aa, 8454 => buff_ab, 8463 => buff_ab,
- 116195 => empty_buff, 116200 => empty_buff,
- 128119 => buff_ab, 128124 => buff_aa, 135679 => buff_bb,
- 135684 => buff_ba, 138621 => buff_cb[0], 138753 => buff_ca[0],
- 1105576=> buff_ab, 1105581=> buff_aa, 1105631=> buff_ab,
- 1105648=> buff_aa, 1105684=> buff_ab, 1105688=> buff_aa,
- 1105736=> buff_ab, 1105740=> buff_aa, 1107623=> buff_aa,
- 1107651=> buff_ab, 1109673=> buff_aa, 1109689=> buff_ab
- }.each{|k, v| fresh_pointer(k, v)}
- end
- #------------------------------------------------------------------------
- # * ... Change resolution
- #------------------------------------------------------------------------
- def change(w, h)
- map_reg(w, h)
- Graphics.resize_screen(w, h)
- end
- end
- #==============================================================================
- # Display v1.0 (21/3/15)
- # by Pheonix KageDesu
- #------------------------------------------------------------------------------
- # Описание: Возможность устанавливать новое разрешение окна игры
- # Как использовать: PKD_Display.set_1024
- # Доступные разрешения:
- # PKD_Display.set_1024 - 1024 x 768 (Оптимальное)
- # PKD_Display.set_800 - 800 x 576 (Минимальное)
- # PKD_Display.set_720p - 1280 x 704 (Максимальное, можно и больше)
- #
- # Внимение, меньше set_800 ставить не рекомендуется. Работа не гарантируется.
- #==============================================================================
- # Данный скрипт можно использовать в любых проектах (в том числе и коммерческих),
- # если указано моё авторство (Pheonix KageDesu) на данный скрипт.
- #==============================================================================
- #1 часть скрипта.
- module PKD_Display
- #НАСТРОЙКИ (Менять не рекомендую)
- #------------------------------------------------------------------------------
- #Показывать ли переход при начале битвы (по умолчанию false)
- BATTLE_PICTURE = false #Если System/BattleStart.png у Вас нужного формата, то поставьте true
- #Размеры для окон
- W = 544 #По умолчанию 544
- H = 480 #По умолчанию 480
- #КОНЕЦ
- #------------------------------------------------------------------------------
- WX = Graphics.width
- HX = Graphics.height
- def self.cX
- Graphics.width / 2
- end
- def self.cY
- Graphics.height / 2
- end
- def self.toCntrX(x,gl)
- return (cX - (gl / 2) + x)
- end
- def self.toCntrY(y,gl)
- return (cY - (gl / 2) + y)
- end
- def self.window_to_center(window, glW, glH)
- window.x = toCntrX(window.x,glW)
- window.y = toCntrY(window.y,glH)
- end
- #W,H must be MOD 32 = 0 (должны быть кратны 32)
- def self.set_800
- Resolution.change(800, 576)
- end
- def self.set_1024
- Resolution.change(1024, 768)
- end
- def self.set_720p
- Resolution.change(1280, 704)
- end
- end
- #==============================================================================
- # Display
- # by Pheonix KageDesu
- #------------------------------------------------------------------------------
- #2 часть скрипта.
- module Graphics
- class <<self
- #ALIAS
- alias pkd_Graphics_transition transition
- def transition(duration=10, filename=nil, vague=40)
- pkd_Graphics_transition(1,"",1)
- end
- #OVER
- def fadeout(duration)
- #EMPTY
- end
- #OVER
- def fadein(duration)
- #EMPTY
- end
- end
- end
- #==============================================================================
- # ** Spriteset_Battle
- #------------------------------------------------------------------------------
- # This class brings together battle screen sprites. It's used within the
- # Scene_Battle class.
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # * Create Viewport
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Spriteset_Battle_create_viewports create_viewports
- def create_viewports
- pkd_Spriteset_Battle_create_viewports()
- @viewport1.rect.width = PKD_Display::W
- @viewport1.rect.height = PKD_Display::H
- @viewport1.rect.x = PKD_Display.toCntrX(0,PKD_Display::W)
- @viewport1.rect.y = PKD_Display.toCntrY(0,PKD_Display::H)
- @viewport2.rect.width = PKD_Display::W
- @viewport2.rect.height = PKD_Display::H
- @viewport2.rect.x = PKD_Display.toCntrX(0,PKD_Display::W)
- @viewport2.rect.y = PKD_Display.toCntrY(0,PKD_Display::H)
- @viewport3.rect.width = PKD_Display::W
- @viewport3.rect.height = PKD_Display::H
- @viewport3.rect.x = PKD_Display.toCntrX(0,PKD_Display::W)
- @viewport3.rect.y = PKD_Display.toCntrY(0,PKD_Display::H)
- end
- #--------------------------------------------------------------------------
- # * Move Sprite to Screen Center
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Spriteset_Battle_center_sprite center_sprite
- def center_sprite(sprite)
- pkd_Spriteset_Battle_center_sprite(sprite)
- sprite.x = PKD_Display::W / 2
- sprite.y = PKD_Display::H / 2
- end
- end
- #==============================================================================
- # Display
- # by Pheonix KageDesu
- #------------------------------------------------------------------------------
- #3 часть скрипта.
- #==============================================================================
- # ** Scene_Base
- #------------------------------------------------------------------------------
- # This is a super class of all scenes within the game.
- #==============================================================================
- class Scene_Base
- #--------------------------------------------------------------------------
- # * Fade Out All Sounds and Graphics
- #--------------------------------------------------------------------------
- #OVER
- def fadeout_all(time = 1000)
- RPG::BGM.fade(time)
- RPG::BGS.fade(time)
- RPG::ME.fade(time)
- fadeout(time * Graphics.frame_rate / 1000)
- RPG::BGM.stop
- RPG::BGS.stop
- RPG::ME.stop
- end
- #--------------------------------------------------------------------------
- # * General-Purpose Fade Processing
- #--------------------------------------------------------------------------
- #NEW
- def fade_loop(duration)
- duration.times do |i|
- yield 255 * (i + 1) / duration
- update_for_fade
- end
- end
- #--------------------------------------------------------------------------
- # * Update Frame (for Fade In)
- #--------------------------------------------------------------------------
- #NEW
- def update_for_fade
- update_basic
- end
- #--------------------------------------------------------------------------
- # * Fadeout Screen
- #--------------------------------------------------------------------------
- #NEW
- def fadeout(duration)
- fade_loop(duration) {|v| @viewport.color.set(0, 0, 0, v) }
- end
- end
- #==============================================================================
- # ** Scene_ItemBase
- #------------------------------------------------------------------------------
- # This class performs common processing for the item screen and skill screen.
- #==============================================================================
- class Scene_ItemBase < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Show Subwindow
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Item_Base_show_sub_window show_sub_window
- def show_sub_window(window)
- window.y = @help_window.y
- pkd_Scene_Item_Base_show_sub_window(window)
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Menu_start start
- def start
- pkd_Scene_Menu_start()
- windows_to_center
- end
- #--------------------------------------------------------------------------
- # * Create Gold Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Menu_create_gold_window create_gold_window
- def create_gold_window
- pkd_Scene_Menu_create_gold_window()
- @gold_window.y = PKD_Display::H - @gold_window.height
- end
- private
- #NEW
- def windows_to_center
- glW = @command_window.width + @status_window.width
- glH = @status_window.height
- PKD_Display.window_to_center(@command_window,glW,glH)
- PKD_Display.window_to_center(@gold_window,glW,glH)
- PKD_Display.window_to_center(@status_window,glW,glH)
- end
- end
- #==============================================================================
- # ** Scene_Map
- #------------------------------------------------------------------------------
- # This class performs the map screen processing.
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # * Fadein Screen
- #--------------------------------------------------------------------------
- #NEW
- def fadein(duration)
- fade_loop(duration) {|v| @viewport.color.set(0, 0, 0, 255 - v) }
- end
- #--------------------------------------------------------------------------
- # * Fadeout Screen
- #--------------------------------------------------------------------------
- #NEW
- def fadeout(duration)
- fade_loop(duration) {|v| @viewport.color.set(0, 0, 0, v) }
- end
- #--------------------------------------------------------------------------
- # * Post Processing for Transferring Player
- #--------------------------------------------------------------------------
- #ALIAS
- alias PKD_SceneMap_post_transfer post_transfer
- def post_transfer
- @spriteset.incubator_refresh_viewports
- @spriteset.update
- PKD_SceneMap_post_transfer()
- end
- #--------------------------------------------------------------------------
- # * Execute Pre-Battle Transition
- #--------------------------------------------------------------------------
- #OVER
- def perform_battle_transition
- if PKD_Display::BATTLE_PICTURE
- Graphics.transition(60, "Graphics/System/BattleStart", 100)
- end
- Graphics.freeze
- end
- end
- #==============================================================================
- # ** Scene_Status
- #------------------------------------------------------------------------------
- # This class performs the status screen processing.
- #==============================================================================
- class Scene_Status < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Status_start start
- def start
- pkd_Scene_Status_start()
- @status_window.window_to_center
- @status_window.window_to_size
- end
- end
- #==============================================================================
- # ** Scene_Item
- #------------------------------------------------------------------------------
- # This class performs the item screen processing.
- #==============================================================================
- class Scene_Item < Scene_ItemBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Item_start start
- def start
- pkd_Scene_Item_start()
- windows_to_center
- end
- #--------------------------------------------------------------------------
- # * Create Item Window
- #--------------------------------------------------------------------------
- #OVER
- def create_item_window
- wy = @category_window.y + @category_window.height
- wh = PKD_Display::H - wy
- @item_window = Window_ItemList.new(0, wy, PKD_Display::W, wh)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:on_item_cancel))
- @category_window.item_window = @item_window
- @item_window.window_to_center
- end
- private
- #NEW
- def windows_to_center
- @category_window.window_to_center
- @help_window.window_to_center
- @help_window.width = PKD_Display::W
- end
- end
- #==============================================================================
- # ** Scene_Skill
- #------------------------------------------------------------------------------
- # This class performs skill screen processing. Skills are handled as items for
- # the sake of process sharing.
- #==============================================================================
- class Scene_Skill < Scene_ItemBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Skill_start start
- def start
- pkd_Scene_Skill_start()
- windows_to_center
- end
- #--------------------------------------------------------------------------
- # * Create Item Window
- #--------------------------------------------------------------------------
- #OVER
- def create_item_window
- wx = 0
- wy = @status_window.y + @status_window.height
- ww = PKD_Display::W
- wh = PKD_Display::H - wy
- @item_window = Window_SkillList.new(wx, wy, ww, wh)
- @item_window.actor = @actor
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:on_item_cancel))
- @command_window.skill_window = @item_window
- @item_window.window_to_center
- end
- private
- #NEW
- def windows_to_center
- @help_window.window_to_center
- @help_window.width = PKD_Display::W
- @command_window.window_to_center
- @status_window.width = @help_window.width - @command_window.width
- @status_window.window_to_center
- end
- end
- #==============================================================================
- # ** Scene_Equip
- #------------------------------------------------------------------------------
- # This class performs the equipment screen processing.
- #==============================================================================
- class Scene_Equip < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Equip_start start
- def start
- pkd_Scene_Equip_start()
- windows_to_center
- end
- #NEW
- def windows_to_center
- @help_window.window_to_center
- @help_window.width = PKD_Display::W
- end
- #--------------------------------------------------------------------------
- # * Create Status Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Equip_create_status_window create_status_window
- def create_status_window
- pkd_Scene_Equip_create_status_window()
- @status_window.window_to_center
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- #OVER
- def create_command_window
- wx = @status_window.width
- wy = @help_window.height
- ww = PKD_Display::W - @status_window.width
- @command_window = Window_EquipCommand.new(wx, wy, ww)
- @command_window.viewport = @viewport
- @command_window.help_window = @help_window
- @command_window.set_handler(:equip, method(:command_equip))
- @command_window.set_handler(:optimize, method(:command_optimize))
- @command_window.set_handler(:clear, method(:command_clear))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.set_handler(:pagedown, method(:next_actor))
- @command_window.set_handler(:pageup, method(:prev_actor))
- @command_window.window_to_center
- end
- #--------------------------------------------------------------------------
- # * Create Slot Window
- #--------------------------------------------------------------------------
- #OVER
- def create_slot_window
- wx = @status_window.width
- wy = @command_window.y + @command_window.height
- ww = PKD_Display::W - @status_window.width
- @slot_window = Window_EquipSlot.new(wx, wy, ww)
- @slot_window.viewport = @viewport
- @slot_window.help_window = @help_window
- @slot_window.status_window = @status_window
- @slot_window.actor = @actor
- @slot_window.set_handler(:ok, method(:on_slot_ok))
- @slot_window.set_handler(:cancel, method(:on_slot_cancel))
- @slot_window.x = PKD_Display.toCntrX(@slot_window.x/2,@slot_window.width)
- end
- #--------------------------------------------------------------------------
- # * Create Item Window
- #--------------------------------------------------------------------------
- #OVER
- def create_item_window
- wx = 0
- wy = @slot_window.y + @slot_window.height
- ww = PKD_Display::W
- wh = PKD_Display::H - @slot_window.y
- @item_window = Window_EquipItem.new(wx, wy, ww, wh)
- @item_window.viewport = @viewport
- @item_window.help_window = @help_window
- @item_window.status_window = @status_window
- @item_window.actor = @actor
- @item_window.set_handler(:ok, method(:on_item_ok))
- @item_window.set_handler(:cancel, method(:on_item_cancel))
- @slot_window.item_window = @item_window
- @item_window.x = PKD_Display.toCntrX(@item_window.x,@item_window.width)
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #------------------------------------------------------------------------------
- # This class performs battle screen processing.
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Battle_start start
- def start
- create_background
- pkd_Scene_Battle_start()
- end
- #NEW
- def create_background
- @background_sprite = Sprite.new
- @background_sprite.bitmap = SceneManager.background_bitmap
- @background_sprite.color.set(16, 16, 16, 180)
- end
- #--------------------------------------------------------------------------
- # * Create Information Display Viewport
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Battle_create_info_viewport create_info_viewport
- def create_info_viewport
- pkd_Scene_Battle_create_info_viewport()
- @info_viewport.rect.width = PKD_Display::W
- @info_viewport.rect.x = PKD_Display.toCntrX(0,PKD_Display::W)
- end
- #--------------------------------------------------------------------------
- # * Create Help Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Battle_create_help_window create_help_window
- def create_help_window
- pkd_Scene_Battle_create_help_window()
- @help_window.width = PKD_Display::W
- @help_window.x = PKD_Display.toCntrX(0,PKD_Display::W)
- @help_window.y = @help_window.height
- end
- #--------------------------------------------------------------------------
- # * Create Actor Commands Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Battle_create_actor_command_window create_actor_command_window
- def create_actor_command_window
- pkd_Scene_Battle_create_actor_command_window()
- @actor_command_window.x = PKD_Display::W
- end
- end
- #==============================================================================
- # ** Scene_File
- #------------------------------------------------------------------------------
- # This class performs common processing for the save screen and load screen.
- #==============================================================================
- class Scene_File < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_File_start start
- def start
- pkd_Scene_File_start()
- @help_window.window_to_center
- @help_window.width = PKD_Display::W
- end
- #--------------------------------------------------------------------------
- # * Create Save File Viewport
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_File_create_savefile_viewport create_savefile_viewport
- def create_savefile_viewport
- pkd_Scene_File_create_savefile_viewport()
- @savefile_viewport.rect.width = PKD_Display::W
- @savefile_viewport.rect.height = PKD_Display::H - @help_window.height
- @savefile_viewport.rect.y = PKD_Display.toCntrY(@help_window.y+@help_window.height,PKD_Display::H)
- @savefile_viewport.rect.x = PKD_Display.toCntrX(0,PKD_Display::W)
- end
- end
- #==============================================================================
- # ** Scene_Shop
- #------------------------------------------------------------------------------
- # This class performs shop screen processing.
- #==============================================================================
- class Scene_Shop < Scene_MenuBase
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Shop_start start
- def start
- pkd_Scene_Shop_start()
- @help_window.window_to_center
- @help_window.width = PKD_Display::W
- end
- #--------------------------------------------------------------------------
- # * Create Gold Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Shop_create_gold_window create_gold_window
- def create_gold_window
- pkd_Scene_Shop_create_gold_window()
- @gold_window.x = PKD_Display.toCntrX(PKD_Display::W - @gold_window.width,PKD_Display::W)
- @gold_window.y = PKD_Display.toCntrY(@help_window.height,PKD_Display::H)
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- #OVER
- def create_command_window
- @command_window = Window_ShopCommand.new(PKD_Display::W - @gold_window.width, @purchase_only)
- @command_window.viewport = @viewport
- @command_window.y = @help_window.height
- @command_window.set_handler(:buy, method(:command_buy))
- @command_window.set_handler(:sell, method(:command_sell))
- @command_window.set_handler(:cancel, method(:return_scene))
- @command_window.y = PKD_Display.toCntrY(@help_window.height,PKD_Display::H)
- @command_window.width = PKD_Display::W - @gold_window.width
- @command_window.x = PKD_Display.toCntrX(0,PKD_Display::W)
- end
- #--------------------------------------------------------------------------
- # * Create Dummy Window
- #--------------------------------------------------------------------------
- #OVER
- def create_dummy_window
- wy = @command_window.y + @command_window.height
- wh = PKD_Display::H - @command_window.height - @help_window.height
- @dummy_window = Window_Base.new(PKD_Display.toCntrX(0,PKD_Display::W), wy, PKD_Display::W, wh)
- @dummy_window.viewport = @viewport
- end
- #--------------------------------------------------------------------------
- # * Create Quantity Input Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Shop_create_number_window create_number_window
- def create_number_window
- pkd_Scene_Shop_create_number_window()
- @number_window.x = PKD_Display.toCntrX(0,PKD_Display::W)
- end
- #--------------------------------------------------------------------------
- # * Create Status Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Shop_create_status_window create_status_window
- def create_status_window
- pkd_Scene_Shop_create_status_window()
- @status_window.width = PKD_Display::W - @number_window.width
- @status_window.x = PKD_Display.toCntrX(@number_window.width,PKD_Display::W)
- end
- #--------------------------------------------------------------------------
- # * Create Purchase Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Shop_create_buy_window create_buy_window
- def create_buy_window
- pkd_Scene_Shop_create_buy_window()
- @buy_window.x = PKD_Display.toCntrX(0,PKD_Display::W)
- end
- #--------------------------------------------------------------------------
- # * Create Category Window
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Scene_Shop_create_category_window create_category_window
- def create_category_window
- pkd_Scene_Shop_create_category_window()
- @category_window.x = PKD_Display.toCntrX(0,PKD_Display::W)
- end
- #--------------------------------------------------------------------------
- # * Create Sell Window
- #--------------------------------------------------------------------------
- #OVER
- def create_sell_window
- wy = @category_window.y + @category_window.height
- wh = PKD_Display::H - @category_window.height - @help_window.height - @command_window.height
- @sell_window = Window_ShopSell.new(PKD_Display.toCntrX(0,PKD_Display::W), wy, PKD_Display::W, wh)
- @sell_window.viewport = @viewport
- @sell_window.help_window = @help_window
- @sell_window.hide
- @sell_window.set_handler(:ok, method(:on_sell_ok))
- @sell_window.set_handler(:cancel, method(:on_sell_cancel))
- @category_window.item_window = @sell_window
- end
- end
- #==============================================================================
- # Display
- # by Pheonix KageDesu
- #------------------------------------------------------------------------------
- #4 часть скрипта.
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- # This is a super class of all windows within the game.
- #==============================================================================
- class Window_Base
- #NEW
- def window_to_center
- self.x = PKD_Display.toCntrX(x,PKD_Display::W)
- self.y = PKD_Display.toCntrY(y,PKD_Display::H)
- end
- #NEW
- def window_to_size
- self.width = PKD_Display::W
- self.height = PKD_Display::H
- end
- #NEW
- def window_to_relative(glW, glH)
- self.x = PKD_Display.toCntrX(x,glW)
- self.y = PKD_Display.toCntrY(y,glH)
- end
- end
- #==============================================================================
- # ** Window_ChoiceList
- #------------------------------------------------------------------------------
- # This window is used for the event command [Show Choices].
- #==============================================================================
- class Window_ChoiceList < Window_Command
- #--------------------------------------------------------------------------
- # * Update Window Position
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Window_ChoiceList_update_placement update_placement
- def update_placement
- pkd_Window_ChoiceList_update_placement()
- self.width = [width, PKD_Display::W].min
- self.x = (Graphics.width/2) - (width / 2)
- end
- end
- #==============================================================================
- # ** Window_MenuStatus
- #------------------------------------------------------------------------------
- # This window displays party member status on the menu screen.
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- #OVER
- def window_width
- 384
- end
- #--------------------------------------------------------------------------
- # * Get Window Height
- #--------------------------------------------------------------------------
- #OVER
- def window_height
- 480
- end
- end
- #==============================================================================
- # ** Window_Message
- #------------------------------------------------------------------------------
- # This message window is used to display text.
- #==============================================================================
- class Window_Message < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Window_Message_initialize initialize
- def initialize
- pkd_Window_Message_initialize()
- self.x = PKD_Display.toCntrX(x,window_width)
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- #OVER
- def window_width
- PKD_Display::W + 20
- end
- end
- #==============================================================================
- # ** Window_ItemCategory
- #------------------------------------------------------------------------------
- # This window is for selecting a category of normal items and equipment
- # on the item screen or shop screen.
- #==============================================================================
- class Window_ItemCategory < Window_HorzCommand
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- #OVER
- def window_width
- PKD_Display::W
- end
- end
- #==============================================================================
- # ** Window_ScrollText
- #------------------------------------------------------------------------------
- # This window is for displaying scrolling text. No frame is displayed, but it
- # is handled as a window for convenience.
- #==============================================================================
- class Window_ScrollText < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- #ALIAS
- alias pkd_Window_ScrollText_initialize initialize
- def initialize
- pkd_Window_ScrollText_initialize()
- self.width = PKD_Display::W
- self.height = PKD_Display::H
- self.x = PKD_Display.toCntrX(0,PKD_Display::W)
- self.y = PKD_Display.toCntrY(0,PKD_Display::H)
- end
- end
- #==============================================================================
- # ** Window_SaveFile
- #------------------------------------------------------------------------------
- # This window displays save files on the save and load screens.
- #==============================================================================
- class Window_SaveFile < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- # index : index of save files
- #--------------------------------------------------------------------------
- #OVER
- def initialize(height, index)
- super(0, index * height, PKD_Display::W, height)
- @file_index = index
- refresh
- @selected = false
- end
- end
- #==============================================================================
- # ** Window_BattleStatus
- #------------------------------------------------------------------------------
- # This window is for displaying the status of party members on the battle
- # screen.
- #==============================================================================
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- #OVER
- def window_width
- PKD_Display::W - 128
- end
- end
- #==============================================================================
- # ** Window_BattleEnemy
- #------------------------------------------------------------------------------
- # Window for selecting the enemy who is the action target on the battle
- # screen.
- #==============================================================================
- class Window_BattleEnemy < Window_Selectable
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- #OVER
- def window_width
- PKD_Display::W - 128
- end
- #--------------------------------------------------------------------------
- # * Show Window
- #--------------------------------------------------------------------------
- #OVER
- def show
- if @info_viewport
- width_remain = PKD_Display::W - width
- self.x = @info_viewport.rect.x + width_remain
- @info_viewport.rect.width = width_remain
- select(0)
- end
- super
- end
- #--------------------------------------------------------------------------
- # * Hide Window
- #--------------------------------------------------------------------------
- #OVER
- def hide
- @info_viewport.rect.width = PKD_Display::W if @info_viewport
- super
- end
- end
- #==============================================================================
- # ** Window_BattleActor
- #------------------------------------------------------------------------------
- # This window is for selecting an actor's action target on the battle screen.
- #==============================================================================
- class Window_BattleActor < Window_BattleStatus
- #--------------------------------------------------------------------------
- # * Show Window
- #--------------------------------------------------------------------------
- #OVER
- def show
- if @info_viewport
- width_remain = PKD_Display::W - width
- self.x = @info_viewport.rect.x + width_remain
- @info_viewport.rect.width = width_remain
- select(0)
- end
- super
- end
- #--------------------------------------------------------------------------
- # * Hide Window
- #--------------------------------------------------------------------------
- #OVER
- def hide
- @info_viewport.rect.width = PKD_Display::W if @info_viewport
- super
- end
- end
- #==============================================================================
- # ** Window_BattleSkill
- #------------------------------------------------------------------------------
- # This window is for selecting skills to use in the battle window.
- #==============================================================================
- class Window_BattleSkill < Window_SkillList
- #--------------------------------------------------------------------------
- # * Object Initialization
- # info_viewport : Viewport for displaying information
- #--------------------------------------------------------------------------
- #OVER
- def initialize(help_window, info_viewport)
- y = help_window.y + help_window.height
- super(PKD_Display.toCntrX(0,PKD_Display::W), y, PKD_Display::W, info_viewport.rect.y - y)
- self.visible = false
- @help_window = help_window
- @info_viewport = info_viewport
- end
- end
- #==============================================================================
- # ** Window_BattleItem
- #------------------------------------------------------------------------------
- # This window is for selecting items to use in the battle window.
- #==============================================================================
- class Window_BattleItem < Window_ItemList
- #--------------------------------------------------------------------------
- # * Object Initialization
- # info_viewport : Viewport for displaying information
- #--------------------------------------------------------------------------
- #OVER
- def initialize(help_window, info_viewport)
- y = help_window.y + help_window.height
- super(PKD_Display.toCntrX(0,PKD_Display::W), y, PKD_Display::W, info_viewport.rect.y - y)
- self.visible = false
- @help_window = help_window
- @info_viewport = info_viewport
- end
- end
- #==============================================================================
- #Установка разрешения окна игры
- PKD_Display.set_1024
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement