#==============================================================================
# MOG MPW Equip V1.1 / HUD Przedmiotów XP
#==============================================================================
# Autor: Moghunter
#==============================================================================
# Tłumaczenie i korekta (wyświetlanie przedmiotów zamiast ekwipunku): Ayene
# Skrypt przerobiony tak, aby pokazywał przedmioty, a nie elementy ekwipunku.
#==============================================================================
# Skrypt wyświetla na mapie HUD z przedmiotami.
# Instalacja: Umieść skrypt nad Main.
#==============================================================================
if true # True = wyświetla HUD / False = nie wyświetla
module MOG
module Ayene
# Przełącznik, kontrolujący wyświetlanie HUD
EQPMAPVIS = 5
# położenie HUD:
# 0 - lewy górny róg
# 1 - prawy górny róg
# 2 - lewy dolny róg
# 3 - prawy dolny róg
# 4 - ręczne
EQPMAPPO = 2
# Położenie HUD (gdy wybrano ręczne) - współrzędne x i y
EQPMAPX = 210 # współrzędna x
EQPMAPY = 290 # współrzędna y
# ID przedmiotów, które będą wyświetlane w pasku
ID_PRZEDMIOTÓW = [16, 2, 3, 5, 17, 13, 19, 24]
# Wielkość dopasowana do ilości przedmiotów
DOPASOWANA_WIELKOŚĆ_HUD = true
# Ilość slotów na przedmioty, gdy wybrano false
ILOŚĆ_SLOTÓW = 19
end
end
$mogscript = {} if $mogscript == nil
$mogscript["mpequip"] = true
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
def draw_equip_map(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x + 3, y + 3, bitmap, Rect.new(0, 0, 24, 24))
number = $game_party.item_number(item.id)
self.contents.font.color = normal_color
self.contents.font.size = 16
self.contents.draw_text(x + 4, y + 3, 24, 32, number.to_s, 2)
end
def draw_mequip(x, y)
mequip = RPG::Cache.picture("sqequip")
cw = mequip.width
ch = mequip.height
src_rect = Rect.new(0, 0, cw, ch)
@data = []
for i in 0...$data_items.size
if $game_party.item_number(i) > 0 && MOG::Ayene::ID_PRZEDMIOTÓW.include?(i)
@data.push($data_items[i])
end
end
if MOG::Ayene::DOPASOWANA_WIELKOŚĆ_HUD
for i in
0...@data.size
self.contents.blt(32 * i, y, mequip, src_rect)
end
else
for i in 0...MOG::Ayene::ILOŚĆ_SLOTÓW
self.contents.blt(32 * i, y, mequip, src_rect)
end
end
end
end
class Window_Equipmap < Window_Base
def initialize(width)
super(0, 0, width, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@width = width
refresh
end
def refresh
self.contents.clear
draw_mequip(0,0)
@data = []
for i in 0...$data_items.size
if $game_party.item_number(i) > 0 && MOG::Ayene::ID_PRZEDMIOTÓW.include?(i)
@data.push($data_items[i])
end
end
@item_max = @data.size
if @item_max > 0
for i in 0...@item_max
draw_equip_map(@data[i], 32 * i, 0)
end
end
end
end
#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
alias mog8_main main
def main
@data = []
for i in 0...$data_items.size
if $game_party.item_number(i) > 0 && MOG::Ayene::ID_PRZEDMIOTÓW.include?(i)
@data.push($data_items[i])
end
end
if MOG::Ayene::DOPASOWANA_WIELKOŚĆ_HUD
eqmap_slots = 32 + @data.size * 32
else
eqmap_slots = 32 + MOG::Ayene::ILOŚĆ_SLOTÓW * 32
end
@eqmap = Window_Equipmap.new(190 + eqmap_slots)
case MOG::Ayene::EQPMAPPO
when 0
@eqmap.x = 0
@eqmap.y = 0
when 1
@eqmap.x = 640 - eqmap_slots
@eqmap.y = 0
when 2
@eqmap.x = 0
@eqmap.y = 420
when 3
@eqmap.x = 640 - eqmap_slots
@eqmap.y = 420
when 4
@eqmap.x = MOG::Ayene::EQPMAPX
@eqmap.y = MOG::Ayene::EQPMAPY
end
if $game_switches[MOG::Ayene::EQPMAPVIS] == false
@eqmap.visible = true
else
@eqmap.visible = false
end
mog8_main
@eqmap.dispose
end
alias mog8_update update
def update
if $game_switches[MOG::Ayene::EQPMAPVIS] == false
@eqmap.visible = true
else
@eqmap.visible = false
end
if $eref == true
@eqmap.refresh
$eref = false
end
mog8_update
end
end
#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
attr_accessor :eref
end
class Interpreter
def eref
$eref = true
end
alias mog319ref command_319
def command_319
eref
return mog319ref
end
alias mog126ref command_126
def command_126
eref
return mog126ref
end
end
end