赞 | 0 |
VIP | 15 |
好人卡 | 21 |
积分 | 7 |
经验 | 24727 |
最后登录 | 2021-10-29 |
在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607
|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑
}4 J) e' S1 f$ u0 g1 f& A; _- A8 ?6 U$ p2 f
在Extra Skill里按1~5是设置" O+ h P' v( x
设置好后回到地图按1~5就是……切换。
5 ]! D4 U0 q0 ?, B* `+ S2 M; B
( H* D Q+ f& S2 v. `7 _9 q+ a( ^+ _请问是要改成直接使用吗?0 O' X7 i2 h0 y4 j( _) o
, L' [5 Z% Q5 k& \- Y0 E0 i/ r! j那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。
4 i6 n- a4 X" X7 Z; X9 ]#=============================================================================== # 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
#===============================================================================
# O$ n& V' E: y: j! ]& n# XAS - Hot Key HUD * ]% l, U- @. j9 A+ J- E) E
#=============================================================================== 9 t: I t3 w0 O% A8 w, v& U
# By Mr_Wiggles 2 ]& o0 O" R( l# \6 P; b
# Version 1.3 % u- M6 C/ q* Q7 D9 D
# 7/6/10
L$ \, T. x/ v t#-------------------------------------------------------------------------------
0 b6 f4 I. s4 I3 c% ]% T) ~0 d6 S# Instructions: , M2 M. X t( I
# Fill in the constants bellow, paste this script above main and bellow XAS in 5 C' m: f. b% W
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!! + [7 ` m: s! I8 }1 }3 m% G3 h
#
7 N6 g8 s! x/ ^$ Q# Place the "Hot_Keys_HUD" picture file into your game directory + O# w9 ~$ V( z- N3 Z; }: Q
# Graphics/Pictures folder. 4 J) `0 H3 j# J n+ X( r+ N" U
#-------------------------------------------------------------------------------
9 n; A0 [) Y4 s H1 O0 P/ R' B- j# Directions of Use: ! B2 _. m* J3 N
# Simple just press a number key (1 - 5) when the quick skill or item menu is
5 }7 R, x+ T9 ?, A& a& c# Showing. : G- N, S) e# j% r% w. o
#=============================================================================== + d2 C4 x2 Q. n
HUD_X = 0 # X pos of HUD ; P! ^ V- |1 h4 }& p, P5 i" h9 Y t
HUD_Y = 0 # Y pos of HUD
( B& n4 S9 B R5 y' a3 `0 wXAS_HUDDISABLE_HUD_SWITCH = 1
, P- t, W5 j" n4 V; z: y! b# | Z5 H$ t # [# O& j$ @0 A1 ?/ r
# Set true if XAS 3.7f
% M( z2 w, C, H6 L% g# set false if XAS 3.6
. ]/ U$ f$ v. q: G* e3 I- ~XASVER_37 = true
( l6 J( ?8 ]2 ?3 Q0 c
: F( i2 K3 f8 m! v4 R5 l/ @) x$ u* U+ F#=============================================================================== 3 {; G# \# B9 [! W1 |7 s
# Numkeys Module # L4 h. ?# C: [- g
#=============================================================================== . v5 \$ a( f/ S$ p$ K% J; Q
module Input
" K/ R$ a% s' ~' ?( i Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
1 z* Y* u2 g& b9 V# T0 ^. [: ~3 P- F class << self
9 L7 Y9 X1 r8 k6 \+ _" @3 s Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i') # J* k9 J3 a6 v
9 @& I# A' M2 w
def testkey(key) : u4 w0 ~) @) [6 A- q
Key.call(key) & 0x01 == 1
! |/ V) v6 l( B* d: T( ~ end - \; R% |; D. }
) l5 {% s* o. C) H& ?" m$ m! U
alias hud_key_update update
4 M* f O3 I, \ H9 E' Y" L def update ' K A+ s; f5 y4 H
hud_key_update , d3 s/ x1 q8 h% F# L& p
@pressed = [] $ z; [% Z8 j4 |, h- G- I
for key in Numkey.values
- U# K0 `% j, T' v6 G key -= 1000 2 i3 _+ J3 C- l5 i# L4 n
@pressed.push(key) if testkey(key)
( Z8 G% \8 L5 G$ a `; r+ { end
# z6 I9 W, [8 z/ n' a! c/ V end
: ]& Y& c. @* b O" T$ I1 V0 a0 u
2 b! w: @, e& N def pressed?(key) 6 h# O! r7 E& I
key -= 1000
2 F: j0 v" C5 F$ P @pressed = [] if @pressed.nil?
J; p1 t! O0 e+ y3 Q return true if @pressed.include?(key)
0 B/ p' U5 i# [; C return false 5 p0 S# y+ X" J$ B2 P
end 2 u6 ]; K" J% {* J- d- S8 h8 n
! M7 E3 \) d; S( y alias hud_key_press? press? 9 P# i4 i0 v4 C) X4 G" F; ?
def press?(key) + d6 k% u, ]" n& Y8 Q
return pressed?(key) if key.to_f > 1000
# f8 S) o/ n: I- f- J hud_key_press?(key) 3 A- i# {0 O/ R) ^. @1 e
end
/ D9 T- V( G2 }3 I end . Q: D! q! [& R/ A
end N7 X8 d6 i/ F i; I
6 |5 K) l+ w. w& L
#=============================================================================== 3 A% w! [9 H( X' j2 }
# Game Player 1 ]) N' p5 H* w" a# o$ E
#=============================================================================== 9 t# _) x; J' W5 l* r
class Game_Player < Game_Character
9 l0 A- p4 [ c8 @) l attr_accessor :hud_equip 9 S0 U4 T2 P) t" {& L
attr_accessor :hud_item_id + a3 v9 E M2 R- _) h* c( [/ i' x
attr_accessor :hud_skill_id
. K) I' p0 i( {$ t : J' m* Z: B( d H
alias hot_key_hud_init initialize 4 _8 A2 u- k0 Y6 j- m! b
def initialize X3 E; F; `6 T
hot_key_hud_init 7 E+ l) S4 i, ~6 R1 ^: Z4 [
@hud_equip = [] 2 U' \4 z+ ?# C9 h3 B% ?$ y: N
@hud_item_id = []
7 U8 Z& r- O3 j H1 f1 w @hud_skill_id = []
1 G4 O! K1 e( I; c end
! Y% c) a, c: T; d+ `; C
( o/ Z4 j) S$ }3 t) ?" @ def equip_item_to_hud(n, item) ( q1 {; [( K- x, _3 a; Z& N& E
if item.nil?
' R5 H( M8 z- l. l3 ^ $game_system.se_play($data_system.buzzer_se)
; u3 H3 k% F! Z return / m$ x, _7 y) n/ b$ K1 @* K' y# ^
end - }- D: i4 H _6 P+ U) e2 g/ l5 b
$game_system.se_play($data_system.decision_se)
8 Z/ \9 h. ?1 k# i/ x# z7 `: ?9 q( h @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item) 9 G' o# Y+ L6 z! G u8 l0 A& ^
@hud_equip[n] = item 9 O6 R) t! z8 q3 r' B6 R
@hud_item_id[n] = XAS::XASITEM_ID[item.id] ' w$ j; j# K( u( m2 o! b
@hud_skill_id[n] = item.id ! B( o# i8 W. D6 D
end
4 e+ F* b( \5 Q7 F/ T2 Y" [end : c4 D3 |3 h+ x2 X0 [4 A
6 I1 R2 e0 L# a" q/ ~% c" S#===============================================================================
( G) X! p, R, D+ j# Quick Skill Window 0 H4 I4 w, p- L9 d/ w8 O2 @% u
#===============================================================================
8 V, [$ e( D; `5 cif XASVER_37 == false
# |+ F; k) b- o3 ~5 R, ^6 `6 u. S+ c! e class Xas_Scene_Skill
$ s9 t! [3 K; {# n2 f alias hud_quick_menu_main main
" t2 D/ a* r! g! k/ L. K2 e$ N' P; P def main 6 U3 D; u! [5 L0 J! N' ]! t
@hot_key_hud = Hot_Key_HUD.new 0 s' Y1 b; V* D0 q& s
hud_quick_menu_main
; n' a9 G: \2 V4 r @hot_key_hud.dispose & B1 l! B1 I7 I# S
end
?7 {! z" ?; r; U0 G' ~/ w 5 m" ^6 |; d$ b- \) m
alias hotkey_hud_qucik_menu_update update
) H8 z# S, E# G+ O% w8 v6 E2 ? def update
4 R7 l2 [' `3 b+ L, @# ^ hotkey_hud_qucik_menu_update
3 z! t. N4 L8 M) u # Hot Key num 1
% v3 [1 Y; t9 D1 r' Z( v2 B1 J6 M* J, c if Input.press?(Input::Numkey[1]) 9 C) h3 r) o& B4 \+ |% ~5 ~
$game_player.equip_item_to_hud(0, @skill_window.skill)
: o3 L E# \* _% z# H+ h # Hot Key num 2
6 ?. U* a( S# p; D1 k4 g elsif Input.press?(Input::Numkey[2]) $ c2 S" t) e; q' l4 |! X
$game_player.equip_item_to_hud(1, @skill_window.skill)
5 ]6 s9 X0 {. h! L m8 p5 s # Hot Key num 3 0 g3 L6 w1 Z; M+ M: a+ e& R
elsif Input.press?(Input::Numkey[3])
4 K; b* _7 g4 l! \* f $game_player.equip_item_to_hud(2, @skill_window.skill) 2 g4 S, O5 l8 T5 g& z
# Hot Key num 4
8 j" L, r- Y. T3 G/ m" D+ R o elsif Input.press?(Input::Numkey[4]) 9 U4 s; W4 d: H) o- h f
$game_player.equip_item_to_hud(3, @skill_window.skill)
2 ^& B& n6 h6 P% g% t0 D( ~" W/ n6 P- ` # Hot Key num 5
( K4 s# O8 L8 a6 K. S# s1 z" a8 _, G' k' f elsif Input.press?(Input::Numkey[5]) : m: w0 E9 G* y/ u) E# q
$game_player.equip_item_to_hud(4, @skill_window.skill)
) D3 r, Z4 X. X) C7 B4 G% f" ? end
# V# p$ T8 a6 @0 D% u$ O @hot_key_hud.update
) v7 q7 @: J# ^$ ~- o; e6 K end 2 D* N) E/ h8 j( v7 i. }" c
end 4 v9 m4 ], w& J: u) m9 w% {
else f8 _$ F- `9 E5 S6 v
class Quick_Menu_Skill
4 i+ z7 V+ Q; l o8 T0 @ alias hud_quick_menu_main main
7 w: d+ I5 x0 y/ [& ^6 | def main
3 O# o5 r1 `- H/ _. F" t @hot_key_hud = Hot_Key_HUD.new # x9 z. f. Y3 m# Z2 S! T
hud_quick_menu_main / D. B; v% r% C" Z
@hot_key_hud.dispose
1 k& t( i" a' L- x2 B5 m. g0 G end
. L, H% @& T6 B2 t% ?7 q$ A: g
7 A7 c$ ?4 I8 F' n2 [ alias hotkey_hud_qucik_menu_update update
- c& _# X/ T/ t/ }/ |0 _+ K def update , n i8 Y% `6 A9 b1 l, ^
hotkey_hud_qucik_menu_update
+ ?0 c" K' T/ l) G9 T0 m8 l # Hot Key num 1 2 z% a- y1 j- T
if Input.press?(Input::Numkey[1])
, e0 l8 F. P3 B- w# A- m( i $game_player.equip_item_to_hud(0, @skill_window.skill) - F, D9 A# b6 c5 V0 ~! q
# Hot Key num 2 4 X: a% U2 w/ T0 V' D4 n. z
elsif Input.press?(Input::Numkey[2]) ! n) o3 z# r0 n7 J/ C
$game_player.equip_item_to_hud(1, @skill_window.skill)
* B! Q) i% {8 c6 v% R # Hot Key num 3
" E8 D. T% X: H" _- V! B elsif Input.press?(Input::Numkey[3])
5 D$ F2 {( c) h; O $game_player.equip_item_to_hud(2, @skill_window.skill) 2 e' ]: X! R: k; Q5 ]; I
# Hot Key num 4 - I7 Y5 b& j# ^5 @: x! ?$ D
elsif Input.press?(Input::Numkey[4]) " j. ]- G8 _9 J& ^
$game_player.equip_item_to_hud(3, @skill_window.skill)
2 C. v: B# E2 W # Hot Key num 5
, Y9 D( S) k2 y7 |8 R! H: [6 J5 Z9 P elsif Input.press?(Input::Numkey[5])
5 M) t' j6 z, P' U* W: w" n+ ] $game_player.equip_item_to_hud(4, @skill_window.skill)
% F# \! D! ]8 l end
: m6 Q7 i; \; d ^* i0 M @hot_key_hud.update % m' K, |8 \1 F
end 7 r Z& U, v; @3 Z
end
# v3 W w6 ~( L7 bend & Z! o p4 _" C
3 H# O; { Q* F% g, s9 ~% d
#===============================================================================
. {9 Y- L% U; z9 c' I# Quick Item Window " L3 }/ A: R, C; l- T
#===============================================================================
* u; a1 D- @5 g2 zif XASVER_37 == false
$ L1 ?7 u0 ]4 `& [, f class Xas_Scene_Item / b, Y5 V- [& O
alias hud_quick_menu_main main - h- [9 [& U [0 q
def main * V2 {5 F5 z2 I L, E1 }) k
@hot_key_hud = Hot_Key_HUD.new " w3 f; ]; g3 e9 C& y% O1 `
hud_quick_menu_main P5 E% S& w5 x, s; K6 h
@hot_key_hud.dispose : ^1 r; W$ T( y% o- I- ?% l
end 6 ~& K, H& u7 D& l; h8 H& U8 i
0 w2 U8 `. x" A* ~5 v! H alias hud_key_update update . H1 w" `& i$ E. b
def update : }* o4 K, r" ~, r9 L$ F
hud_key_update , ? J8 l' f+ A( V `% D' ?
# Hot Key num 1 ; P) {9 L H G7 [ T) k: S6 D
if Input.press?(Input::Numkey[1])
p5 O1 s" d& i$ ?4 b. G $game_player.equip_item_to_hud(0, @item_window.item)
5 D, I8 }' `; R # Hot Key num 2
2 q, i3 O8 a7 f6 Q* e elsif Input.press?(Input::Numkey[2]) 7 N* n; f: G0 j6 }7 X
$game_player.equip_item_to_hud(1, @item_window.item)
) O# F+ J5 T$ I$ f8 \ # Hot Key num 3
) q' [8 q8 A& }7 s! D2 A4 l elsif Input.press?(Input::Numkey[3]) 8 @0 a; u2 |% Y) ~ x P
$game_player.equip_item_to_hud(2, @item_window.item) + [( K' |" L, b) Y Y
# Hot Key num 4
$ e" u/ j2 i7 Z @- ~' X elsif Input.press?(Input::Numkey[4])
6 }" F/ L& T6 f$ U& s* F) A $game_player.equip_item_to_hud(3, @item_window.item)
* X% r$ X0 C5 @, R6 b$ P # Hot Key num 5
1 d" f- t4 I; a$ ]1 C elsif Input.press?(Input::Numkey[5]) 5 L8 ~7 L- U! |7 z1 m, T* _ h! C$ f
$game_player.equip_item_to_hud(4, @item_window.item)
4 m, P" o8 [& i2 E end
@6 s/ S( m% U, Y) y0 n$ E/ P @hot_key_hud.update
) C8 p+ M! L4 ^7 V# ]" \0 m$ H7 h# t end
1 S# ?& n$ z! u D( c end
' P7 T0 @" k9 gelse
^; c! Y$ X) n9 ] class Quick_Menu_Item
$ F& h; W0 r9 f6 B+ ] alias hud_quick_menu_main main
* m7 g7 Y3 u- B0 B- u9 p def main
% f+ Q s( {9 I, h @hot_key_hud = Hot_Key_HUD.new 6 o* D/ |( {7 A3 p* r
hud_quick_menu_main : L. Y9 @5 z! y9 l/ o8 e
@hot_key_hud.dispose 2 G* \4 H6 }' s* A2 I/ |# }1 T
end * c. W! m% ~. V9 [/ p8 U7 ~
- g9 o; c r9 m) s% d
alias hud_key_update update
1 ~+ _; Z, h+ ?6 D$ n6 L def update ' o: t9 F7 a; I% O0 c
hud_key_update
2 W% i$ G7 S. \ # Hot Key num 1
; P3 D7 w7 Y; D* d+ p if Input.press?(Input::Numkey[1]) 2 v4 S# T; f- o a# I$ Q+ L
$game_player.equip_item_to_hud(0, @item_window.item)
7 L7 y1 E( A5 B # Hot Key num 2 ! S& |& _ N9 y. ?; M
elsif Input.press?(Input::Numkey[2]) $ k9 k# i/ w$ t1 o) n5 H' R
$game_player.equip_item_to_hud(1, @item_window.item)
" i: {% j! ~9 c$ I7 T# } # Hot Key num 3 / D- {3 {3 k' ~3 O+ \* d) _
elsif Input.press?(Input::Numkey[3])
. z- P: C$ u+ t: k1 U $game_player.equip_item_to_hud(2, @item_window.item) , r. T( e, p6 B0 U
# Hot Key num 4
9 a% \3 F$ Z3 L p elsif Input.press?(Input::Numkey[4]) 4 p+ R0 Z6 x0 y" Z
$game_player.equip_item_to_hud(3, @item_window.item) 6 z/ N. j- @9 ^) a* a, L4 }/ Y
# Hot Key num 5 * ?- S" B5 H4 k) D) T2 Q! k
elsif Input.press?(Input::Numkey[5]) 1 a$ t% G4 `6 a- [8 J
$game_player.equip_item_to_hud(4, @item_window.item) . Y# @( \, A# B; ?' H" \. C( b
end
6 }( t x4 Y5 V8 P @hot_key_hud.update " _' V+ l/ l' V0 b6 B& `1 k* b) }7 p
end 5 o; i5 E9 d% f. `' }
end 6 a+ ^8 V3 Z1 y) C+ @+ U" A, i5 x/ ^
end
1 {! b8 ?1 j* h3 L( d; S% \6 ~
3 u# W7 |) Q4 x3 Q$ c- ] {#===============================================================================
7 U/ F1 m f( r- n% A# F# HUD Window
! E1 q7 l$ C' O! h) J#=============================================================================== & a/ B, D/ @2 O" q' N& r7 K
class Hot_Key_HUD < Window_Base e a: J5 x6 P3 U
def initialize(x = HUD_X - 10, y = HUD_Y - 15)
" v3 d: o; b# e. q# Y9 t% s super(x, y, 220, 80) . `$ `% _% h$ l6 p% m, n( w- G
self.contents = Bitmap.new(width - 32, height - 32)
! p R8 R/ f5 _& x1 M self.opacity = 0
- ], A* ^# \4 T+ L0 m2 g* } @actor = $game_party.actors[0] 5 {% d* Z) X: x
refresh # ^3 q1 i4 g6 p% }# [: {3 h
end
) r+ I3 ~8 E7 Q; h
1 |5 l! }# S. f; K0 P- X0 d* O def refresh $ F* r. v7 c& i1 E
self.contents.clear 9 W7 c( {- G) I7 o/ b
bitmap = RPG::Cache.picture("Hot_Keys_HUD")
. x' o8 ?6 G7 ? self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
. n3 K6 |! G1 E: @5 R; n. f+ v/ X) l for i in 0..4
: g! q+ I$ ~ A M0 |& I6 n" G x = 32 * i + 4 . b' a0 V v: v1 T0 M
item = $game_player.hud_equip[i] " n3 R# F( u8 [. J1 ?: ]
next if item.nil?
! I! j3 J N3 D$ j0 K3 f4 E R if item.is_a?(RPG::Weapon) 1 g. L5 J2 e6 [5 ^- F4 ~! L
item = nil if $game_party.weapon_number(item.id) == 0 and
9 y* k) V7 J5 I3 ?0 P" K @actor.weapon_id != item.id : Q! X# k5 X6 R
elsif item.is_a?(RPG::Armor)
2 E7 w, M" h/ N! u! g item = nil if $game_party.armor_number(item.id) == 0 and " _1 \, _! M2 s, z2 s" V
@actor.armor1_id != item.id ; g' P5 J7 t! R
elsif item.is_a?(RPG::Item) * G) |1 ]& }0 P$ ~+ q; ?
item = nil if $game_party.item_number(item.id) == 0 or * E& U! D7 T/ l: w
!$game_party.item_can_use?(item.id)
! s( B3 B4 ~: q' W) o end
0 P2 f- F. }% g3 b+ u; a. w bitmap = RPG::Cache.icon(item.icon_name)
7 y- e+ E$ _2 J2 S0 x0 l ^* w1 @ self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) , G) d* L5 U6 o# ?* k0 S
end
7 G$ v* A3 L. j8 J0 `3 x" H end 9 Y+ l2 l1 P) B4 K' q
' y! B# U/ B; \# X. z% z1 a def equip(item) . I- w) p! ^' T7 R4 C
if item.nil? + \. {: ^1 n$ K5 w( x
$game_system.se_play($data_system.buzzer_se)
6 l, P) D4 g6 s A! f0 r3 ] return
6 e4 _) j0 |$ P+ B# z end
! w9 R+ w4 {; q if item.is_a?(RPG::Skill)
5 d; ^) @: j; W9 }* V$ D! f) ` if !@actor.skill_can_use?(item.id) 4 \2 S- ~( o5 g+ s( z* q5 g! `
$game_system.se_play($data_system.buzzer_se)
- H6 I9 l3 t+ P; Z L return
7 g4 v) {0 ^5 a" z3 @7 U4 F& J end
9 j/ w* y9 Y3 {6 g0 w# X% y8 A X #$game_system.xas_skill_id = item.id 8 d% X% v) D! P/ Z
@item_type = false
! Q$ q5 ~0 [0 w }4 `! s elsif item.is_a?(RPG::Weapon) + Q* M% j& I: A: d9 Z5 A
@actor.equip(0, item.id) ; s) ^* G# z& U1 p8 D
elsif item.is_a?(RPG::Armor)
1 }: C8 J1 B2 p; M9 q8 f" n @actor.equip(1, item.id) " u% U0 P. x0 X' y
elsif item.is_a?(RPG::Item)
% |9 X7 e, ^( T5 ~1 v item_tool_id = XAS::XASITEM_ID[item.id]
I1 q0 t {6 c+ L, r if item_tool_id != nil " w9 v; |6 ^; r
unless $game_party.item_can_use?(item.id) 0 a0 T/ P/ r5 b) u, w
$game_system.se_play($data_system.buzzer_se) 1 h# c ~: t: ~* H9 O
return # {" Z, q# n9 o+ `+ _; J
end
! A5 C9 q Z/ o9 g! n9 ]# N #$game_system.xas_item_id = item.id 1 l+ q# c$ j7 R3 N- @1 K8 C( q/ J
@item_type = true 0 W) n1 t0 \+ ^" S
end
+ @; h& p% V5 F: A- m end
* ]# U2 K5 M1 H& I5 i #$game_system.se_play($data_system.equip_se)
* o# ^1 o) a* e end
6 E) X1 \7 D# d8 N! g 3 o* m c" H" @; D# G
def use_hud_item(i)
7 q* A2 r+ o4 q% }( V3 t9 F if @item_type
s5 \; H* x5 e+ X, W0 l $game_temp.force_action_id = $game_player.hud_item_id[i]
W+ L8 E, z5 W3 t else ( T& a q: R; k" n; G
$game_temp.force_action_id = $game_player.hud_skill_id[i]
1 d& }5 o m* d% R* A, O end
0 N% }, N& Y! a4 B: Q" P end
9 @ i: G s& M( Q& y / L5 N$ v- e. p3 }' I! x- k
def update
& _' C1 x" }. Q1 H2 a4 n+ h3 f9 u @actor = $game_party.actors[0]
) x% F0 ?) {& f, `! ]$ H" r7 H' ?. s @hot_keys = $game_player.hud_equip
& [1 O2 d" \/ z* J' e. w+ U refresh
& t: z! C- t1 n return if !$scene.is_a?(Scene_Map)
3 S4 d+ O: a# o; Z3 _ if Input.press?(Input::Numkey[1]) & r" X7 j T+ S+ R4 E% \
equip($game_player.hud_equip[0]) : f! r. ?& {" N" q2 R
use_hud_item(0) . Z9 j6 [. L1 y `" T7 t
elsif Input.press?(Input::Numkey[2]) 6 s' J) i# R+ I" k+ K' [- h* y
equip($game_player.hud_equip[1]) 7 W( ? \; D" K
use_hud_item(1) 3 K! L1 c: }3 L8 R- |8 U4 H* l, }
elsif Input.press?(Input::Numkey[3]) ( q4 s0 s! F6 }5 H- I% k; |
equip($game_player.hud_equip[2])
; `) H5 a8 v+ n7 G use_hud_item(2) 2 v& Y2 J- ^. C0 Z# h
elsif Input.press?(Input::Numkey[4]) ' y( u! e# B9 r( V+ z% |
equip($game_player.hud_equip[3])
: w' [) X( u$ \3 H9 O use_hud_item(3)
- [, e: X: T5 Y, ?! S3 Y0 z elsif Input.press?(Input::Numkey[5]) 1 l1 i; ~! N- G/ k. `
equip($game_player.hud_equip[4])
- q" f3 [: r8 R* \) d2 Z# }. Z use_hud_item(4)
5 b8 @6 C Q# _$ U1 Z end 4 U; X1 C4 J1 |/ r
end
# V# Q+ h) I8 J' }% nend # Q& f+ u, u. H1 I; v4 o
' V2 ~; }1 }2 }9 f0 H8 X#=============================================================================== 3 M2 j0 ]+ o; d; m& X' k
# Scene Map
4 n5 I2 l7 N( {7 c5 `: J#=============================================================================== ' Y- y1 v G4 x# i& L; `: G8 n
class Scene_Map
! {# @8 D+ a* ~4 d' Q4 I alias hot_key_hud_init main 1 u0 A2 b! |2 j1 o t
def main + w5 K- v/ V. u2 K- c- b8 m$ n
@hot_key_hud = Hot_Key_HUD.new
G# A3 ?7 C4 t3 w7 r: j* i @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] 3 U2 W9 L+ b( ~6 {9 O
hot_key_hud_init " Q5 [- A [: d0 t8 X
@hot_key_hud.dispose
2 q2 v/ @" Y, P end $ W" D4 W% j, A$ ?
S3 g9 U E$ {1 p alias hot_key_hud_update update
! E4 b1 r4 X, F) H! l9 `/ h q, @4 @8 H def update
, t& g! f* c1 Q hot_key_hud_update
# E0 a/ U0 i6 U3 L1 }0 b/ D @hot_key_hud.update 7 J9 w( C& C2 o. S1 S
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] ' r- ^# C$ h: Q1 y! d4 h( d7 m/ i
@hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
# E0 l* i$ b4 [& X, ? end 7 t# F( u! }' @4 K, r3 P) F
end 9 Z8 T+ J1 g, c' N7 J
|
|