赞 | 0 |
VIP | 15 |
好人卡 | 21 |
积分 | 7 |
经验 | 24727 |
最后登录 | 2021-10-29 |
在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607
|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 * N- ^ {( P8 K
0 N8 M( Q. c @2 E2 g3 t
在Extra Skill里按1~5是设置2 L3 X& W3 m& I, }+ F: j
设置好后回到地图按1~5就是……切换。) w% m( A3 h2 X
4 c! S" U% u; d4 y, l* R
请问是要改成直接使用吗?
. E* z6 W+ u, [( x# a
( B0 ~/ y2 ~" c- F0 E那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。' _8 `# ?4 `. Q: c
#=============================================================================== # XAS - Hot Key HUD #=============================================================================== # By Mr_Wiggles # Version 1.3 # 7/6/10 #------------------------------------------------------------------------------- # Instructions: # Fill in the constants bellow, paste this script above main and bellow XAS in # your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!! # # Place the "Hot_Keys_HUD" picture file into your game directory # Graphics/Pictures folder. #------------------------------------------------------------------------------- # Directions of Use: # Simple just press a number key (1 - 5) when the quick skill or item menu is # Showing. #=============================================================================== HUD_X = 0 # X pos of HUD HUD_Y = 0 # Y pos of HUD XAS_HUDDISABLE_HUD_SWITCH = 1 # Set true if XAS 3.7f # set false if XAS 3.6 XASVER_37 = true #=============================================================================== # Numkeys Module #=============================================================================== module Input Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053} class << self Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i') def testkey(key) Key.call(key) & 0x01 == 1 end alias hud_key_update update def update hud_key_update @pressed = [] for key in Numkey.values key -= 1000 @pressed.push(key) if testkey(key) end end def pressed?(key) key -= 1000 @pressed = [] if @pressed.nil? return true if @pressed.include?(key) return false end alias hud_key_press? press? def press?(key) return pressed?(key) if key.to_f > 1000 hud_key_press?(key) end end end #=============================================================================== # Game Player #=============================================================================== class Game_Player < Game_Character attr_accessor :hud_equip attr_accessor :hud_item_id attr_accessor :hud_skill_id alias hot_key_hud_init initialize def initialize hot_key_hud_init @hud_equip = [] @hud_item_id = [] @hud_skill_id = [] end def equip_item_to_hud(n, item) if item.nil? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item) @hud_equip[n] = item @hud_item_id[n] = XAS::XASITEM_ID[item.id] @hud_skill_id[n] = item.id end end #=============================================================================== # Quick Skill Window #=============================================================================== if XASVER_37 == false class Xas_Scene_Skill alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hotkey_hud_qucik_menu_update update def update hotkey_hud_qucik_menu_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @skill_window.skill) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @skill_window.skill) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @skill_window.skill) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @skill_window.skill) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @skill_window.skill) end @hot_key_hud.update end end else class Quick_Menu_Skill alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hotkey_hud_qucik_menu_update update def update hotkey_hud_qucik_menu_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @skill_window.skill) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @skill_window.skill) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @skill_window.skill) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @skill_window.skill) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @skill_window.skill) end @hot_key_hud.update end end end #=============================================================================== # Quick Item Window #=============================================================================== if XASVER_37 == false class Xas_Scene_Item alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hud_key_update update def update hud_key_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @item_window.item) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @item_window.item) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @item_window.item) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @item_window.item) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @item_window.item) end @hot_key_hud.update end end else class Quick_Menu_Item alias hud_quick_menu_main main def main @hot_key_hud = Hot_Key_HUD.new hud_quick_menu_main @hot_key_hud.dispose end alias hud_key_update update def update hud_key_update # Hot Key num 1 if Input.press?(Input::Numkey[1]) $game_player.equip_item_to_hud(0, @item_window.item) # Hot Key num 2 elsif Input.press?(Input::Numkey[2]) $game_player.equip_item_to_hud(1, @item_window.item) # Hot Key num 3 elsif Input.press?(Input::Numkey[3]) $game_player.equip_item_to_hud(2, @item_window.item) # Hot Key num 4 elsif Input.press?(Input::Numkey[4]) $game_player.equip_item_to_hud(3, @item_window.item) # Hot Key num 5 elsif Input.press?(Input::Numkey[5]) $game_player.equip_item_to_hud(4, @item_window.item) end @hot_key_hud.update end end end #=============================================================================== # HUD Window #=============================================================================== class Hot_Key_HUD < Window_Base def initialize(x = HUD_X - 10, y = HUD_Y - 15) super(x, y, 220, 80) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 @actor = $game_party.actors[0] refresh end def refresh self.contents.clear bitmap = RPG::Cache.picture("Hot_Keys_HUD") self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32)) for i in 0..4 x = 32 * i + 4 item = $game_player.hud_equip[i] next if item.nil? if item.is_a?(RPG::Weapon) item = nil if $game_party.weapon_number(item.id) == 0 and @actor.weapon_id != item.id elsif item.is_a?(RPG::Armor) item = nil if $game_party.armor_number(item.id) == 0 and @actor.armor1_id != item.id elsif item.is_a?(RPG::Item) item = nil if $game_party.item_number(item.id) == 0 or !$game_party.item_can_use?(item.id) end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) end end def equip(item) if item.nil? $game_system.se_play($data_system.buzzer_se) return end if item.is_a?(RPG::Skill) if !@actor.skill_can_use?(item.id) $game_system.se_play($data_system.buzzer_se) return end #$game_system.xas_skill_id = item.id @item_type = false elsif item.is_a?(RPG::Weapon) @actor.equip(0, item.id) elsif item.is_a?(RPG::Armor) @actor.equip(1, item.id) elsif item.is_a?(RPG::Item) item_tool_id = XAS::XASITEM_ID[item.id] if item_tool_id != nil unless $game_party.item_can_use?(item.id) $game_system.se_play($data_system.buzzer_se) return end #$game_system.xas_item_id = item.id @item_type = true end end #$game_system.se_play($data_system.equip_se) end def use_hud_item(i) if @item_type $game_temp.force_action_id = $game_player.hud_item_id[i] else $game_temp.force_action_id = $game_player.hud_skill_id[i] end end def update @actor = $game_party.actors[0] @hot_keys = $game_player.hud_equip refresh return if !$scene.is_a?(Scene_Map) if Input.press?(Input::Numkey[1]) equip($game_player.hud_equip[0]) use_hud_item(0) elsif Input.press?(Input::Numkey[2]) equip($game_player.hud_equip[1]) use_hud_item(1) elsif Input.press?(Input::Numkey[3]) equip($game_player.hud_equip[2]) use_hud_item(2) elsif Input.press?(Input::Numkey[4]) equip($game_player.hud_equip[3]) use_hud_item(3) elsif Input.press?(Input::Numkey[5]) equip($game_player.hud_equip[4]) use_hud_item(4) end end end #=============================================================================== # Scene Map #=============================================================================== class Scene_Map alias hot_key_hud_init main def main @hot_key_hud = Hot_Key_HUD.new @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] hot_key_hud_init @hot_key_hud.dispose end alias hot_key_hud_update update def update hot_key_hud_update @hot_key_hud.update @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] end end
#=============================================================================== 2 d& e5 f8 f% e0 \3 e
# XAS - Hot Key HUD # v+ ~/ @; m: k
#=============================================================================== $ B+ R, v5 A! u @: S& Y$ ?0 d
# By Mr_Wiggles
# s9 i" l( t4 F# Version 1.3 & e% u2 S2 O9 m0 v; v$ o$ [
# 7/6/10 + A4 J! J6 f; } f7 w3 k
#-------------------------------------------------------------------------------
f% \; O- P$ f4 n; H$ l# Instructions: 1 E5 I8 g9 |8 b# Z+ v# c
# Fill in the constants bellow, paste this script above main and bellow XAS in 8 a! H- A0 n6 N9 [* X% @
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!! 6 @: ]8 b0 u0 i( ?$ P
#
! Z9 w3 f0 H) [5 M2 [: N) d# Place the "Hot_Keys_HUD" picture file into your game directory
. T2 I+ S( s$ t+ O2 c0 C# Graphics/Pictures folder. # [- v+ y' e& g/ y V
#-------------------------------------------------------------------------------
! J8 e+ D% M( ^7 x2 @) y# Directions of Use: 2 W; D' Y+ `3 ]7 D# [2 ?
# Simple just press a number key (1 - 5) when the quick skill or item menu is
$ S0 d. A5 B- B) s- l# Showing.
3 N; l% p5 G( {$ _- \% x8 w9 a, A#===============================================================================
5 C' N! b" h9 Y8 O( K4 cHUD_X = 0 # X pos of HUD # H& J( x- u/ r9 o3 T
HUD_Y = 0 # Y pos of HUD
0 A, e% B L) v4 I8 D$ g5 _' AXAS_HUDDISABLE_HUD_SWITCH = 1 ; y; V" ^. H1 [! [ k3 ^8 r ^2 y
1 {9 r* `* ~( a' H3 o3 y; M1 z7 n# Set true if XAS 3.7f
7 v: P [8 Q) c6 m$ a/ O# set false if XAS 3.6
! }8 A+ w1 N {2 e' b7 xXASVER_37 = true
( c) t# x7 w# K1 @
. I3 ?% X# ?2 {3 x& n$ ^#=============================================================================== . w. N% B4 W a+ x1 D0 _9 B
# Numkeys Module : T t5 b! [# ]* R9 ]
#=============================================================================== + j4 P5 C+ C8 Q$ v6 `4 X
module Input
) H5 Q+ J; f1 u0 _7 O$ u Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
9 g" T3 s p! S* w" }0 S class << self ! K* w% v; |6 r8 [/ s- E! R# L' {
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
2 I' a" p% q' }- } i" { E. A/ B
7 q- Q: r, T; a+ H! U: t def testkey(key)
3 c& g/ d$ Y9 N Key.call(key) & 0x01 == 1 0 C/ l& W) N7 O3 J0 ~
end * ^, P6 D4 S5 r$ k
) S. w8 C: C9 w alias hud_key_update update / k, H: g6 V" f6 ~% b8 u& X- M
def update : z7 I5 e* g( X
hud_key_update
; U3 b% u! b& I& T @pressed = [] / g2 x+ I$ v) n+ s8 B; f2 E( G
for key in Numkey.values / Y0 d# M8 \( n7 Y: A+ g7 ^9 f
key -= 1000
7 t* {+ U5 e# m/ v @pressed.push(key) if testkey(key)
5 q* }2 x0 N4 e# p; r' k1 @ end 3 ]; O/ V! i3 R$ d! H
end ! J2 x6 c8 I, i+ `3 @( v: a0 \: t& Y
7 W* V: V& |, z def pressed?(key) 9 m7 k% [6 n- H# p7 f$ ^
key -= 1000 . X" s! s x: q
@pressed = [] if @pressed.nil?
1 t1 ]" ^& e0 j3 N8 I; z return true if @pressed.include?(key) : J7 j* O3 u, f
return false
* }. A+ r+ z \& _& T R end , S. H# v8 [$ v9 O, ^
& m, @- k d3 C& }6 ^0 ^
alias hud_key_press? press? / x; R4 s, X4 ~1 J( A- v
def press?(key)
7 m3 z) b% O( t; D) t return pressed?(key) if key.to_f > 1000 ! F! H- d$ N i4 M. y0 n
hud_key_press?(key)
9 @" R7 m1 H% J end ; B: M$ H C; S1 S" `. L+ Z y/ Q/ l
end & U0 B! ?3 C) S; L7 I
end 9 l0 I9 \" }4 F1 _
, m7 ?/ j; _$ a( K+ a
#===============================================================================
- Z* m# K* s4 z8 r& q1 g; e5 T# Game Player & G; a2 g0 n6 S4 ?' v" y% z
#=============================================================================== 7 j7 k# o1 C2 P. B) _
class Game_Player < Game_Character * I. |# o# N1 ]; M
attr_accessor :hud_equip
2 t+ i c( {, C attr_accessor :hud_item_id # T j5 b" X7 I" Z, q% S: H F, ~$ d8 L
attr_accessor :hud_skill_id , F1 J l) t" [$ k9 P
5 E5 v6 [& }3 b$ Z, p3 Q alias hot_key_hud_init initialize . N, e, [3 Z6 ]) Z o) Z
def initialize
9 H7 g, U$ I$ P1 s, {" k hot_key_hud_init
2 _1 c8 U, S5 d# F' D @hud_equip = [] * I0 a# f+ X1 J# P
@hud_item_id = [] # E1 c8 n3 D% |
@hud_skill_id = [] 0 \+ U; _2 a ?; ?2 F7 z
end 5 @( d' r# J% `4 r; C- G( h8 I
3 X# ~4 \3 Q1 J* A" N- z/ l
def equip_item_to_hud(n, item)
% c# S4 L7 h, E5 G" q if item.nil?
' v) l( l) j5 ~. w3 c $game_system.se_play($data_system.buzzer_se) / s$ o3 e3 D7 x) V# v
return
( X6 K+ z9 g+ L9 i6 t ?" O4 j end
, E6 G" R; Y. V0 U5 F {. ~ $game_system.se_play($data_system.decision_se) # Y/ K& [% s( d% {
@hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item) 5 D2 E1 Z4 O' R6 ], N
@hud_equip[n] = item
2 j) Z; G4 c: l( R e+ t6 D @hud_item_id[n] = XAS::XASITEM_ID[item.id]
/ t: w$ e/ R! Z7 @6 J( [; I" B @hud_skill_id[n] = item.id # N" @: H) U& @9 a3 a9 S6 ~) C
end
; o9 p/ c2 e; e) }$ G6 e5 J$ mend
" C( P" \' F9 D
|0 @. J/ e9 H# y9 C3 U#===============================================================================
7 c6 @( E" |8 r. }# Quick Skill Window 9 p$ P. p+ C6 {
#===============================================================================
( ^* L! X I' q. C/ @5 xif XASVER_37 == false % L% l1 ]% E, L" f; T& B
class Xas_Scene_Skill
" A# Q4 l# U! Z2 g alias hud_quick_menu_main main
1 D- M' n. l: f9 r def main
% p }- ^( }/ D4 s" `4 i4 c @hot_key_hud = Hot_Key_HUD.new ! j9 y3 F, B* H6 E1 _7 k% Z
hud_quick_menu_main / B5 ], J* c# |9 T4 v
@hot_key_hud.dispose ( s, I, H: b4 y, t) f: P
end & i' S; {" F% l" D
% |/ }7 ^- F+ A8 Y6 g alias hotkey_hud_qucik_menu_update update 0 |- u O8 A7 e
def update
( `4 v1 {* A7 N0 e$ S* @! `0 A7 U hotkey_hud_qucik_menu_update 1 e& f) v' f) c# _2 d1 q: |
# Hot Key num 1
; _! L0 K( V3 o# J6 N. h* b1 V if Input.press?(Input::Numkey[1]) 8 ~6 f* e+ F: @/ \' z+ s
$game_player.equip_item_to_hud(0, @skill_window.skill) $ l' I; }( a9 J7 A- r$ t% N. W
# Hot Key num 2
5 o% ~7 e: h0 F elsif Input.press?(Input::Numkey[2]) 6 R' O) G; z7 k8 ^% O5 Q
$game_player.equip_item_to_hud(1, @skill_window.skill) + Y: d& j1 x) ?2 l G
# Hot Key num 3
6 |4 K: x V; e) }) P4 q- g- \3 b" n elsif Input.press?(Input::Numkey[3]) 5 C# |' n; O# G
$game_player.equip_item_to_hud(2, @skill_window.skill)
% a) u I# u! R6 O: R% k # Hot Key num 4
& c3 x y5 I, J/ C( y! a- L+ z elsif Input.press?(Input::Numkey[4]) 8 h2 U6 B7 w9 T& f+ S0 S
$game_player.equip_item_to_hud(3, @skill_window.skill) - V6 ~; O8 P8 {, ]# \6 A, w
# Hot Key num 5
" I/ F, Q0 U3 s: k& _0 [8 F- ` elsif Input.press?(Input::Numkey[5])
3 `: v0 Z/ K0 W& } $game_player.equip_item_to_hud(4, @skill_window.skill)
9 A0 S) v i9 `- I end
& k" I9 e: h& ^/ m# v. m @hot_key_hud.update
9 o4 i" o `0 m( {9 S# {7 E end . j, p+ u/ b% d
end
3 G; {' F) f* v2 A9 I/ z$ T! b+ ]else
3 v6 k! g3 ^% q* ?/ Y# S class Quick_Menu_Skill
# V( l# E+ Q* c9 k2 C( Z' { alias hud_quick_menu_main main 7 P, j0 Q' V2 v: V+ h, I: r
def main
* F& h( W) H* \% @/ `0 W9 S @hot_key_hud = Hot_Key_HUD.new
' k/ Z4 O# {9 V# w/ m% [ hud_quick_menu_main
- X3 p5 n# |' V7 D1 M p- G7 Q& U8 B @hot_key_hud.dispose & c2 G6 K* B+ B; O
end * y8 c; N H0 \+ F
3 B" V# N2 e5 k+ K- j
alias hotkey_hud_qucik_menu_update update
; j4 Q+ Y F4 G9 a- _) `$ q+ w def update
# x# s, Y4 b# W5 D% z hotkey_hud_qucik_menu_update . a! G. T* _/ e1 \
# Hot Key num 1 ^6 H9 B) |6 F
if Input.press?(Input::Numkey[1])
$ e7 t" d- G2 u5 M3 j $game_player.equip_item_to_hud(0, @skill_window.skill) 0 u# D5 u& S# @2 k) T) A- |3 o
# Hot Key num 2
( O' L/ h, @, f6 X2 [3 B elsif Input.press?(Input::Numkey[2])
% Q0 z4 L6 F9 {, |. S $game_player.equip_item_to_hud(1, @skill_window.skill)
+ O( H; M; W+ `/ r # Hot Key num 3 . e$ O' X5 M! v9 a# V
elsif Input.press?(Input::Numkey[3])
. X3 ?2 @7 _1 W$ i3 B" i* w $game_player.equip_item_to_hud(2, @skill_window.skill)
( {+ y1 [. @, P# N( f# f; @% B# C" o5 H # Hot Key num 4 1 t) p8 J C6 @$ a
elsif Input.press?(Input::Numkey[4]) * n' k1 g, e( R) q5 t3 A. D7 q
$game_player.equip_item_to_hud(3, @skill_window.skill)
0 o% Y$ \" j0 W/ R0 d' v # Hot Key num 5
" w2 D* {5 G8 C elsif Input.press?(Input::Numkey[5])
/ p# U- c; g. k/ F; i $game_player.equip_item_to_hud(4, @skill_window.skill)
: F6 L( X, @5 t0 Q/ ]8 q end 8 h+ Z( `5 P" A0 F' {, V5 F
@hot_key_hud.update
2 P8 v9 m8 ^/ L* W5 G end
* l4 k) R. G' b4 X. q1 u end $ |. Y( I. T* @2 X2 l6 c# K% \) W$ c
end
/ p# `! \; F2 n1 E& } : ~* o8 g3 Y9 m9 F: J$ E. B
#=============================================================================== , _! @$ x4 [& J. ]- z! M* s
# Quick Item Window 5 A2 k" }( [+ B% |% X
#=============================================================================== # j+ G% E# D2 U* X; _
if XASVER_37 == false
' O; f) ^, x9 _" Y class Xas_Scene_Item
$ U9 D+ w0 }4 R5 G! [ alias hud_quick_menu_main main . f# ^+ v& l N/ l
def main
( k& @% \: f8 a: `/ o; X$ X @hot_key_hud = Hot_Key_HUD.new : q# X5 U6 h4 a9 h' k5 q& s
hud_quick_menu_main : ^% Y: [. b4 Z+ W
@hot_key_hud.dispose $ l/ |( `# D# U& p
end
& M% X, G# E* J" I8 C $ D' |0 [9 Z' m) b, f) X4 `+ e9 V0 N
alias hud_key_update update
9 u! Y ]5 J; D; [+ V- Q' R- q def update 8 P& a6 b5 R0 a/ \6 d) [
hud_key_update
: ^5 T% c) W0 w5 T # Hot Key num 1
9 e6 `: Z) ]( j0 u if Input.press?(Input::Numkey[1]) $ E" q3 s6 y2 {
$game_player.equip_item_to_hud(0, @item_window.item) 8 V) ]' a8 O' q$ J" _9 b8 q
# Hot Key num 2 & p; a$ U7 k" J6 G7 H
elsif Input.press?(Input::Numkey[2]) 2 K2 T W3 y& m1 L
$game_player.equip_item_to_hud(1, @item_window.item)
: H# e, ]8 F/ B8 K2 z5 ?% n # Hot Key num 3
6 c1 x$ R) |# @& D, O4 _2 m elsif Input.press?(Input::Numkey[3]) . u! J/ k! g4 Z/ l( M# J/ b M9 Q8 \
$game_player.equip_item_to_hud(2, @item_window.item)
6 ?& y$ X/ m. ^# f # Hot Key num 4 % K2 F* g4 T0 l
elsif Input.press?(Input::Numkey[4]) 0 j4 f/ O4 q, T4 s$ m% g2 V
$game_player.equip_item_to_hud(3, @item_window.item)
z! B6 }6 c8 z) m/ u- k # Hot Key num 5 ! x2 S+ M z9 Z$ y. o
elsif Input.press?(Input::Numkey[5])
- A2 t0 Z+ d2 V* Y $game_player.equip_item_to_hud(4, @item_window.item)
4 i, w' N* D/ k7 V5 ^/ y end / ?; Z' J3 f" u: J6 I) x3 D) s0 V
@hot_key_hud.update
3 k5 k; T& g; A end
8 x) }3 O% w: n1 ~1 p; {2 U. g end 5 `* f" b- I* S! ^/ Z+ m+ @
else
6 ^- g& n* B4 U class Quick_Menu_Item 0 {! z8 h: w/ R6 M7 r
alias hud_quick_menu_main main
: }8 ^9 f( E E def main 0 p# l1 x! ^: C2 K! t5 }
@hot_key_hud = Hot_Key_HUD.new
) f- |6 t. g7 ` q2 i hud_quick_menu_main 0 Q* w% K; ^% r3 K
@hot_key_hud.dispose 9 E6 P# G: z; c/ d D; d
end ) c; W0 p" H, Q8 i1 q0 S0 w2 R
; H( l2 b- Y3 K; @
alias hud_key_update update
# \# ^& Y- b" V# u def update
* F+ O# z$ n X hud_key_update
2 Y/ u$ c$ x2 C) U # Hot Key num 1 3 Q `4 k6 D4 @7 o4 T! B* q
if Input.press?(Input::Numkey[1])
, Y2 u7 [, n, C2 L( U $game_player.equip_item_to_hud(0, @item_window.item) ?, i7 k- E5 D4 s* X. ~
# Hot Key num 2 . x& o3 b% G/ Y: Q: M0 ^" @" V+ P
elsif Input.press?(Input::Numkey[2])
# J0 [! \; V7 }8 I/ n( E $game_player.equip_item_to_hud(1, @item_window.item)
. t- ?9 x. o/ b) S$ b" C) h # Hot Key num 3 9 K$ [0 Q( K- J9 G' _
elsif Input.press?(Input::Numkey[3])
4 q' A. O3 D. ]4 b: `2 }$ N$ e" S $game_player.equip_item_to_hud(2, @item_window.item)
" L/ x! R8 D% v. |9 T) O, B. S7 N # Hot Key num 4 * }$ V6 K- X6 H) n( M# \- A; o% G6 K
elsif Input.press?(Input::Numkey[4])
+ b4 ~: N% k& M, R- P$ m+ Y $game_player.equip_item_to_hud(3, @item_window.item) ! A2 h9 l) N: T3 n
# Hot Key num 5
+ ^8 U6 s# x" g' L+ ]5 o elsif Input.press?(Input::Numkey[5])
( i3 w m0 i/ J $game_player.equip_item_to_hud(4, @item_window.item)
( g4 s; N$ e0 X4 _! J, Q end 1 n7 M/ O' x) M- p) f- }: m3 D
@hot_key_hud.update
% w$ p" m- [% Q y0 t3 w end 0 ?0 j7 E. n9 y5 {
end
; {3 }7 t, w. ]( oend + w; V2 W8 m A7 s1 L
|. N9 r( a0 T/ P# M#===============================================================================
; J/ h+ y4 e8 T" |4 @, l# HUD Window
1 {8 Z, P& P3 E! U2 p$ @#===============================================================================
4 \2 P, s% w( p( f2 Q5 `class Hot_Key_HUD < Window_Base & s! j" S" D6 z v# D) c
def initialize(x = HUD_X - 10, y = HUD_Y - 15) ( N: \6 M" E4 h- {4 ~: h
super(x, y, 220, 80) . T) G* s# o" X# A) O) w" b0 _5 u% g
self.contents = Bitmap.new(width - 32, height - 32) ! D9 i+ q6 T2 Z: ]
self.opacity = 0
}/ O) H7 q+ d. F. Y% V+ b# [ @actor = $game_party.actors[0]
; j7 N! ]# @; L2 A7 B# Q: E g refresh 3 Q* \7 C7 }0 b
end
+ C: y) q0 [5 a: `
3 ]+ B7 Z) y. w3 e5 D, ~5 J0 g& y def refresh
8 h: B$ q% N6 @/ ` self.contents.clear
( x" B5 n+ `7 b$ m& w bitmap = RPG::Cache.picture("Hot_Keys_HUD") ! ~( U, V" p4 Z) z g% H
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
* V3 Y' j8 S6 r: A6 O/ K+ ^$ {$ n for i in 0..4
. i1 [& e7 i/ P6 b' _+ d x = 32 * i + 4
) ?" o: D+ @! K- o item = $game_player.hud_equip[i] : g2 W4 g) a9 W+ N3 m
next if item.nil?
) Z; m% E# u/ ^2 R5 _3 e: U) Q if item.is_a?(RPG::Weapon)
0 ~( b8 M2 h9 O7 s' b! u) c) c item = nil if $game_party.weapon_number(item.id) == 0 and
) `. Q" o& |- M5 O' W! R# s _ @actor.weapon_id != item.id
+ X q( P9 r8 U7 ^) A% A0 o* X2 ~ elsif item.is_a?(RPG::Armor)
3 T: D3 Z! V$ P& L {* | item = nil if $game_party.armor_number(item.id) == 0 and 8 ^2 Y% B, D) b9 M8 w
@actor.armor1_id != item.id 2 ?6 u. s& F* n% U. r
elsif item.is_a?(RPG::Item)
8 T. F! u9 E, {1 s, Y item = nil if $game_party.item_number(item.id) == 0 or - @/ I8 R' a0 _6 K8 L
!$game_party.item_can_use?(item.id) & E* p3 g9 I+ `5 h0 D, z: F
end
/ p0 U: Y, E M. E1 i bitmap = RPG::Cache.icon(item.icon_name) ; _. w: n: d. ]" B5 g
self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24))
* j6 V, {) n" B7 I+ }- D, z end
- v9 b+ b% _2 E) Q1 M% Q/ u! z$ d end % i- q& X1 q3 W/ y! g& {! ~2 l
6 Q5 F- }0 X( v9 y; z def equip(item) . ^! E+ T- _ O/ k( `" F! J8 `; b
if item.nil?
8 s) ^: F" O% G2 Q( } o1 s* g $game_system.se_play($data_system.buzzer_se)
) H V* w4 E+ y. o return ' n& ~# w, J/ a8 ^/ D1 g" p2 ~3 t
end ( A0 g/ r- t7 @+ _( t
if item.is_a?(RPG::Skill)
5 _2 V% Y! M6 C# y if !@actor.skill_can_use?(item.id) + F9 _$ d3 R R0 J( s8 S$ G
$game_system.se_play($data_system.buzzer_se)
1 D' K7 E" f5 f" d2 {! T$ } return
/ R4 M' |- Y) a5 N+ D4 [0 t end
+ P6 I9 V6 j! B% b$ A4 K# L" w #$game_system.xas_skill_id = item.id , G& n+ _! R* c" O1 _8 d
@item_type = false
& `. \& \8 ^" Z0 Q( B elsif item.is_a?(RPG::Weapon)
6 n3 I4 R0 d+ B8 r @actor.equip(0, item.id)
2 Q K" k3 g. d, T& e elsif item.is_a?(RPG::Armor)
( p6 B* `0 U% b @actor.equip(1, item.id)
w' Y% C; J8 J1 h2 h2 @* ? elsif item.is_a?(RPG::Item) # } M8 X2 a. l% E" H
item_tool_id = XAS::XASITEM_ID[item.id]
5 c$ @0 ^& h6 P0 C5 g if item_tool_id != nil
/ |# P( S a& w# v1 U! N5 }0 @% f unless $game_party.item_can_use?(item.id)
, Q' Y- _1 p+ [7 O! B6 [ $game_system.se_play($data_system.buzzer_se) 1 ^$ m' y8 c" O$ m' X* S! m1 N \
return 1 j# y0 t' v# R+ |9 @
end
6 G Z' G( e6 j/ Y #$game_system.xas_item_id = item.id ( v3 a' _( j. g2 ` K
@item_type = true ) s8 U+ R$ E6 e |3 I2 ]0 G# b7 ~7 u
end
8 u0 L, j. Z6 p4 {/ t8 h end
+ e# r2 D7 f* f. V& i #$game_system.se_play($data_system.equip_se) . {! |9 c. u# `
end 1 P0 q2 {1 c" C
, l; Z; s) u1 S* O; k, w y# N0 |
def use_hud_item(i) 5 `5 [; `0 ]% }3 t
if @item_type
4 Q% L! r |5 R3 ~& e $game_temp.force_action_id = $game_player.hud_item_id[i] & d; ]+ Q' L X9 F5 W$ s& ~" c1 {
else
) a7 T& @0 B( A5 k $game_temp.force_action_id = $game_player.hud_skill_id[i]
( l/ ^/ |& l& o7 Y# ^0 S end
' O) @& a: ^. b+ ~; `: R1 h( d8 d, K1 A end
8 h( R. o0 {& s$ }3 }5 P! @
! b. M9 R% }# \* C# Q def update ! N7 P2 U/ U, L! w a1 |
@actor = $game_party.actors[0]
9 R5 \, V6 W1 A7 m" \- g" G @hot_keys = $game_player.hud_equip
6 R* \1 `. i1 O A: _ refresh
, d$ o, ]4 u) _8 Q9 H1 u( n return if !$scene.is_a?(Scene_Map) 8 P) ?- O4 Z- @! Q
if Input.press?(Input::Numkey[1]) " Q5 m- M0 U J( f' {
equip($game_player.hud_equip[0]) 5 j. ~# r8 o& E; Y5 U
use_hud_item(0) 8 `" ] L% E3 @* u
elsif Input.press?(Input::Numkey[2]) / B% s* f# g4 l' L
equip($game_player.hud_equip[1])
. t+ u6 l$ ?4 ` E8 e4 T4 _ use_hud_item(1) C& Y2 E: o& q/ b' H8 I
elsif Input.press?(Input::Numkey[3]) ) ^8 U& l# c2 R7 P4 D
equip($game_player.hud_equip[2])
9 u8 A: F; E: T) }! _ use_hud_item(2) ! r: ?) r7 w1 I1 V" [) N
elsif Input.press?(Input::Numkey[4]) ; Y0 i% K9 q9 L5 z6 _# v' D4 O
equip($game_player.hud_equip[3]) ) E) K+ j7 N6 L6 x. y: Z c! T0 |1 x
use_hud_item(3)
# U6 N" c- v6 O! b# w8 F- ^' D elsif Input.press?(Input::Numkey[5]) ) ^1 u3 }. M4 a* Q
equip($game_player.hud_equip[4])
. k/ e, K1 I, W* p) I5 ~9 D& o use_hud_item(4)
3 C% z3 f; l' @( H4 g2 ^) b end 9 i/ N+ ~) i; M# \4 y5 b3 ^) h
end
( Q" Q4 Z5 J \) gend
- z' y6 S! t" J& E5 P6 _
* U( v9 U: Y- p#=============================================================================== 0 S7 ^& y, t% P
# Scene Map
; }& H- d: X [5 P7 ~$ h- R#===============================================================================
" a3 I+ T! C: R( D( E8 T1 g1 fclass Scene_Map $ [6 \4 g$ K- @. C
alias hot_key_hud_init main , M5 \$ y/ D: }4 _ E: p
def main
4 H) W+ q9 H+ g* V+ @4 K7 b$ | @hot_key_hud = Hot_Key_HUD.new 7 l/ t m& u! \; A a/ q p
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] 7 F2 }$ ? q$ x" e. }9 J
hot_key_hud_init ) D! P# ^8 N1 w) R, O
@hot_key_hud.dispose * X3 r4 u6 c# X7 h
end . b% ^! S6 k3 L8 D* J% N' k
1 N J" N# V, }) b
alias hot_key_hud_update update / b8 d# Y* {# D1 j0 D4 R. J
def update 7 b4 q9 q* _* u
hot_key_hud_update $ V- y' R% j1 t( {0 X6 U! c% G
@hot_key_hud.update ' J+ {& Z4 ]: m) V1 I# {
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
: t# G) e, s% e- a; p @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
/ R) x+ M5 }9 _$ T end
5 F) B& u+ i4 u, Z+ Aend
# o" H8 `; M: t. }7 ?1 |1 j
|
|