赞 | 0 |
VIP | 15 |
好人卡 | 21 |
积分 | 7 |
经验 | 24727 |
最后登录 | 2021-10-29 |
在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607
|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 & }. {+ t8 C, _# H" K4 N3 z2 L
& x5 `/ _! n" p- Q6 q6 A7 s" m
在Extra Skill里按1~5是设置; B0 p [$ _! b0 X8 m2 R! T* c F
设置好后回到地图按1~5就是……切换。
/ G+ k: T7 V: X$ H [( K3 I s z' E4 t7 u) E* a
请问是要改成直接使用吗?
d5 L# w+ Z8 t D
# L. n! U5 G$ Q6 H% |那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。
7 P7 S/ }& c( }& M r6 Q8 `#=============================================================================== # 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
#=============================================================================== 0 L; A* |. J0 Z ?& V! C6 Y
# XAS - Hot Key HUD
9 B l3 m( y& |. [# y#===============================================================================
5 j! C& M+ c9 y/ l$ I4 E8 l/ I# By Mr_Wiggles - z" j' r' ]; ~* v! l# I5 a B
# Version 1.3 3 V: [' H# m( A
# 7/6/10
6 ~ L! C7 G' L" p+ ^* p' G#------------------------------------------------------------------------------- ) n3 [" |; L( q' ^. K
# Instructions:
3 I0 V, A( a0 T0 h3 E# Fill in the constants bellow, paste this script above main and bellow XAS in
+ X4 a6 F; m, K7 C# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
' d, ^6 ?* D2 x! H" A5 a7 C# * A. C& |0 Q1 d7 n
# Place the "Hot_Keys_HUD" picture file into your game directory
# v1 M' _6 u0 ^# Graphics/Pictures folder. 7 U. ^6 d5 W6 I7 @% @1 L
#------------------------------------------------------------------------------- * q" v" Q8 l9 b. g- Q- W! m" Q$ U
# Directions of Use:
* n8 q. U6 r' t- D5 \/ }2 J# Simple just press a number key (1 - 5) when the quick skill or item menu is 0 P2 h- Q& A! O3 n
# Showing. : J: ~* M* [- |6 k: H
#=============================================================================== * M5 N- T7 {; H% Z
HUD_X = 0 # X pos of HUD
9 Z6 B5 V7 ?3 _HUD_Y = 0 # Y pos of HUD + h( B: o$ I0 H. }! W3 h
XAS_HUDDISABLE_HUD_SWITCH = 1
5 U) a6 L/ p9 q6 L7 s
* p' [' ~! h3 n2 V# x* B# Set true if XAS 3.7f
( r* e6 v7 Q6 I4 {# set false if XAS 3.6 % F" x& t" U' j) n4 C! D$ C) T
XASVER_37 = true # l& S8 k i0 Z) D
8 F1 d( z7 z/ f ^5 f: K, n. l
#===============================================================================
6 a3 b5 W) q L, W# Numkeys Module
" n F4 Q2 b- {% G! V# T4 I0 Q( P#=============================================================================== , g4 P. Z5 b1 Q, p0 c# K' \0 z! {5 ]
module Input 9 |/ j+ x; q& p$ i
Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
+ o( G" U; S. h9 k: M class << self
8 i3 Z* U! ~9 ^5 d- e Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i') , B+ t6 U4 R z) l }
% D' V3 r2 j4 d; d
def testkey(key) + Z! y+ ~: Y1 p3 M
Key.call(key) & 0x01 == 1 ; k P4 b! b: G7 G# L' A1 @8 F
end / z7 g, o; f) {& _
1 q; d1 h9 K2 i0 I alias hud_key_update update ! l: {7 ~4 B4 U2 K# [ K7 B
def update
_& ]6 o N: ` h3 q# ` hud_key_update
5 ~/ ?9 p, z0 V& E. e) P @pressed = []
6 z B3 D3 a! ^' Q0 U1 H0 f for key in Numkey.values
+ c4 Q6 G ^# y) t. Y4 D key -= 1000
7 a% ]* l% l& |& K- l; [1 l @pressed.push(key) if testkey(key) 0 j9 ^) e# H( ]+ k3 L
end
$ n$ S _1 A, M" l end
N9 H2 y: h& d% T' o+ `- D
W! C* ^4 @8 U; {8 j def pressed?(key) & _8 T% w, ]8 b" Q- i. }
key -= 1000
$ i; {: N! m/ B: H @pressed = [] if @pressed.nil?
6 Q3 g. a% S; q7 H return true if @pressed.include?(key) . `* N5 @ C& P2 f! q
return false
6 o6 ]& y' e' n, R end 9 G7 A9 V6 T2 C% f
8 o9 I1 x9 d$ c/ P$ t# u7 E! Z* }8 I
alias hud_key_press? press? 9 l) o7 S2 A. Y0 d# V. q2 X. Z3 A
def press?(key) # s0 J* J, x4 t
return pressed?(key) if key.to_f > 1000 # n4 X" P$ I4 \5 Y5 P
hud_key_press?(key) 5 Z H4 ?+ P. p, J: l" G' D
end
6 V7 t8 c2 Q6 j. L. z$ X! n+ y end 8 Y6 F8 u9 j, u0 |4 L
end
; z/ o L( R# J3 T3 W g
& F1 `* C) a4 m: J; j( Q" t, I5 w; h#===============================================================================
% B$ L2 H" P5 H/ [" u& i# Game Player 2 q5 z/ @$ s0 q* B/ G7 m
#===============================================================================
0 r( H! O: i0 o# `) Tclass Game_Player < Game_Character
; c- {- a) x! c6 h+ A# p3 @% @ attr_accessor :hud_equip
C1 C3 t) A1 ] attr_accessor :hud_item_id # Q- R. f5 m. {+ y
attr_accessor :hud_skill_id
- E0 I* g5 Q0 I7 X& e
+ s1 O$ c2 X0 m# H alias hot_key_hud_init initialize 4 F5 K% ?& Y$ ~$ F" K) ~8 t, o$ X
def initialize . b) `9 w$ x/ b- Q$ ]! Z' z
hot_key_hud_init / z) [6 E! d7 c) O# ]- ] F' q
@hud_equip = []
& a+ A' P3 m8 \, c* h% A @hud_item_id = []
( b* }/ P6 d2 y8 l4 r' ]' F: W @hud_skill_id = []
, s% `. F# C; i/ g" U% V end ; t8 l! |2 D0 p/ k \
$ m3 L; m' ?; J1 K8 ?4 \+ z, k+ p def equip_item_to_hud(n, item)
& `% {& I: Q E7 c if item.nil? + b* E- s4 J$ H; O+ d
$game_system.se_play($data_system.buzzer_se)
" M& q) b, C0 v5 W( [- B9 m' F" Q return
1 q& ]; c& f7 m0 Z! O1 L8 \ end
{( }3 o7 v) Y1 w1 H $game_system.se_play($data_system.decision_se)
. L! I+ |) S( c$ C @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
. O& E2 w0 A- h: P6 } @hud_equip[n] = item
( x3 W' n3 Z5 |4 J t/ S @hud_item_id[n] = XAS::XASITEM_ID[item.id]
) `; r4 a/ Y6 a2 ?. t5 b @hud_skill_id[n] = item.id N; f- Y" r' `9 ^3 u1 v; g
end / q4 y4 r: K6 M
end : l# b$ q3 Q! S% s; w z
: A' ]3 |& U. Q5 h5 } p5 Q+ E#===============================================================================
h2 |& T# x; ~: R. D3 ~& s: s# Quick Skill Window 7 U8 c/ U B- R# d; `
#===============================================================================
8 r, F& u5 M3 dif XASVER_37 == false
1 ~+ j3 }* ^$ U7 u+ x# j2 C class Xas_Scene_Skill
& Y) I: U1 V8 B! T9 O' w5 J alias hud_quick_menu_main main 7 [" Q1 d: y) q) N
def main ) ~9 O) C9 d: t# j
@hot_key_hud = Hot_Key_HUD.new
9 q7 D$ g I' K& ^- | hud_quick_menu_main / W" B( K. _" s# T# m+ {
@hot_key_hud.dispose * X5 h7 y3 f7 ?1 R
end
4 w. T2 N. W& |: y7 r ; o3 m% `2 i! h3 g2 q4 d. I {
alias hotkey_hud_qucik_menu_update update
6 T- g& t3 O2 s5 e J9 N8 U9 J/ A def update
, N3 X+ B+ x4 E- {# k7 W( i hotkey_hud_qucik_menu_update
8 ~& |7 Q1 S0 Q, g' `' L% Y; i( P # Hot Key num 1 ) C! @) Y& }8 H# T
if Input.press?(Input::Numkey[1]) 6 w; {) }2 s4 _# ^7 P. Q h* v7 K" d! y( Q8 E
$game_player.equip_item_to_hud(0, @skill_window.skill) 8 I0 ?% F, ]: G5 k; n* K
# Hot Key num 2 4 [, ]( n ~* H1 h
elsif Input.press?(Input::Numkey[2])
- Y# q. v5 S# u' d0 A( ?4 Z $game_player.equip_item_to_hud(1, @skill_window.skill)
; M3 R7 f) G& C$ P* P # Hot Key num 3
* ~: M3 g) T7 X8 Q( q) x# n: U elsif Input.press?(Input::Numkey[3]) 5 Y4 s, l( m U' R8 ]! c! s- j2 A% o
$game_player.equip_item_to_hud(2, @skill_window.skill)
. v7 G* `/ @& `! d& Z # Hot Key num 4
- k. ^# h- j' s* V elsif Input.press?(Input::Numkey[4]) 3 x# d3 _# i/ P t. }& m
$game_player.equip_item_to_hud(3, @skill_window.skill) 8 a; E; y4 c5 \2 q! o/ I
# Hot Key num 5
# t! z( `3 l2 T U2 u( x" g9 n elsif Input.press?(Input::Numkey[5]) & v9 n3 ^% ?: ?0 ~: l* e5 L# ~
$game_player.equip_item_to_hud(4, @skill_window.skill)
$ U7 X6 i+ D) f. V' k1 N; ?, m end
9 D6 J7 \. J; Z4 u) f @hot_key_hud.update : p6 N: F: R1 e* h! k
end ) v' D, I1 P0 \$ p
end 2 E8 G' I) ~7 Z' I8 c
else
3 }( Z+ T& l& c6 j' t1 Q, _ class Quick_Menu_Skill ; O$ e4 R( T8 {9 p7 O1 ]1 _
alias hud_quick_menu_main main ' o* ]- h4 c4 B/ k- b3 u
def main : ]# S" b* N S+ T1 q/ W7 T5 D
@hot_key_hud = Hot_Key_HUD.new
1 X0 i: U5 L6 r5 r& c( N) M: Y hud_quick_menu_main
$ r x; D1 J) f# x @hot_key_hud.dispose 6 u0 ^4 o1 n3 e; U$ v$ j# B
end ! H! S! \4 u: ^5 C, q9 x
0 a; n2 H5 `7 ?2 {9 A9 R alias hotkey_hud_qucik_menu_update update
( z% H2 ^7 n4 t) ?1 b def update ) w }6 p6 O$ Q
hotkey_hud_qucik_menu_update
0 k# v* P& S- ~8 J$ m # Hot Key num 1 - Q) w4 M5 q3 g: J
if Input.press?(Input::Numkey[1]) / a2 _$ ^$ q- j8 y: x7 j
$game_player.equip_item_to_hud(0, @skill_window.skill)
1 T( a4 q. g7 G8 U9 a1 c; h # Hot Key num 2 ! L2 {. i8 N$ }8 P/ F# d7 o& g. {3 z
elsif Input.press?(Input::Numkey[2]) ( Y k. F$ h7 b
$game_player.equip_item_to_hud(1, @skill_window.skill) ; G6 ]1 U! e; x, d% i
# Hot Key num 3 X( N, J' K& \. E( C; I
elsif Input.press?(Input::Numkey[3]) ?1 s) d( X7 T3 a' h
$game_player.equip_item_to_hud(2, @skill_window.skill)
9 M& p! W+ R2 g; l4 P" F3 [/ o # Hot Key num 4
; c0 Y. w4 k5 h( n3 @" C elsif Input.press?(Input::Numkey[4]) - Y, p8 d+ C0 J- m3 Y6 B* \
$game_player.equip_item_to_hud(3, @skill_window.skill)
/ Q, U6 p6 J( G4 f # Hot Key num 5 ) a" Z0 Z8 @, S, L; H) G
elsif Input.press?(Input::Numkey[5])
$ D6 x e/ @! `. @. i% O) _* Z6 ? $game_player.equip_item_to_hud(4, @skill_window.skill) + \, s2 W1 J" j2 P
end - C0 Y5 m/ t" ^2 W, `
@hot_key_hud.update
7 b% j! I5 D4 L I) G end 2 ?' K* W) R! U7 n" Y$ B
end
1 b& J* h, A5 c0 c9 tend
. J% F- F* V7 @4 g. g( {& Z2 Y6 z
; K+ z' W/ _& Q2 R# i#===============================================================================
9 j5 l2 |# Z0 x- R/ x; H3 W; [+ V# Quick Item Window 6 x$ e& y; Q% T7 Y- W( ^+ g ~
#===============================================================================
8 Z" t n: Q) Y1 I" ~; xif XASVER_37 == false
5 o7 t, j8 @# m# \% g( f1 X5 p& n class Xas_Scene_Item
1 L ]+ S0 v8 ~- |: N/ W: r alias hud_quick_menu_main main n4 R# o4 S6 a! ~, Y
def main
V0 F% ]% \( k @hot_key_hud = Hot_Key_HUD.new . a! |2 [3 |/ M& j* y# J
hud_quick_menu_main 6 t& x, L, m8 i. w* q* n3 [
@hot_key_hud.dispose
) @$ c7 S7 D. x8 A* Z3 S end 8 ?; ^$ {7 \4 d3 @- r# R! y
- ~& e1 A9 ~4 n5 V* |7 K! ~/ o alias hud_key_update update ) |8 ?, ?0 c: E1 Z
def update
! h; f- T: {) Y1 @0 o) ^ hud_key_update
" |/ c0 U+ T) t0 o3 o # Hot Key num 1
' X& I/ v: g3 _$ x$ q2 C" M3 f, N if Input.press?(Input::Numkey[1])
0 ]. x1 y3 j- P) H" s7 {. n+ b $game_player.equip_item_to_hud(0, @item_window.item) ! i0 L' E1 Q9 g% U( J
# Hot Key num 2
t# z, Q. Y- I; I4 Y9 z elsif Input.press?(Input::Numkey[2]) - p1 p0 i9 }, t; H8 M
$game_player.equip_item_to_hud(1, @item_window.item) 9 _7 H6 }3 e- E9 f/ E/ o
# Hot Key num 3
$ y6 Z) h5 O' {6 X- f- M% q elsif Input.press?(Input::Numkey[3]) 1 _3 g3 b8 j b
$game_player.equip_item_to_hud(2, @item_window.item)
7 v5 P5 x o c; O9 q' X: {) j # Hot Key num 4 8 n0 ?7 n. L* J2 D' S# P% Y% E
elsif Input.press?(Input::Numkey[4])
1 ]1 }" }. A0 r$ n D $game_player.equip_item_to_hud(3, @item_window.item)
: E9 P0 d) d; t2 C # Hot Key num 5
' l" }% T9 C) Z2 ]' I elsif Input.press?(Input::Numkey[5])
* s. G6 d; P6 E# }' U $game_player.equip_item_to_hud(4, @item_window.item) R) M1 v0 H! q! l
end
; O: F, B% V1 r. X) r! X @hot_key_hud.update 9 G' j1 `; p' u) Y2 D/ l! R
end ' I. y. L: k! f7 c9 l+ L/ t
end
$ Y) |/ N4 B! }3 B/ }, Y0 nelse
8 Y: W& x- @8 U! C& ?" _8 _ class Quick_Menu_Item 4 [) \( a3 e( [' {2 I8 K: @
alias hud_quick_menu_main main
1 }3 Y8 b/ S; m+ k" ] def main ' ^( z' {7 J3 U
@hot_key_hud = Hot_Key_HUD.new & N/ F8 ?( i7 @ Y$ ?* g6 m* y
hud_quick_menu_main
/ r7 f" z# N6 r$ ~ @hot_key_hud.dispose
) a+ d6 k/ B4 E1 A end
5 [: G% C( j m' c $ n: y, O6 K( q0 n# q
alias hud_key_update update
. q' p9 C; U1 r0 e1 D; r def update
# ]! v8 b) o3 t* } hud_key_update ; S6 _7 Q' K# b7 y& O2 [) d! S
# Hot Key num 1 $ y3 A2 F" `0 y8 ]
if Input.press?(Input::Numkey[1])
) B {- a0 A* r$ R, X $game_player.equip_item_to_hud(0, @item_window.item) 8 Y% d: y! f( z0 t7 u
# Hot Key num 2 w F! c$ ~, y/ e1 r
elsif Input.press?(Input::Numkey[2]) & O0 e4 h% P; e# X U$ R, z
$game_player.equip_item_to_hud(1, @item_window.item) - o* ?( p/ q( d; g, T
# Hot Key num 3
4 N: H V5 N1 X' @3 N8 G3 Q. E6 k. Y elsif Input.press?(Input::Numkey[3])
. c+ w: |) R$ ]4 t9 V $game_player.equip_item_to_hud(2, @item_window.item)
* M5 z2 i5 J+ H9 w # Hot Key num 4
6 R7 Q* r% v( h. d: [ elsif Input.press?(Input::Numkey[4])
( w) C7 U# t# m L8 y $game_player.equip_item_to_hud(3, @item_window.item)
2 H1 d6 @+ H) @- t* n2 Z # Hot Key num 5
* u5 K+ z; X' Z3 J* M u j elsif Input.press?(Input::Numkey[5]) ! D8 A, t1 f0 g, m: N
$game_player.equip_item_to_hud(4, @item_window.item)
& ~7 i3 s1 L& z: K0 d) U# D8 n end ( l- I/ \. P( q7 y% ~
@hot_key_hud.update
# j/ t. `5 D8 O end # D3 F& E3 a, D% @; L
end
" C; w. d7 l; U k8 zend
, O; [9 Z+ A1 D$ K7 W6 l: ^
9 c5 L' `/ j6 {( B( t. E2 j#=============================================================================== # j6 k( _8 |. U
# HUD Window , f: ^* X5 d$ J9 W: O
#===============================================================================
- G3 v! |* a% \" y* Kclass Hot_Key_HUD < Window_Base
c1 u: F0 U5 N# ^% d def initialize(x = HUD_X - 10, y = HUD_Y - 15)
( U3 Y. O9 q B7 k) Z ~; \ super(x, y, 220, 80)
# R3 K* |# h0 O) j+ x# ? self.contents = Bitmap.new(width - 32, height - 32)
) w7 m( }: y# e2 k/ U self.opacity = 0
0 k7 I6 Z: O$ W8 H0 V# [7 M! w @actor = $game_party.actors[0] $ v7 ?" z6 q, {1 f7 K
refresh 8 X1 y& t# Q3 G! Z
end
. ~6 x( ]' I* z) {& Z" q
, n/ f! U4 x6 b8 ^ def refresh ! @4 A: q3 ?0 Y) r- J1 x
self.contents.clear " a, s9 d; S# t# t
bitmap = RPG::Cache.picture("Hot_Keys_HUD")
% j8 Q0 D1 K1 q% |) b self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
( X. t& P: [+ f9 M4 o6 \ for i in 0..4 : ?& D2 t- Y, `3 Y1 {: \7 Z
x = 32 * i + 4 8 Q+ _4 }8 A$ i/ ]0 Z. T
item = $game_player.hud_equip[i]
/ O% K, ^# P: O" g& \8 O& B# j next if item.nil?
: v, o# K+ J5 J1 o if item.is_a?(RPG::Weapon) 6 c5 v1 _1 F9 x3 ~/ r! A5 \
item = nil if $game_party.weapon_number(item.id) == 0 and
8 j5 m4 l0 ?" D3 r/ }2 e; H @actor.weapon_id != item.id
0 n; T, b. G' H+ j elsif item.is_a?(RPG::Armor) + L" { I; c& g" n ^
item = nil if $game_party.armor_number(item.id) == 0 and . v/ \1 F1 G5 f, r4 ]1 O+ X
@actor.armor1_id != item.id
2 p1 Z/ N5 `4 }3 f6 t* i7 R( M elsif item.is_a?(RPG::Item) . B9 N) x7 H$ u0 q( }9 ^
item = nil if $game_party.item_number(item.id) == 0 or $ y( J& f" T: q6 \- V- D, ~
!$game_party.item_can_use?(item.id) . E* z7 _3 f1 y3 A! J0 z3 C( a& A
end
0 g, h- a" I# W! l bitmap = RPG::Cache.icon(item.icon_name) 5 C) t, F& y! B$ A7 R
self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) _6 Z6 q5 F1 c! O$ Q' R% d2 j# x3 [
end
) i7 t3 i3 v& T2 b! ~# w end
2 Z( [: C/ D- S7 r) N8 E2 t7 j " k7 C* C9 X& O, S5 o
def equip(item) $ i7 P& i0 W: ~* M8 Z
if item.nil?
" a& ]2 u0 n* ^! R0 [0 _ $game_system.se_play($data_system.buzzer_se)
. l+ C! P4 m" \+ b9 z5 P return . f, }, m1 l: @* o2 C
end
/ M! K( t' X( m& o1 V& q' j7 e) z if item.is_a?(RPG::Skill) 3 K2 e. i2 r7 n L' {& |
if !@actor.skill_can_use?(item.id) , u# d: F1 l4 A' Q. A
$game_system.se_play($data_system.buzzer_se) 7 d4 U; e$ a M+ Z. Y( Q
return % @* g' c: j/ r
end
, `5 i. o2 k8 ~9 S" V9 { #$game_system.xas_skill_id = item.id
# x! s3 c; t" r @item_type = false . P( x6 |; z- C
elsif item.is_a?(RPG::Weapon) ) W0 e- R8 `) [5 K. z
@actor.equip(0, item.id) , H4 v; o' n& o* t4 f
elsif item.is_a?(RPG::Armor)
$ `) u0 r, u8 j @actor.equip(1, item.id) # n: P" Z3 A5 z# _& O/ W% F2 A7 @# K
elsif item.is_a?(RPG::Item)
) g3 f) b0 c+ c item_tool_id = XAS::XASITEM_ID[item.id]
; i0 n5 y1 Q1 z- P* v if item_tool_id != nil
$ g7 O- X7 o9 H# {2 x; A% F unless $game_party.item_can_use?(item.id)
3 y) D- P; Z! c $game_system.se_play($data_system.buzzer_se)
5 H) s" e" I& O7 n. s k! t4 N return ' u( E# U4 d, ~0 L9 u# ^
end
; Q2 C5 V; c1 ?0 w, W$ S #$game_system.xas_item_id = item.id + ?. ?; W' T% s2 m, K2 l7 O2 v
@item_type = true 7 f v4 [0 w0 M6 k# p
end ( ^. w- p* q% a
end 5 \0 _$ h+ x( u+ v2 S
#$game_system.se_play($data_system.equip_se)
: O# ?! i K0 x! O end
( d4 K0 T$ E1 B
, n5 |, x/ _$ n, b0 b def use_hud_item(i) 6 N6 y' r5 g' r5 j, T
if @item_type * }& f+ J5 O2 j0 r
$game_temp.force_action_id = $game_player.hud_item_id[i]
1 I5 U+ K8 Q6 [- _' y else
. |7 b9 M4 { i $game_temp.force_action_id = $game_player.hud_skill_id[i]
H2 D: Q# @$ j s5 O+ q! P end
" N8 ~9 B" Q/ i5 c end 1 N; _3 f" p" \
. ~$ q, j& k) W4 R+ V9 h def update
. D. `% y0 P" f# m) \ @actor = $game_party.actors[0] * e# D3 y# V4 O" {5 K
@hot_keys = $game_player.hud_equip
" i# _7 `1 n8 s; E0 {0 T refresh
. {) f( P' B( T return if !$scene.is_a?(Scene_Map) ( U8 Y4 Z/ ~1 x$ | c+ O) B5 [
if Input.press?(Input::Numkey[1])
% n# Q1 r3 |# } equip($game_player.hud_equip[0])
! H% R' X7 `& F9 ?2 t V0 f use_hud_item(0) 1 \" I8 m' w" r6 u, i) l% i
elsif Input.press?(Input::Numkey[2])
9 N0 I/ ~5 A! `& C5 I2 O equip($game_player.hud_equip[1])
. i- |* F: g/ v use_hud_item(1) 6 r( b, Z% X1 c1 B
elsif Input.press?(Input::Numkey[3]) ' [" K+ T& U( |1 e4 l
equip($game_player.hud_equip[2]) ! `: \9 o$ t' F. L/ u1 q- @
use_hud_item(2)
" b3 r/ i/ f' l0 s- r elsif Input.press?(Input::Numkey[4])
4 {& U$ x, u3 H$ C9 S equip($game_player.hud_equip[3]) # o# o' ]* T+ J* @3 M: j
use_hud_item(3)
, x/ a& N4 Z* p5 S8 V elsif Input.press?(Input::Numkey[5])
. U" N" v1 [: Y. r- } equip($game_player.hud_equip[4]) ! F% [0 q, b8 p' E! N. N
use_hud_item(4) / q4 b3 m7 Y: E; i: n+ U* v+ t4 R
end / h8 c+ G" v! K" x
end
* T7 {; s7 M- Zend
' h3 O3 H% F/ e8 A1 ^ ~- n% G# [1 x2 ^* r! v6 {
#=============================================================================== , S: G6 }1 ?1 F- L0 L9 ^4 q
# Scene Map ' Q- V- f4 r* k, s( ^$ d9 C+ z5 U7 M
#=============================================================================== / C4 v. d6 x# H' {
class Scene_Map ( y1 N8 i* Y3 I! Y
alias hot_key_hud_init main 1 w: w6 ]* q" l" v" _: D ~
def main 9 L0 Z+ k( Z! U7 A' A6 C
@hot_key_hud = Hot_Key_HUD.new ! s$ N* ~1 H$ f1 k7 v
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] 3 p$ |' T& _/ c4 y% D0 A! s
hot_key_hud_init 1 y2 a; C. ^+ D* Q
@hot_key_hud.dispose 1 N. i+ _5 G7 N4 Y# d o
end 4 n8 `' k/ b% {! p; C
: G5 `0 L8 |1 |: ?/ ?7 Z0 p: m alias hot_key_hud_update update 4 e& y6 h0 v9 ^0 s4 U# F
def update 3 B, S! {9 X+ q" k0 Z8 ~
hot_key_hud_update " G M3 Y0 m, y& C- Z" C
@hot_key_hud.update 5 C* z) @( W7 f3 N3 k5 t/ k
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] 1 w. [( S3 P" P0 [% y
@hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] D. U" B4 a+ [/ Y' b
end
+ d5 }9 `# s: J* nend 8 A1 B1 }2 _$ ^8 A0 X
|
|