| 赞 | 0 |
| VIP | 15 |
| 好人卡 | 21 |
| 积分 | 7 |
| 经验 | 24727 |
| 最后登录 | 2021-10-29 |
| 在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607

|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 2 K0 }1 ~$ T: M/ o
# L- K" M y5 ] l |
在Extra Skill里按1~5是设置
1 h6 s ^) o @. {5 }8 I# {% r( z设置好后回到地图按1~5就是……切换。7 [3 J1 a) e5 [; Y8 ^$ M
3 E. O3 |3 U. }6 @$ I: Q+ s. ]
请问是要改成直接使用吗?
4 P1 a& ~9 n8 w7 M; ^
% M' b9 B# G, S5 r6 E9 S那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。) C5 J# F# A% d4 j2 c; ?. ^/ q
#=============================================================================== # 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
#=============================================================================== & N! D& g# Z0 |, a
# XAS - Hot Key HUD 5 D& d/ l6 }* x0 Y- n- g
#=============================================================================== ! E/ K% q% A( k
# By Mr_Wiggles 2 E+ F, H. p" D: W5 X3 X7 Y1 B! o
# Version 1.3
# m) B9 B5 l1 U1 b v& r# 7/6/10
[* G7 j x- E+ Q. o) z#-------------------------------------------------------------------------------
8 [) V5 F* h) K1 X4 p) N# Instructions: " x5 A. m4 Z: e3 K
# Fill in the constants bellow, paste this script above main and bellow XAS in 8 }- G2 H) X5 f
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
4 f: a; ^& ^1 W! ~0 o#
8 S9 X1 C7 g; H* d7 G: E# Place the "Hot_Keys_HUD" picture file into your game directory
1 U, k0 _7 p$ G4 l# Graphics/Pictures folder.
$ f" ~8 Z" Q0 K1 R" @) K#-------------------------------------------------------------------------------
$ @1 D E5 l7 s1 j# Directions of Use: 7 \8 c( U, }% P( q/ T# x9 d# b
# Simple just press a number key (1 - 5) when the quick skill or item menu is
5 E- w a- w; n G) o& W# `# Showing.
6 `/ W) j: g" l6 C7 Q" }#=============================================================================== ! D( \4 R: E3 k
HUD_X = 0 # X pos of HUD 6 r, y' d3 k1 v0 ^" V# q
HUD_Y = 0 # Y pos of HUD
. p0 ~; l6 z c% t7 r8 iXAS_HUDDISABLE_HUD_SWITCH = 1
1 Y8 g, g& n# {4 n2 _( t4 a 3 v3 N* P4 f! R
# Set true if XAS 3.7f
5 `8 S! W! E7 n$ l# set false if XAS 3.6 1 l: F; b) N0 v- {7 s E! m+ t6 @
XASVER_37 = true
* g1 j; L& F$ i! }/ c9 p d3 I; C1 J. h. j# B* m) P
#=============================================================================== & \* _+ o7 e6 M( M' Q: V
# Numkeys Module / \8 ^$ _/ W) Z$ q( l7 E
#===============================================================================
6 Q; v* n- Y8 E0 Imodule Input
3 I, k7 M1 G' F) H( m; l* g: C Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
8 W1 ~% H& W+ e( _* q class << self # N: Z: D! V" F* u$ q0 x
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
7 b: c8 t" `4 B: S& ?" t " U8 u9 c: I( V0 |- u5 @
def testkey(key)
* ?1 G7 t& q% z7 z+ ^4 ]% E# u! z Key.call(key) & 0x01 == 1
6 H# [& N& S; N) j* I8 z$ J end 8 {8 Q9 m$ f: \6 W
' A; U% V9 f1 B. E6 ` alias hud_key_update update
8 g, {; u5 O7 p/ N def update 8 W7 A2 Z' }0 B7 V& m7 c7 K
hud_key_update / b3 v: _- ?6 ?" w T+ ]
@pressed = []
. j+ t1 L! |" x8 n0 u* e6 g. n for key in Numkey.values
0 i( f; g( a' ?7 O2 g; B key -= 1000
' }. o8 j* @1 m% E! l @pressed.push(key) if testkey(key) ; m( S) {6 [0 D/ y( Y' w
end 4 _. a" j; }) a3 h0 d& X% U _
end
; o' ^* H/ |$ s4 |4 X+ J; ~ ) ]* r9 r5 c' C' F, ?
def pressed?(key) w7 W, T G/ M4 [# @/ d8 Q: U
key -= 1000
0 N/ L. j( _$ L1 {5 J6 M @pressed = [] if @pressed.nil? & ~+ q+ I# D- n) ~7 k! f E
return true if @pressed.include?(key)
. C2 x5 j% z+ q7 s+ u0 S9 r return false , R9 t7 C: v+ n; Y3 v
end 6 a; `; [# l8 B; G& }
2 h# V: k) L; k9 j, |1 k& J" T( E$ l: G alias hud_key_press? press? 8 s1 T+ v6 {' |+ I8 c
def press?(key) 7 _ w+ z* L6 q$ r8 E; `5 W2 q& J+ R
return pressed?(key) if key.to_f > 1000
/ k" d, w K C hud_key_press?(key)
, S' ~( M M9 Q* U/ I end 7 v" t }" _% ~5 k) i6 v( A
end ( e0 y: y' K( d! T8 s
end ( A8 h2 p- B: f: b7 Q
+ v, F5 k( D; B( k9 q* x
#=============================================================================== . G, q5 ?( _+ z: m
# Game Player 2 `8 p+ c/ ~9 [% O
#===============================================================================
: t# R$ b* l2 `& F# l# G! E/ Aclass Game_Player < Game_Character $ J% W- \5 ~) p$ {; Z
attr_accessor :hud_equip & e/ ^/ u' j8 F( E4 p
attr_accessor :hud_item_id . ]9 x" A1 n% I& \
attr_accessor :hud_skill_id 8 Q! }1 j* A3 p
# x9 c9 ^$ I3 V) X# ~: D
alias hot_key_hud_init initialize
# ]( X3 @$ J" z7 W0 e+ l" y def initialize . a- ]- o0 _$ O
hot_key_hud_init
* G8 h6 [& @) l @hud_equip = [] . a5 J1 L! b4 w( [
@hud_item_id = [] 6 {! c4 `0 w9 U3 @; J' B2 w- I
@hud_skill_id = [] ! f( |8 Y; O4 a3 H! j |
end
) O: H$ u# u/ T
( b- X$ Z& }1 F4 r def equip_item_to_hud(n, item)
: b& r8 ?) q- G5 ^3 ^, c if item.nil?
8 x7 e! V2 K) ]0 @6 c $game_system.se_play($data_system.buzzer_se) 6 I& j% X7 o2 B' }$ c
return ! K z8 x1 `6 y2 @/ [. d- s+ K; ]
end 4 f5 U* I L n2 P! o6 s
$game_system.se_play($data_system.decision_se)
& X" u9 E0 s- K' e @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
. b1 J; G) _2 e! G; u. @. H* f @hud_equip[n] = item
8 h2 |0 L9 p% a" j @hud_item_id[n] = XAS::XASITEM_ID[item.id]
& u V! `( m' G" @3 m8 q @hud_skill_id[n] = item.id , {3 F! t; ~! c' _ i
end
. H# w% Q. w$ f/ @4 r. xend 5 O5 Y! ? u* t" `7 U0 D4 k* ]
7 \$ E1 R* u2 X1 b: C7 \" X/ C#===============================================================================
0 a% n# O& h* F# Quick Skill Window
! H) I9 s5 a7 T! C1 R ]#=============================================================================== - D2 \+ r; j3 H. L+ g
if XASVER_37 == false 6 a4 W" r! p2 L {8 {( ^' a
class Xas_Scene_Skill
+ z4 d5 `5 e7 ?7 G/ s alias hud_quick_menu_main main 8 b9 o9 G( S# G; k& ?+ w% u
def main , i0 b5 I* U; c, J. G: V5 e
@hot_key_hud = Hot_Key_HUD.new 0 b5 x8 F$ X/ i; s
hud_quick_menu_main 4 k4 Y# ?9 R1 k8 l5 L) E
@hot_key_hud.dispose * e) L; \* x1 ^0 Z
end
6 i! o% I/ d6 x
) }9 q: Q" o3 ?$ R0 \# s6 D alias hotkey_hud_qucik_menu_update update
{3 \# ]9 L% K1 ~ def update
, ]. p+ C K" Q D4 Q0 E hotkey_hud_qucik_menu_update " }1 F* P7 G/ e; l8 b5 z
# Hot Key num 1
+ e+ S" W# c! Q2 J6 ~* \& U5 k8 y if Input.press?(Input::Numkey[1])
K, Y t8 P$ N! o $game_player.equip_item_to_hud(0, @skill_window.skill) 5 P6 Y. c) H3 X( E0 Q) L2 y
# Hot Key num 2 % \* L6 Z# X; g* O5 E
elsif Input.press?(Input::Numkey[2])
8 a0 x1 }7 U1 r- c $game_player.equip_item_to_hud(1, @skill_window.skill) A5 K; @9 g2 e" f' S, s
# Hot Key num 3
, X3 u+ b( W+ M" P8 E5 K: H elsif Input.press?(Input::Numkey[3])
8 h1 y8 W3 r! X, p1 [% {( G2 P9 b $game_player.equip_item_to_hud(2, @skill_window.skill)
: F# l% ^( r7 D+ U # Hot Key num 4 8 c+ y6 v7 K9 L' Q& ^# m
elsif Input.press?(Input::Numkey[4]) 9 _5 g0 s# c1 b$ j
$game_player.equip_item_to_hud(3, @skill_window.skill)
% S- T8 I1 ]7 e& X2 {9 j # Hot Key num 5
$ n0 o, s( V5 G elsif Input.press?(Input::Numkey[5])
4 [3 d. E8 A/ z. ?9 \2 J $game_player.equip_item_to_hud(4, @skill_window.skill)
7 `. k* ~' e/ Z# B end
+ I) [/ o& x! D4 R" X" u @hot_key_hud.update
" p8 @# Y% S5 a ^ f end ; d1 ^7 m: z' j1 Y/ b$ `
end
3 ^# I( ]: H: r8 uelse
6 s8 L- B! L! X: U Y T4 X class Quick_Menu_Skill 5 Z% q+ i: e# [& r+ R- \8 L
alias hud_quick_menu_main main 0 k6 A* F3 i8 o C
def main
6 H7 i) J3 m7 F- m& J( q @hot_key_hud = Hot_Key_HUD.new 1 `% U9 G: ]8 {: T7 e" D. k$ n
hud_quick_menu_main - E; A# R7 w+ ^
@hot_key_hud.dispose ' z/ G4 e3 M% o9 h
end & {7 h1 s+ ?8 s, @ }( M3 F
+ Y. |3 R9 [: K alias hotkey_hud_qucik_menu_update update X) \. t) \1 J
def update " _4 C* i+ K% s1 M% k, ]
hotkey_hud_qucik_menu_update - B# R% O% h2 t) R6 U" ?9 Q
# Hot Key num 1
% V! X" T. q5 | if Input.press?(Input::Numkey[1]) 4 M# ~/ v' l7 ]1 Y- R
$game_player.equip_item_to_hud(0, @skill_window.skill)
1 w/ [! f8 ]" `! Z$ _* B- b v) e # Hot Key num 2 0 f& F( I# Y5 h- b G
elsif Input.press?(Input::Numkey[2])
" I" x* ?" z6 N( @ v $game_player.equip_item_to_hud(1, @skill_window.skill) . N( |& f2 W! E2 p
# Hot Key num 3
' ]' r: G" i9 S5 h, c+ \2 ~ elsif Input.press?(Input::Numkey[3])
0 V1 L* A+ C9 S' Q $game_player.equip_item_to_hud(2, @skill_window.skill) . Q. j! Z4 _( Z7 e
# Hot Key num 4 2 i P! C5 J4 @( u) Y: S
elsif Input.press?(Input::Numkey[4]) : s: C3 E6 E& a# p7 ^
$game_player.equip_item_to_hud(3, @skill_window.skill) 3 ?7 j0 B- w0 Q* \4 t4 R( h( @# B
# Hot Key num 5
/ l0 G; \: V" y* K: ? elsif Input.press?(Input::Numkey[5])
A7 ^9 @/ K$ A# W& f) F' Q $game_player.equip_item_to_hud(4, @skill_window.skill)
& [) D! A5 U& D0 d+ h end , G, k/ U& J$ C2 ^" {: J
@hot_key_hud.update
/ {' B6 o1 B, ]& X$ p# K" A% {2 A c end + |+ z4 U9 F8 k& R4 t5 W
end
) K6 E! Q4 c" c% Eend : }! l" l) I: J
4 k3 t* n2 a% l" ~4 I0 i
#===============================================================================
" m& V' }0 |* v6 \- Y8 D. ?# J# Quick Item Window & E4 B, L! c7 C, E% U, ~
#=============================================================================== 5 M6 {6 S& F+ i4 P8 d+ }' h
if XASVER_37 == false & M3 ?7 {3 p2 T8 a. V: o
class Xas_Scene_Item 7 S% Q6 O4 }2 H; b4 ~
alias hud_quick_menu_main main
! A$ y8 X5 N) ^/ T: v5 S def main
& i( o$ B3 I" M' h+ R8 u) r4 l @hot_key_hud = Hot_Key_HUD.new * l# }: N, X/ g
hud_quick_menu_main 9 A3 g8 X4 O1 t- Z
@hot_key_hud.dispose
! n P8 e8 h! C) a end
) r, p3 \9 G. Y" K 5 ]$ n- ]# q- `
alias hud_key_update update 1 N9 L& E: f8 P- j. V
def update $ Q5 u3 K* k) }5 o) ]. _
hud_key_update
S$ |. U, E G6 A. k* O& p # Hot Key num 1
9 `# \% N* W4 T8 ^0 k4 z5 n if Input.press?(Input::Numkey[1])
# ~$ `9 N. Z! ~, G3 R, y/ G4 m $game_player.equip_item_to_hud(0, @item_window.item)
: }' X' [/ `* O # Hot Key num 2
. }7 e0 m6 L' q, ^/ i elsif Input.press?(Input::Numkey[2])
/ F5 [8 Y% p y! m2 q $game_player.equip_item_to_hud(1, @item_window.item)
& I! s1 B1 I, D! s( T # Hot Key num 3 9 Y4 x9 C0 ^8 H& L n# x# q
elsif Input.press?(Input::Numkey[3]) - v9 H5 U. H n4 G- _7 {# j
$game_player.equip_item_to_hud(2, @item_window.item)
; T! W* Z! m2 i # Hot Key num 4 ! f1 U7 o9 `- C: H* }, Y& E8 h
elsif Input.press?(Input::Numkey[4]) - i: j9 ]. ~* i
$game_player.equip_item_to_hud(3, @item_window.item)
2 C, c% _& f) E( ?5 k8 j; j/ t # Hot Key num 5
! k. q: D8 I [3 M X) X elsif Input.press?(Input::Numkey[5])
/ D) u g" V7 {( ^ $game_player.equip_item_to_hud(4, @item_window.item)
; i& A* Q: z' F$ O# p end
- Z, j5 }% S5 t7 \! Q" W @hot_key_hud.update , a% x5 l# r- g& f! H& {
end
$ A/ d1 n5 i# a- y' C7 n# S3 c! y' C end
' B8 R, E; u. r0 L8 Q: Eelse
1 r& d) O0 _* H. N1 G/ v9 G! q class Quick_Menu_Item
# D4 H* n+ L8 i- [2 @; a. G alias hud_quick_menu_main main
1 s2 x9 u: O# ?' @4 _$ p def main / p" e+ p+ O- [2 X# N+ g+ J1 [
@hot_key_hud = Hot_Key_HUD.new
$ _* P9 C3 \ r( r/ ]8 l2 r" y hud_quick_menu_main 2 K4 W) p; N, s- F6 R$ {& Y
@hot_key_hud.dispose & _2 c n6 p1 f9 z
end
1 D0 j* L2 J0 H9 V0 F u( }; ?
9 Y: |5 S) }% f3 A- P _ alias hud_key_update update " K( [& Q7 {6 c! a9 E
def update & X) J5 n2 R: T& f
hud_key_update
2 q v, B2 b+ o6 W: N # Hot Key num 1
: T) q* V$ O+ M3 c: P, k if Input.press?(Input::Numkey[1])
* x5 a' Q3 f) P0 J $game_player.equip_item_to_hud(0, @item_window.item) ; A a# k9 F8 x8 l2 u q9 X: k# L
# Hot Key num 2
& J, e/ c) }8 _) Q3 v elsif Input.press?(Input::Numkey[2]) " L: T4 C0 o! ~3 u9 ?
$game_player.equip_item_to_hud(1, @item_window.item) . P6 T0 T: i( J' H2 k. ^
# Hot Key num 3
5 i' |9 I1 |+ Y4 K; V: O$ R elsif Input.press?(Input::Numkey[3]) " D3 B+ X; B& l
$game_player.equip_item_to_hud(2, @item_window.item) 0 ~" U# c+ B) n1 [+ q( ]$ ^; y! @( S2 `
# Hot Key num 4
) H& Q* p7 ^9 L; r& W; A elsif Input.press?(Input::Numkey[4])
, {9 l, @" X% C# d $game_player.equip_item_to_hud(3, @item_window.item)
; r* {/ W& H/ H5 S; C # Hot Key num 5
! K# j6 |. v O8 c elsif Input.press?(Input::Numkey[5])
% H: Z% @/ f1 b5 w9 g $game_player.equip_item_to_hud(4, @item_window.item)
$ U% w! k* v" h& s! l" ]5 A end
' M: V3 A5 b% R x- {6 ]+ N( k @hot_key_hud.update
2 h @1 t* P, K% v3 E; i end
$ o+ L5 g. Q6 T+ P- A end
0 m& y6 t/ C; g: G2 Z# Qend
" e/ ~& l$ q! G! P: T% o 5 ?3 D- y2 Q, F. y2 X
#=============================================================================== B# s6 A3 i# o9 p9 j1 q
# HUD Window
3 }0 l9 ^3 E( K+ g2 A: B1 t3 n# ^ \+ `#=============================================================================== ' _: k0 h3 K* z+ ?, }6 @
class Hot_Key_HUD < Window_Base
- ? l! `) u) |4 n8 f def initialize(x = HUD_X - 10, y = HUD_Y - 15)
- X% M, E8 v5 J! g0 W( | super(x, y, 220, 80) ) T5 @0 {/ {4 _) N" w; Q& L% d' {
self.contents = Bitmap.new(width - 32, height - 32)
% A5 n4 X7 S: \3 E5 b! q self.opacity = 0 2 t- f' X: v9 F1 j6 A
@actor = $game_party.actors[0] ) A! x6 c6 w% {4 o
refresh ; T( F( |8 d" |1 C& w
end
& H! M4 a, d& d' n# A& T$ W# v5 t
' `3 T$ w: d3 Y6 S' M! ^, ^ def refresh 9 M; E% @8 Q6 c5 y" J5 Y
self.contents.clear
0 z' L, t1 J6 M. ~" f+ F bitmap = RPG::Cache.picture("Hot_Keys_HUD") ; ^0 i( s. ^2 t7 R- @7 g, f
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
' D" ^1 t3 e/ L! q- K$ ] for i in 0..4 7 N5 |( O6 x2 U: Z$ v" b0 z
x = 32 * i + 4
8 T4 f* B; _5 } item = $game_player.hud_equip[i]
0 M2 G, v3 g. R& A! B3 x next if item.nil?
! z/ s$ C* y, R/ g" N; A' S if item.is_a?(RPG::Weapon)
% i7 |1 f/ T, \, x1 S7 G+ K! \ item = nil if $game_party.weapon_number(item.id) == 0 and : a9 g& m; `9 B
@actor.weapon_id != item.id
6 x/ C; l4 r' Z- A7 {. `5 h elsif item.is_a?(RPG::Armor) - `+ q2 z( _; C2 J9 T' u
item = nil if $game_party.armor_number(item.id) == 0 and : p: r2 G$ p- G1 c
@actor.armor1_id != item.id
! I- K7 @% m5 t6 \6 v elsif item.is_a?(RPG::Item)
0 M/ C% s% }" x* ~* ~ item = nil if $game_party.item_number(item.id) == 0 or
, Z: O% {# X" q3 L !$game_party.item_can_use?(item.id)
9 O' W* H5 A: v$ J$ Y9 P end
7 \0 p( v7 \" @ bitmap = RPG::Cache.icon(item.icon_name) 4 B5 F+ I* X. ` p! K4 H' y/ x
self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) 8 [5 S' p: j: Z0 {; Q2 F J
end 4 Y; C/ h U: E- f, N/ y
end 5 s, P! Z1 [6 T, Q$ S
) K8 O6 p/ H9 v6 M- W) b H/ P def equip(item)
' S, J8 D, J: m' Y if item.nil? ' W; N. T! j: D: g* D/ Z9 E
$game_system.se_play($data_system.buzzer_se)
% e+ J4 `; n; {: H7 d return " u, i* J/ r p( Z
end
[ z5 c4 c) T ?4 E if item.is_a?(RPG::Skill)
, Z+ n( A, E/ S$ x' Q. @# y if !@actor.skill_can_use?(item.id) ! p, T, ~. X9 O' J$ M0 {7 a: _ q
$game_system.se_play($data_system.buzzer_se)
! m0 f! p* s6 d, w8 C. n) v @ return * b" P: p7 w; A0 U& K
end
5 _; o+ n& N4 I& V# g #$game_system.xas_skill_id = item.id * ^6 e1 B9 D+ Q( z5 X
@item_type = false
" x6 W$ C+ a) w, K elsif item.is_a?(RPG::Weapon) # I% R* Y+ t+ t2 L. ~6 X; e- g
@actor.equip(0, item.id) ; J8 o( R4 ?( K! x" @( L
elsif item.is_a?(RPG::Armor) ! J% x* j- ]1 w7 V9 ~% K( E
@actor.equip(1, item.id)
4 P% t8 w4 }: g2 f7 i! C! p% V7 H* E elsif item.is_a?(RPG::Item)
- e3 Y" k) K" ~% B7 v7 d item_tool_id = XAS::XASITEM_ID[item.id]
( W# o5 z3 R6 m: w+ P f* V! X2 p if item_tool_id != nil
/ X' F5 b4 B! E2 S- L$ a unless $game_party.item_can_use?(item.id)
( H6 E3 X0 `: H( Q* p% A $game_system.se_play($data_system.buzzer_se) 8 q) I, v+ g4 i2 Z
return # w8 D) k+ l( Z' i3 b
end
" ]( Z. t0 V4 h- A/ c | #$game_system.xas_item_id = item.id $ _& d9 O# @* q+ T7 U
@item_type = true
/ f4 V2 m6 a" z# r$ z. k, k% N end 2 N( {, I( F/ I$ H2 d8 T6 O/ K
end ; s, P: ^5 G7 O
#$game_system.se_play($data_system.equip_se)
) p* V! E; l7 D* v0 F. c& s end
4 E; j- k, @& y% l/ \5 z+ { W" G
- s3 k, q, h1 q1 M7 J2 b def use_hud_item(i)
* @, u' l6 W' H6 B7 D2 { if @item_type % }; `% }2 K' W3 [" n, _0 M# q/ D
$game_temp.force_action_id = $game_player.hud_item_id[i]
4 X F0 M- s* f6 H8 N" J9 |, E( x else
" [! X9 N; F6 `5 @9 D $game_temp.force_action_id = $game_player.hud_skill_id[i] - z1 X7 n. h6 K
end ! S5 e9 g$ z8 ^
end
, U4 i- {. e+ W. f# D ) F. \' h1 N: ?8 I8 R; i
def update
: K" n1 [6 X6 K @actor = $game_party.actors[0] # L& d& f# u9 T) C; \" p6 p
@hot_keys = $game_player.hud_equip
( m& A2 ~& f& g5 B' d/ E* e0 w refresh / x4 x, @+ A& j! I$ S2 j
return if !$scene.is_a?(Scene_Map)
7 g0 q& z1 |$ r: `" |* W2 o0 k9 y if Input.press?(Input::Numkey[1])
0 |5 d# ?: t$ G1 V2 i; m2 a+ a: \ equip($game_player.hud_equip[0])
, w1 G% [) N# S& a1 ] use_hud_item(0)
# [, ^8 A/ y5 K: B elsif Input.press?(Input::Numkey[2])
3 v: ~" {) r8 c: v# I equip($game_player.hud_equip[1])
4 Q* K" q J2 q. G' J5 l5 c use_hud_item(1) : e: ]- Y! }/ V6 m$ w
elsif Input.press?(Input::Numkey[3])
: g! |2 N8 c7 e6 c4 x equip($game_player.hud_equip[2])
$ R/ u5 a5 b/ ?0 _. f! M use_hud_item(2)
$ {4 x* [3 D* S! } elsif Input.press?(Input::Numkey[4])
0 V, ?2 r- _+ W, p equip($game_player.hud_equip[3]) z9 {% b7 r) r, ^
use_hud_item(3)
- M% S- y' r0 Q( n elsif Input.press?(Input::Numkey[5])
( Q0 E. }: ?6 A; z& K& n* C equip($game_player.hud_equip[4])
# A8 n- d( Q$ q' X2 g" ` use_hud_item(4)
4 A! y, J/ J& j6 @3 [ end # R: D0 u: t9 ~. v0 h
end % S3 {! q- y* T# c1 K
end
# C& z \# Z( F6 r: ^9 c $ \1 k( m x/ P' ~4 a [( V
#=============================================================================== * y5 { |, h1 w+ @5 G
# Scene Map 2 [7 ?# A4 X0 X" C
#=============================================================================== 5 M+ s/ z! Y! F( N1 _
class Scene_Map / f! d' v+ r( t- X$ F- d
alias hot_key_hud_init main # q/ l% A9 }9 E8 ]% A
def main % i- s2 [# T7 M* b5 K% N( H- i7 E" Q# i
@hot_key_hud = Hot_Key_HUD.new : Y3 R5 p8 R9 Y' c. ?
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
7 F, W3 q* r: a) }! a& A hot_key_hud_init
V E+ G) U$ U( b) I ] @hot_key_hud.dispose $ a/ W' ]) Z" p; T
end & i8 y. w1 d0 D( f
* ~$ |( |% f) A& r alias hot_key_hud_update update
; N$ V5 O& f' E def update ) v+ @) G3 J0 F
hot_key_hud_update
T8 S: @& C' I% q1 d* E @hot_key_hud.update
$ {4 j" @; c5 F+ r& g/ P. H7 T @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
8 O( W- e& _. i, \1 H2 L$ ~5 S @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] 2 x1 l. r8 k: m P8 @2 g* c7 J
end / B) G& y; e: P1 }& C1 G9 V
end
) A7 l3 z# E d, U0 o0 R5 m
|
|