赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 0 |
最后登录 | 2016-7-7 |
在线时间 | 6 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 995
- 在线时间
- 6 小时
- 注册时间
- 2014-7-26
- 帖子
- 2
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 VIPArcher 于 2014-11-20 11:23 编辑
因为不懂写脚本,都是在论坛里找一些脚本来改数据
根据@945127391 大大教程里的脚本改了一下来显示时间
时间是用自带的变量和公共事件设置的↓
大概就是这个样子↓
但是触发更改时间和金钱的事件不会马上刷新数据,比如初始金币是0,触发了给金币的事件之后还是显示0,打开一下菜单再关掉才会显示出当前的金钱,时间也是,不会即时刷新。
求教一下要怎么改才能让数据一更改就刷新。
class Game_Actor < Game_Battler
#----------------------------------------------------------------------------
# * 重命名方法
#----------------------------------------------------------------------------
alias ms_refresh refresh
alias ms_tp tp=
alias ms_add_state add_state
#--------------------------------------------------------------------------
# * 刷新
#--------------------------------------------------------------------------
def refresh
ms_refresh
$refresh = true
end
#----------------------------------------------------------------------------
# * 更改 TP
#----------------------------------------------------------------------------
def tp=(tp)
ms_tp(tp)
$refresh = true
end
#----------------------------------------------------------------------------
# * 附加状态
#----------------------------------------------------------------------------
def add_state(state_id)
ms_add_state(state_id)
$refresh = true
end
end
class Game_Party
#----------------------------------------------------------------------------
# * 重命名方法
#----------------------------------------------------------------------------
alias ms_swap_order swap_order
#----------------------------------------------------------------------------
# * 交换顺序
#----------------------------------------------------------------------------
def swap_order(index1, index2)
ms_swap_order(index1, index2)
$refresh = true
end
end
#==============================================================================
# ** Window_MapStatus
#==============================================================================
class Window_MapStatus < Window_Base
#----------------------------------------------------------------------------
# * 初始化
#----------------------------------------------------------------------------
def initialize
super(0, 0, 273, 144)
self.opacity = 0
refresh
end
#----------------------------------------------------------------------------
# * 刷新画面
#----------------------------------------------------------------------------
def update
super
refresh if $refresh
$refresh = false
if $game_player.screen_x >= 0 and $game_player.screen_x <= self.width and
$game_player.screen_y >= 0 and $game_player.screen_y <= self.height
self.contents_opacity = 75
else self.contents_opacity = 255
end
end
#----------------------------------------------------------------------------
# * 更新内容
#----------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_face($game_party.members[0], 0, 0)
draw_actor_icons($game_party.members[0], 0, 72)
draw_actor_name($game_party.members[0], 101, 24)
draw_currency_value($game_party.gold, Vocab::currency_unit, 72, 0, self.contents.width-101)
draw_actor_nickname($game_party.members[0], 101, 48)
draw_text(101,72, self.contents.width,24,$game_variables[97])
draw_text(137,72, self.contents.width,24,"时")
draw_text( 0,96, self.contents.width,24,$game_variables[100])
draw_text( 51,96, self.contents.width,24,"年")
draw_text( 85,96, self.contents.width,24,$game_variables[99])
draw_text(119,96, self.contents.width,24,"月")
draw_text(153,96, self.contents.width,24,$game_variables[98])
draw_text(187,96, self.contents.width,24,"日")
end
end
class Scene_Map < Scene_Base
#----------------------------------------------------------------------------
# * 重命名方法
#----------------------------------------------------------------------------
alias ms_sta start
#----------------------------------------------------------------------------
# * 开始处理
#----------------------------------------------------------------------------
def start
ms_sta
@mapstatus_window = Window_MapStatus.new
end
end
class Game_Actor < Game_Battler
#----------------------------------------------------------------------------
# * 重命名方法
#----------------------------------------------------------------------------
alias ms_refresh refresh
alias ms_tp tp=
alias ms_add_state add_state
#--------------------------------------------------------------------------
# * 刷新
#--------------------------------------------------------------------------
def refresh
ms_refresh
$refresh = true
end
#----------------------------------------------------------------------------
# * 更改 TP
#----------------------------------------------------------------------------
def tp=(tp)
ms_tp(tp)
$refresh = true
end
#----------------------------------------------------------------------------
# * 附加状态
#----------------------------------------------------------------------------
def add_state(state_id)
ms_add_state(state_id)
$refresh = true
end
end
class Game_Party
#----------------------------------------------------------------------------
# * 重命名方法
#----------------------------------------------------------------------------
alias ms_swap_order swap_order
#----------------------------------------------------------------------------
# * 交换顺序
#----------------------------------------------------------------------------
def swap_order(index1, index2)
ms_swap_order(index1, index2)
$refresh = true
end
end
#==============================================================================
# ** Window_MapStatus
#==============================================================================
class Window_MapStatus < Window_Base
#----------------------------------------------------------------------------
# * 初始化
#----------------------------------------------------------------------------
def initialize
super(0, 0, 273, 144)
self.opacity = 0
refresh
end
#----------------------------------------------------------------------------
# * 刷新画面
#----------------------------------------------------------------------------
def update
super
refresh if $refresh
$refresh = false
if $game_player.screen_x >= 0 and $game_player.screen_x <= self.width and
$game_player.screen_y >= 0 and $game_player.screen_y <= self.height
self.contents_opacity = 75
else self.contents_opacity = 255
end
end
#----------------------------------------------------------------------------
# * 更新内容
#----------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_face($game_party.members[0], 0, 0)
draw_actor_icons($game_party.members[0], 0, 72)
draw_actor_name($game_party.members[0], 101, 24)
draw_currency_value($game_party.gold, Vocab::currency_unit, 72, 0, self.contents.width-101)
draw_actor_nickname($game_party.members[0], 101, 48)
draw_text(101,72, self.contents.width,24,$game_variables[97])
draw_text(137,72, self.contents.width,24,"时")
draw_text( 0,96, self.contents.width,24,$game_variables[100])
draw_text( 51,96, self.contents.width,24,"年")
draw_text( 85,96, self.contents.width,24,$game_variables[99])
draw_text(119,96, self.contents.width,24,"月")
draw_text(153,96, self.contents.width,24,$game_variables[98])
draw_text(187,96, self.contents.width,24,"日")
end
end
class Scene_Map < Scene_Base
#----------------------------------------------------------------------------
# * 重命名方法
#----------------------------------------------------------------------------
alias ms_sta start
#----------------------------------------------------------------------------
# * 开始处理
#----------------------------------------------------------------------------
def start
ms_sta
@mapstatus_window = Window_MapStatus.new
end
end
|
|