04-03-2005, 01:00 PM
(This post was last modified: 06-11-2017, 04:48 AM by DerVVulfman.)
Hello all new script
Chrono Cry
Apr 3 2005
Im not exactly ace at scripting lol but here we go
Hey all i have made a edit of the shop system i cant say its exactly ace but certain people might be after a certain shop display so tell me what you think :D
Right first off replace all the contents of Scene_Shop with this
Then replace Window_ShopCommand with
Then replace Window_ShopBuy with
Then replace Window_ShopSell with
Lol this lags on
Then replace Window_ShopNumber with
And then finally replace Window_ShopStatus with
And that should do it :D hope you like it farewell
Chrono Cry
Apr 3 2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
Im not exactly ace at scripting lol but here we go
Hey all i have made a edit of the shop system i cant say its exactly ace but certain people might be after a certain shop display so tell me what you think :D
Right first off replace all the contents of Scene_Shop with this
Code:
#==============================================================================
# â–� Scene_Shop
#------------------------------------------------------------------------------
#  ショップ画��処� を行� クラス��。
#==============================================================================
class Scene_Shop
#--------------------------------------------------------------------------
# � メイン処�
#--------------------------------------------------------------------------
def main
# ヘルプウィンドウを作�
@help_window = Window_Help.new
# コマンドウィンドウを作�
@command_window = Window_ShopCommand.new
# ゴールドウィンドウを作�
@gold_window = Window_Gold.new
@gold_window.x = 520
@gold_window.y = 64
@gold_window.width = 120
# ダミーウィンドウを作�
@playtime_window = Window_Base.new(0, 0, 0, 0)
# 購入ウィンドウを作�
@buy_window = Window_ShopBuy.new($game_temp.shop_goods)
@buy_window.active = false
@buy_window.visible = false
@buy_window.help_window = @help_window
# 売�ウィンドウを作�
@sell_window = Window_ShopSell.new
@sell_window.active = false
@sell_window.visible = false
@sell_window.help_window = @help_window
# 個数入å� ›ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆ?
@number_window = Window_ShopNumber.new
@number_window.active = false
@number_window.visible = false
# ス� ータスウィンドウを作�
@status_window = Window_ShopStatus.new
@status_window.visible = false
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲー� 画�を更新
Graphics.update
# å…¥å� ›æƒ…å� ±ã‚’æ›´æ–°
Input.update
# フレー� 更新
update
# ç”»é?¢ã?Œåˆ‡ã‚� 替ã‚?ã?£ã?Ÿã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@help_window.dispose
@command_window.dispose
@gold_window.dispose
@playtime_window.dispose
@buy_window.dispose
@sell_window.dispose
@number_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# � フレー� 更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@help_window.update
@command_window.update
@gold_window.update
@playtime_window.update
@buy_window.update
@sell_window.update
@number_window.update
@status_window.update
# コマンドウィンドウã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ: update_command を呼ã?¶
if @command_window.active
update_command
return
end
# 購入ウィンドウã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ: update_buy を呼ã?¶
if @buy_window.active
update_buy
return
end
# 売å?´ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ: update_sell を呼ã?¶
if @sell_window.active
update_sell
return
end
# 個数入å� ›ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ: update_number を呼ã?¶
if @number_window.active
update_number
return
end
end
#--------------------------------------------------------------------------
# â—? フレーãƒ� æ›´æ–° (コマンドウィンドウã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ)
#--------------------------------------------------------------------------
def update_command
# B ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥?
$game_system.se_play($data_system.cancel_se)
# マップ画��切� 替�
$scene = Scene_Map.new
return
end
# C ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::C)
# コマンドウィンドウ�カーソル�置�� �
case @command_window.index
when 0 # 購入�る
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# ウィンドウã?®ç� ¶æ…‹ã‚’購入モードã?¸
@command_window.active = false
@playtime_window.visible = false
@buy_window.active = true
@buy_window.visible = true
@buy_window.refresh
@status_window.visible = true
when 1 # 売��る
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# ウィンドウã?®ç� ¶æ…‹ã‚’売å?´ãƒ¢ãƒ¼ãƒ‰ã?¸
@command_window.active = false
@playtime_window.visible = false
@sell_window.active = true
@sell_window.visible = true
@sell_window.refresh
when 2 # ã‚„ã‚?ã‚‹
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# マップ画��切� 替�
$scene = Scene_Map.new
end
return
end
end
#--------------------------------------------------------------------------
# â—? フレーãƒ� æ›´æ–° (購入ウィンドウã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ)
#--------------------------------------------------------------------------
def update_buy
# スãƒ� ータスウィンドウã?®ã‚¢ã‚¤ãƒ� ãƒ� ã‚’è¨å®š
@status_window.item = @buy_window.item
# B ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥?
$game_system.se_play($data_system.cancel_se)
# ウィンドウã?®ç� ¶æ…‹ã‚’åˆ?期モードã?¸
@command_window.active = true
@playtime_window.visible = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
# ヘルプãƒ� ã‚ストを消去
@help_window.set_text("")
return
end
# C ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::C)
# アイ� � を�得
@item = @buy_window.item
# アイãƒ� ãƒ� ã?Œç„¡å� ¹ã?®å� ´å?ˆã€?ã?¾ã?Ÿã?¯ä¾¡æ� ¼ã?Œæ‰€æŒ?金よã‚� ä¸� ã?®å� ´å?ˆ
if @item == nil or @item.price > $game_party.gold
# ブザー SE を演�
$game_system.se_play($data_system.buzzer_se)
return
end
# アイ� � �所�数を�得
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
# ã?™ã?§ã?« 99 個所æŒ?ã?—ã?¦ã?„ã‚‹å� ´å?ˆ
if number == 99
# ブザー SE を演�
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# 最大購入�能個数を計算
max = @item.price == 0 ? 99 : $game_party.gold / @item.price
max = [max, 99 - number].min
# ウィンドウã?®ç� ¶æ…‹ã‚’個数入å� ›ãƒ¢ãƒ¼ãƒ‰ã?¸
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
#--------------------------------------------------------------------------
# â—? フレーãƒ� æ›´æ–° (売å?´ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ)
#--------------------------------------------------------------------------
def update_sell
# B ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥?
$game_system.se_play($data_system.cancel_se)
# ウィンドウã?®ç� ¶æ…‹ã‚’åˆ?期モードã?¸
@command_window.active = true
@playtime_window.visible = true
@sell_window.active = false
@sell_window.visible = false
@status_window.item = nil
# ヘルプãƒ� ã‚ストを消去
@help_window.set_text("")
return
end
# C ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::C)
# アイ� � を�得
@item = @sell_window.item
# スãƒ� ータスウィンドウã?®ã‚¢ã‚¤ãƒ� ãƒ� ã‚’è¨å®š
@status_window.item = @item
# アイãƒ� ãƒ� ã?Œç„¡å� ¹ã?®å� ´å?ˆã€?ã?¾ã?Ÿã?¯ä¾¡æ� ¼ã?Œ 0 (売å?´ä¸?å?¯) ã?®å� ´å?ˆ
if @item == nil or @item.price == 0
# ブザー SE を演�
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE を演�
$game_system.se_play($data_system.decision_se)
# アイ� � �所�数を�得
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
# 最大売�個数 = アイ� � �所�数
max = number
# ウィンドウã?®ç� ¶æ…‹ã‚’個数入å� ›ãƒ¢ãƒ¼ãƒ‰ã?¸
@sell_window.active = false
@sell_window.visible = false
@number_window.set(@item, max, @item.price / 2)
@number_window.active = true
@number_window.visible = true
@status_window.visible = true
end
end
#--------------------------------------------------------------------------
# â—? フレーãƒ� æ›´æ–° (個数入å� ›ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?Œã‚¢ã‚¯ãƒ� ィブã?®å� ´å?ˆ)
#--------------------------------------------------------------------------
def update_number
# B ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥?
$game_system.se_play($data_system.cancel_se)
# 個数入å� ›ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’é?žã‚¢ã‚¯ãƒ� ィブ・ä¸?å?¯è¦–ã?«è¨å®š
@number_window.active = false
@number_window.visible = false
# コマンドウィンドウ�カーソル�置�� �
case @command_window.index
when 0 # 購入�る
# ウィンドウã?®ç� ¶æ…‹ã‚’購入モードã?¸
@buy_window.active = true
@buy_window.visible = true
when 1 # 売��る
# ウィンドウã?®ç� ¶æ…‹ã‚’売å?´ãƒ¢ãƒ¼ãƒ‰ã?¸
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
return
end
# C ボタンã?Œæ� ¼ã?•ã‚Œã?Ÿå� ´å?ˆ
if Input.trigger?(Input::C)
# ショップ SE を演�
$game_system.se_play($data_system.shop_se)
# 個数入å� ›ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’é?žã‚¢ã‚¯ãƒ� ィブ・ä¸?å?¯è¦–ã?«è¨å®š
@number_window.active = false
@number_window.visible = false
# コマンドウィンドウ�カーソル�置�� �
case @command_window.index
when 0 # 購入�る
# 購入処�
$game_party.lose_gold(@number_window.number * @item.price)
case @item
when RPG::Item
$game_party.gain_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.gain_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.gain_armor(@item.id, @number_window.number)
end
# å?„ウィンドウをリフレッシã�
�¥
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
# ウィンドウã?®ç� ¶æ…‹ã‚’購入モードã?¸
@buy_window.active = true
@buy_window.visible = true
when 1 # 売��る
# 売�処�
$game_party.gain_gold(@number_window.number * (@item.price / 2))
case @item
when RPG::Item
$game_party.lose_item(@item.id, @number_window.number)
when RPG::Weapon
$game_party.lose_weapon(@item.id, @number_window.number)
when RPG::Armor
$game_party.lose_armor(@item.id, @number_window.number)
end
# å?„ウィンドウをリフレッシã�
�¥
@gold_window.refresh
@sell_window.refresh
@status_window.refresh
# ウィンドウã?®ç� ¶æ…‹ã‚’売å?´ãƒ¢ãƒ¼ãƒ‰ã?¸
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
return
end
end
end
Then replace Window_ShopCommand with
Code:
#==============================================================================
# â–� Window_ShopCommand
#------------------------------------------------------------------------------
#  ショップ画é?¢ã?§ã€?用件をé?¸æ� žã?™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?§ã?™ã€‚
#==============================================================================
class Window_ShopCommand < Window_Selectable
#--------------------------------------------------------------------------
# � オブジェクト�期化
#--------------------------------------------------------------------------
def initialize
$fontface = "Times New Roman"
super(520, 128, 120, 130)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@item_max = 3
@row_max = 3
@commands = ["Buy", "Sell", "Exit"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# � リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# â—? é� …ç›®ã?®æ??ç”»
# index : é� …目番å?·
#--------------------------------------------------------------------------
def draw_item(index)
y = 4 + index * 30
self.contents.draw_text(26, y , 128, 32, @commands[index])
end
end
Then replace Window_ShopBuy with
Code:
#==============================================================================
# â–� Window_ShopBuy
#------------------------------------------------------------------------------
#  ショップ画é?¢ã?§ã€?購入ã?§ã??ã‚‹å•� å“?ã?®ä¸€è¦§ã‚’表示ã?™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?§ã?™ã€‚
#==============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# � オブジェクト�期化
# shop_goods : � �
#--------------------------------------------------------------------------
def initialize(shop_goods)
$fontface = "Times New Roman"
$fontsize = 20
super(0, 64, 520, 254)
@shop_goods = shop_goods
refresh
self.index = 0
@column_max = 2
end
#--------------------------------------------------------------------------
# � アイ� � ��得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# � リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for goods_item in @shop_goods
case goods_item[0]
when 0
item = $data_items[goods_item[1]]
when 1
item = $data_weapons[goods_item[1]]
when 2
item = $data_armors[goods_item[1]]
end
if item != nil
@data.push(item)
end
end
# é� …目数ã?Œ 0 ã?§ã?ªã?‘ã‚Œã?°ãƒ“ットマップを作æˆ?ã?—ã€?å…¨é� …目をæ??ç”»
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# â—? é� …ç›®ã?®æ??ç”»
# index : é� …目番å?·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
# アイ� � �所�数を�得
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
# 価æ� ¼ã?Œæ‰€æŒ?金以下ã€?ã?‹ã?¤æ‰€æŒ?æ•°ã?Œ 99 ã?§ã?ªã?‘ã‚Œã?°é€šå¸¸æ–‡å—色ã?«ã€?
# ã??ã?� ã?§ã?ªã?‘ã‚Œã?°ç„¡å� ¹æ–‡å—色ã?«è¨å®š
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (255 + 2)
y = index / 2 * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 25, y, 130, 32, item.name, 0)
self.contents.draw_text(x + 120, y, 88, 32, item.price.to_s, 2)
end
#--------------------------------------------------------------------------
# â—? ヘルプãƒ� ã‚スト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
Then replace Window_ShopSell with
Code:
#==============================================================================
# â–� Window_ShopSell
#------------------------------------------------------------------------------
#  ショップ画���売�����所�アイ� � �一覧を表示�るウィンドウ��。
#==============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# � オブジェクト�期化
#--------------------------------------------------------------------------
def initialize
super(0, 64, 520, 194)
@column_max = 2
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# � アイ� � ��得
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# � リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
# é� …目数ã?Œ 0 ã?§ã?ªã?‘ã‚Œã?°ãƒ“ットマップを作æˆ?ã?—ã€?å…¨é� …目をæ??ç”»
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# â—? é� …ç›®ã?®æ??ç”»
# index : é� …目番å?·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
# 売å?´å?¯èƒ½ã?ªã‚‰é€šå¸¸æ–‡å—色ã?«ã€?ã??ã?� ã?§ã?ªã?„ã?ªã‚‰ç„¡å� ¹æ–‡å—色ã?«è¨å®š
if item.price > 0
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (255 + 2)
y = index / 2 * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 25, y, 130, 32, item.name, 0)
self.contents.draw_text(x + 120, y, 88, 32, item.price.to_s, 2)
end
#--------------------------------------------------------------------------
# â—? ヘルプãƒ� ã‚スト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
Lol this lags on
Then replace Window_ShopNumber with
Code:
#==============================================================================
# â–� Window_ShopNumber
#------------------------------------------------------------------------------
#  ショップ画é?¢ã?§ã€?購入ã?¾ã?Ÿã?¯å£²å?´ã?™ã‚‹ã‚¢ã‚¤ãƒ� ãƒ� ã?®å€‹æ•°ã‚’å…¥å� ›ã?™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã?§ã?™ã€‚
#==============================================================================
class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
# � オブジェクト�期化
#--------------------------------------------------------------------------
def initialize
super(0, 64, 520, 254)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@item = nil
@max = 1
@price = 0
@number = 1
end
#--------------------------------------------------------------------------
# â—? アイãƒ� ãƒ� ã€?最大個数ã€?価æ� ¼ã?®è¨å®š
#--------------------------------------------------------------------------
def set(item, max, price)
@item = item
@max = max
@price = price
@number = 1
refresh
end
#--------------------------------------------------------------------------
# â—? å…¥å� ›ã?•ã‚Œã?Ÿå€‹æ•°ã?®è¨å®š
#--------------------------------------------------------------------------
def number
return @number
end
#--------------------------------------------------------------------------
# � リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_item_name(@item, 4, 96)
self.contents.font.color = normal_color
self.contents.draw_text(272, 96, 32, 32, "×")
self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2)
self.cursor_rect.set(304, 96, 32, 32)
# å?ˆè¨ˆä¾¡æ� ¼ã?¨é€šè²¨å?˜ä½?ã‚’æ??ç”»
domination = $data_system.words.gold
cx = contents.text_size(domination).width
total_price = @price * @number
self.contents.font.color = normal_color
self.contents.draw_text(4, 160, 328-cx-2, 32, total_price.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(332-cx, 160, cx, 32, domination, 2)
end
#--------------------------------------------------------------------------
# � フレー� 更新
#--------------------------------------------------------------------------
def update
super
if self.active
# カーソル� (+1)
if Input.repeat?(Input::RIGHT) and @number < @max
$game_system.se_play($data_system.cursor_se)
@number += 1
refresh
end
# カーソル左 (-1)
if Input.repeat?(Input::LEFT) and @number > 1
$game_system.se_play($data_system.cursor_se)
@number -= 1
refresh
end
# カーソル� (+98)
if Input.repeat?(Input::UP) and @number < @max
$game_system.se_play($data_system.cursor_se)
@number = [@number + 98, @max].min
refresh
end
# カーソル下 (-98)
if Input.repeat?(Input::DOWN) and @number > 1
$game_system.se_play($data_system.cursor_se)
@number = [@number - 98, 1].max
refresh
end
end
end
end
And then finally replace Window_ShopStatus with
Code:
#==============================================================================
# â–� Window_ShopStatus
#------------------------------------------------------------------------------
#  ショップ画���アイ� � �所�数やアクター�装備を表示�るウィンドウ��。
#==============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# � オブジェクト�期化
#--------------------------------------------------------------------------
def initialize
super(520, 258, 120, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@item = nil
refresh
end
#--------------------------------------------------------------------------
# � リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @item == nil
return
end
case @item
when RPG::Item
number = $game_party.item_number(@item.id)
when RPG::Weapon
number = $game_party.weapon_number(@item.id)
when RPG::Armor
number = $game_party.armor_number(@item.id)
end
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 100, 32, "Owned")
self.contents.font.color = normal_color
self.contents.draw_text(56, 0, 32, 32, number.to_s, 2)
if @item.is_a?(RPG::Item)
return
end
# 装備å“?追å� � 情å� ±
for i in 0...$game_party.actors.size
# アクターを�得
actor = $game_party.actors[i]
# 装備å?¯èƒ½ã?ªã‚‰é€šå¸¸æ–‡å—色ã?«ã€?ä¸?å?¯èƒ½ã?ªã‚‰ç„¡å� ¹æ–‡å—色ã?«è¨å®š
if actor.equippable?(@item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
# アクターã?®å??å‰?ã‚’æ??ç”»
self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
# �在�装備�を�得
if @item.is_a?(RPG::Weapon)
item1 = $data_weapons[actor.weapon_id]
elsif @item.kind == 0
item1 = $data_armors[actor.armor1_id]
elsif @item.kind == 1
item1 = $data_armors[actor.armor2_id]
elsif @item.kind == 2
item1 = $data_armors[actor.armor3_id]
else
item1 = $data_armors[actor.armor4_id]
end
# 装備å?¯èƒ½ã?ªå� ´å?ˆ
if actor.equippable?(@item)
# æ¦å™¨ã?®å� ´å?ˆ
if @item.is_a?(RPG::Weapon)
atk1 = item1 != nil ? item1.atk : 0
atk2 = @item != nil ? @item.atk : 0
change = atk2 - atk1
end
# 防具ã?®å� ´å?ˆ
if @item.is_a?(RPG::Armor)
pdef1 = item1 != nil ? item1.pdef : 0
mdef1 = item1 != nil ? item1.mdef : 0
pdef2 = @item != nil ? @item.pdef : 0
mdef2 = @item != nil ? @item.mdef : 0
change = pdef2 - pdef1 + mdef2 - mdef1
end
# パラメータã?®å¤‰åŒ–値をæ??ç”»
self.contents.draw_text(124, 64 + 64 * i, 112, 32,
sprintf("%+d", change), 2)
end
# アイãƒ� ãƒ� ã‚’æ??ç”»
if item1 != nil
x = 4
y = 64 + 64 * i + 32
bitmap = RPG::Cache.icon(item1.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item1.name)
end
end
end
#--------------------------------------------------------------------------
# â—? アイãƒ� ãƒ� ã?®è¨å®š
# item : 新��アイ� �
#--------------------------------------------------------------------------
def item=(item)
if @item != item
@item = item
refresh
end
end
end
And that should do it :D hope you like it farewell