#-------------------------------------------------------------------------- # ● 生成角色窗口【物品栏里的小头像使用者界面】 #-------------------------------------------------------------------------- def create_actor_window @actor_window = Window_MenuTarget.new#Window_MenuActor.new if SceneManager.scene.is_a?(Scene_Item) # @actor_window.y = 76 # 7 @actor_window.y -= 7 # 7 @actor_window.x = 4 # 4 @actor_window.height = 320 #342 end @actor_window.set_handler(:ok, method(:on_actor_ok)) @actor_window.set_handler(:cancel, method(:on_actor_cancel)) @actor_window.opacity = 255 #255 end
#encoding:utf-8 #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # 物品/技能画面中,显示队伍成员状态的窗口 #============================================================================== class Window_MenuTarget < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 # 物品/技能画面的人物小头像区域 #-------------------------------------------------------------------------- def initialize super(4 , 82, window_width, window_height - 100 ) self.visible = true #false #判断是否直接显示 refresh end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width 150 end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height 390 # Graphics.height # end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max $game_party.members.size end #-------------------------------------------------------------------------- # ● 获取列数 #-------------------------------------------------------------------------- def col_max return 1 end #-------------------------------------------------------------------------- # ● 获取项目的高度 #-------------------------------------------------------------------------- def item_height (height - standard_padding * 2) / 4 end #-------------------------------------------------------------------------- # ● 绘制项目 #-------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) dx = 96 m = 0.8 draw_actor_name(actor, rect.x + 32, rect.y * m + 8) draw_actor_megaface(actor, rect.x + 2, rect.y * m + 8) draw_actor_icons(actor, rect.x + 100, rect.y * m + 6) #中毒等状态的图标 draw_actor_hp(actor, rect.x + 1 , rect.y * m + 28)#+ line_height / 2 + line_height ) draw_actor_mp(actor, rect.x + 1 , rect.y * m + 48)#+ line_height / 2 + line_height + 16) # draw_actor_tp(actor, rect.x + 1 , rect.y * m + 56)#+ line_height / 2 + line_height + 32) end #-------------------------------------------------------------------------- # ● 按下确定键时的处理 #-------------------------------------------------------------------------- def process_ok $game_party.target_actor = $game_party.members[index] unless @cursor_all call_ok_handler end #-------------------------------------------------------------------------- # ● 返回上一个选择的位置 #-------------------------------------------------------------------------- def select_last select($game_party.menu_actor.index || 0) end #-------------------------------------------------------------------------- # ● 设置光标的选择位置/范围 #-------------------------------------------------------------------------- def select_for_item(item) @item = item @cursor_fix = item.for_user? @cursor_all = item.for_all? if @cursor_fix select($game_party.menu_actor.index) elsif @cursor_all select(0) else select_last end end #-------------------------------------------------------------------------- # ● 定义光标矩形 #-------------------------------------------------------------------------- def update_cursor if @index < 0 self.cursor_rect.empty else ensure_cursor_visible self.cursor_rect.set(0, @index * 72, 126, 77) #(0, @index * 78 + 4, 126, 77) end if @item != nil if @item.for_all? self.cursor_rect.set(0, 0, 126, item_max * 78 ) end end end end
未命名.PNG (37.44 KB, 下载次数: 27)
#-------------------------------------------------------------------------- # ● 生成角色窗口【物品栏里的小头像使用者界面】 #-------------------------------------------------------------------------- def create_actor_window @actor_window = Window_MenuTarget.new#Window_MenuActor.new if SceneManager.scene.is_a?(Scene_Item) # @actor_window.y = 76 # 7 @actor_window.y -= 7 # 7 @actor_window.x = 4 # 4 @actor_window.height = 320 #342 end if SceneManager.scene.is_a?(Scene_skill) # @actor_window.y = 76 # 7 @actor_window.y -= 7 # 7 @actor_window.x = 4 # 4 @actor_window.height = 320 #342 end @actor_window.set_handler(:ok, method(:on_actor_ok)) @actor_window.set_handler(:cancel, method(:on_actor_cancel)) @actor_window.opacity = 255 #255 end
#-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max if XXOO(队伍中有4人) then 4 else $game_party.members.size end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |