赞 | 0 |
VIP | 15 |
好人卡 | 21 |
积分 | 7 |
经验 | 24727 |
最后登录 | 2021-10-29 |
在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607
|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 # w8 j# E/ U) S/ i' M4 q
7 I& j2 v( O1 o9 I
在Extra Skill里按1~5是设置
. O" c( i& c1 z) E3 P7 W设置好后回到地图按1~5就是……切换。
8 n& H* k3 V S5 x9 h' i4 ]
& m7 P$ Q# }4 B6 B请问是要改成直接使用吗?; P, v8 F$ X8 a, C
$ O* H# {: M5 D b那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。
1 j# J6 n3 W/ B8 _& K4 R#=============================================================================== # 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
#=============================================================================== 4 ]$ @/ [9 r1 s" a A i
# XAS - Hot Key HUD
" U/ J! v$ K7 E#=============================================================================== 2 D3 [$ |3 t5 z
# By Mr_Wiggles - b1 k W, q H
# Version 1.3
* g- F% M- p3 ~7 O) i1 F# 7/6/10
! m, a, w1 {# e" [7 h9 Q, C#------------------------------------------------------------------------------- : @5 `: S. W3 A2 F/ i
# Instructions:
+ U) U/ u ?- ?; A# Fill in the constants bellow, paste this script above main and bellow XAS in 7 r8 L. M6 T9 Y- l+ E1 V
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!! : n2 p% Z; S8 S
# 3 H, R/ Z! m1 r
# Place the "Hot_Keys_HUD" picture file into your game directory
8 x; T5 l* L J4 l8 f# Graphics/Pictures folder. ( g6 D; }5 ^$ {" _) V
#------------------------------------------------------------------------------- * u0 y6 r3 Q) k4 P
# Directions of Use:
! [) e; y0 L$ T/ ?& b, Y# Simple just press a number key (1 - 5) when the quick skill or item menu is ) N3 V; o8 O" D
# Showing.
U" l |+ C, G4 W9 D- i! H/ l#=============================================================================== ( C% c1 l( _5 I2 s9 C% s
HUD_X = 0 # X pos of HUD
9 p; n1 h4 Q: i# P, BHUD_Y = 0 # Y pos of HUD
, g* k; F. N! j1 V3 q& w2 G# S: AXAS_HUDDISABLE_HUD_SWITCH = 1 4 W# _. G9 B$ g% x0 e6 I
! t0 {0 s' L1 _
# Set true if XAS 3.7f - n" _0 k( g2 s$ H
# set false if XAS 3.6 1 c$ m# h+ W; z. K
XASVER_37 = true
/ ^7 ~: g- U. ] _2 Z( w 1 L3 j( N! w! \& ]2 _
#=============================================================================== : T# p& @1 h8 {, f1 ]) Y- U" t- Q
# Numkeys Module k" o6 \% _( i' {; i6 a( d
#=============================================================================== 0 o) i+ L8 Q' ?
module Input
( \: n% A" U& Z Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
$ Q/ B. |* v7 P class << self * |) y% v0 n D6 p0 w: I' J2 e
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
, v* I" @8 U$ X5 D) F7 E! s' W 9 o4 l3 }0 d" ]- p6 I8 y" J" R
def testkey(key)
. o7 f0 D } h0 B9 _ Key.call(key) & 0x01 == 1 ( `2 ]4 t4 M! R( g3 ]9 }: ~* Y8 `
end
. `5 B( @, [4 \+ d - c" k1 V. g+ h
alias hud_key_update update
% v) w3 m5 y/ Z1 G M, U def update
5 g* d) p6 b4 X1 } ^! G hud_key_update 0 M" O8 b+ p" D; {/ E2 I
@pressed = [] + v; x4 c3 M0 M, d$ p: W
for key in Numkey.values " h5 U* ?% G+ G: R0 H
key -= 1000
2 m. c, x* c; _* b( H# ?" J @pressed.push(key) if testkey(key)
0 h2 t& a9 l, y7 {4 u2 Z2 S3 X g end
! e4 l0 p" K/ r( i- a* I9 i end
2 i+ n) n( ]# r" S / Y' }! @( u2 b q
def pressed?(key)
& N0 o1 o5 K6 S5 u4 W key -= 1000
. @& W( H* k6 K: v0 ] @pressed = [] if @pressed.nil? 6 ^1 }1 S, O" w
return true if @pressed.include?(key)
# x1 h j. k, K6 C2 e$ h: L return false 9 V1 z+ H4 |0 b6 b' s
end
; B: |9 D( E3 g3 Y" ] 9 ^6 T1 }2 B* o
alias hud_key_press? press? ; K! E6 e! H, s- ^5 d! F/ p
def press?(key)
, f5 F) ]0 D2 |2 y return pressed?(key) if key.to_f > 1000
, W) }# _' E+ S6 o% s& q) K hud_key_press?(key)
4 Q$ m0 H0 q$ O4 A end . n4 A% D2 C- a0 W$ T5 v* _
end
1 ~0 f2 G8 L- e& qend
& Y4 M; r6 \4 o% v* w
6 l1 ]( ?. E( h1 [5 f#=============================================================================== 4 o) P6 t0 S9 j& \
# Game Player
6 H# M0 [! N8 g. e#=============================================================================== 0 ~& k; O& h V: `+ L
class Game_Player < Game_Character
; S9 j( [/ C! t+ Z1 `( N$ i5 r+ b' B attr_accessor :hud_equip
* a0 R8 G9 n5 D6 X& P/ c; h attr_accessor :hud_item_id
" Z$ a* B! m$ A3 o attr_accessor :hud_skill_id
$ C7 T) D% k5 ] E& _$ q8 l# p K1 g A2 m5 h& F+ T
alias hot_key_hud_init initialize & y7 I b: b- p+ t& g
def initialize
; d! Y; c5 W5 Y! U( x hot_key_hud_init
1 }3 Q5 x& u; W/ _2 s; r- ] @hud_equip = []
8 M$ O0 i' G6 e: B! e @hud_item_id = []
0 o8 l3 Q6 m* i2 S4 C- K+ w5 V1 d1 w @hud_skill_id = [] ) G' Q% B! h( H# G, Q }
end & a7 t: A- c' J- _5 E1 `. Y& b9 |! n
0 ^% a' @& ]% u6 [* _5 q* R
def equip_item_to_hud(n, item)
c3 w/ Q! s8 @ if item.nil? ) O* F/ x( x! i0 R3 B: r
$game_system.se_play($data_system.buzzer_se)
9 |7 u6 ?# t. N# }5 P return 0 l6 ~6 P& I; z
end - p. R+ d; m9 t; R
$game_system.se_play($data_system.decision_se) Y; _( C+ N2 j& @" i
@hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
6 E* @6 h: g* p& ^1 ]& ^: p @hud_equip[n] = item
$ m5 C3 \: L( ?0 E7 l @hud_item_id[n] = XAS::XASITEM_ID[item.id]
O2 c" Q5 K7 X0 e* O: g& ` @hud_skill_id[n] = item.id % O o# ?8 @$ R6 S- n
end % U9 w u# Q* H0 T7 [- a
end
8 s; g9 H: o% P, a' f- C
+ ~1 ?9 s8 z- q% T# o. j& T#=============================================================================== , r7 u. k7 ~ Z$ ?. t) |" p
# Quick Skill Window
" B1 o$ V. \8 R2 O#===============================================================================
, ~% k2 d; K2 W/ m" F# Fif XASVER_37 == false
1 z( a3 O' U* c# i, a1 z: S0 C. n class Xas_Scene_Skill " C/ S, \1 y( L- j
alias hud_quick_menu_main main
/ H9 x! p+ F# |# V2 h+ X def main
5 p8 v3 T% ]7 f) Q0 z3 {) s @hot_key_hud = Hot_Key_HUD.new
% H6 d7 b0 X' l/ N/ q+ |3 o2 [ hud_quick_menu_main + e+ I4 O) I' w; M- [0 z
@hot_key_hud.dispose
1 |; r: U! q3 O( ] end
2 y; [6 S, R l q7 T# v" V
# y, c1 c% l. R8 ^ alias hotkey_hud_qucik_menu_update update
3 J" y1 F( s! P) `2 D def update 9 B" j$ F3 `; s, ?4 X+ I: B9 q
hotkey_hud_qucik_menu_update 0 K9 z6 l H% P& h2 ^- A9 W
# Hot Key num 1 % C' E) t1 n% r1 F# d2 S& }
if Input.press?(Input::Numkey[1]) - t& }* X u- a$ T
$game_player.equip_item_to_hud(0, @skill_window.skill)
4 B5 e% ?5 w/ D! ] # Hot Key num 2 5 Z2 r& Q: U! x a# J& k* B- ?* G
elsif Input.press?(Input::Numkey[2]) - L( F# w$ [( n7 s) H. h3 U2 n
$game_player.equip_item_to_hud(1, @skill_window.skill) + X7 S, P h# C9 `0 R3 p% `" R! r
# Hot Key num 3
+ A$ @- \% _. O( I, a! O+ ~ elsif Input.press?(Input::Numkey[3]) " y# G( [' F( t
$game_player.equip_item_to_hud(2, @skill_window.skill) 0 g1 J3 p/ \2 X! T" i$ V' x
# Hot Key num 4 " U& E* s3 A/ `) p7 I: Z9 Z, g' ^" B
elsif Input.press?(Input::Numkey[4])
( |6 B) A2 l8 O $game_player.equip_item_to_hud(3, @skill_window.skill) " H' H/ i( `. V' l7 L9 f! T4 C
# Hot Key num 5
; f" b. u$ C9 |$ S9 C. T5 | elsif Input.press?(Input::Numkey[5])
% x/ @. r+ v0 m. L) Q2 S4 x $game_player.equip_item_to_hud(4, @skill_window.skill) 2 Y& t' g" T# I4 D- @+ g- ]
end 5 ]2 n b4 G2 V9 Z& _. ?5 V2 y
@hot_key_hud.update
& m d! H y" }+ \& p" m. m% Y end
; {1 [0 b3 U! W& N; X1 X8 N' F4 T+ k end
" ^- Z4 F+ q! Celse
4 v \0 ^6 Y5 k5 [$ L class Quick_Menu_Skill
9 A4 a" u/ c, m$ A$ _ alias hud_quick_menu_main main
9 r2 X/ I# a! O1 J0 C+ M" k def main - z% ~* Z* c: l/ v6 Z0 _
@hot_key_hud = Hot_Key_HUD.new
0 r# n* A9 B5 ^& T hud_quick_menu_main
+ q1 S" e0 L8 f* k+ } u2 g4 k, k @hot_key_hud.dispose
; ~3 M& L% c/ c( _( } end
* `6 S& S/ w9 _ F# e
3 L/ n7 ^- s4 k2 A alias hotkey_hud_qucik_menu_update update " q' Y9 i) I0 z C( K* X8 h
def update O* ~3 j. Y- a+ {2 h6 V
hotkey_hud_qucik_menu_update
6 K6 ]1 R7 [* ~ # Hot Key num 1
: `$ q- R& `6 H! ^7 Q; @ if Input.press?(Input::Numkey[1]) % r$ V! F5 m( J5 Q, d
$game_player.equip_item_to_hud(0, @skill_window.skill) 0 b6 n2 b0 ^! N& j& w
# Hot Key num 2
! ]* o7 [0 }9 ]7 N% { elsif Input.press?(Input::Numkey[2]) 8 B1 O- m0 J) A7 G) X% z
$game_player.equip_item_to_hud(1, @skill_window.skill) 8 R, \2 \9 R* g+ s0 V
# Hot Key num 3
6 R9 ^4 X2 [9 M$ x0 w elsif Input.press?(Input::Numkey[3])
$ s7 u$ N0 l$ W( X9 \2 b $game_player.equip_item_to_hud(2, @skill_window.skill)
, U3 H- ^9 c) V' l9 T- ?& o, J # Hot Key num 4 + Q3 ~- {; E+ v0 W. m; X* `
elsif Input.press?(Input::Numkey[4]) - }/ N0 n6 s+ ^: ?# t
$game_player.equip_item_to_hud(3, @skill_window.skill)
% F5 }/ U: Y) b6 f6 D* f # Hot Key num 5 : r" X# K& L B3 R, ]
elsif Input.press?(Input::Numkey[5])
^& P2 W- E& P; n, s$ Y $game_player.equip_item_to_hud(4, @skill_window.skill) : }; M" T4 B5 g2 f9 J
end 1 [0 [7 X" ~7 u1 `( k+ o
@hot_key_hud.update 9 h+ h- V! E7 V) n
end - H+ ?0 u8 P9 @* n; J
end
0 }0 m& b) D+ yend
( z+ X5 M7 D" F
( u' `! |, N+ N2 g+ t#=============================================================================== ' p" q! a) a! S0 O% E; p
# Quick Item Window
: `* X& n2 o) L, ?#===============================================================================
% C# b" Z" x, f) U1 Hif XASVER_37 == false
+ l7 X2 U/ H+ ~/ m) W6 S class Xas_Scene_Item
: h. L; t2 J3 M& f/ s alias hud_quick_menu_main main 2 n1 z x6 [8 y! ~
def main
; j C5 j" t3 C; K @hot_key_hud = Hot_Key_HUD.new
- e+ h4 T4 r5 e! @, R k- y hud_quick_menu_main
$ f; ^' Y# @0 c. I: C @hot_key_hud.dispose 4 E) v( O# S7 W5 k; t& H0 Q
end
) C6 ]2 u/ R: L; ^7 Z( A
4 k4 C& i! L9 z: }( g: l alias hud_key_update update - U" _0 ~& M% l1 I3 d* ?; F' M, L
def update . o' L2 z8 P8 v
hud_key_update
& w- `/ w! |0 T% B4 c' M # Hot Key num 1 + b: j) \3 U9 s' c2 ^+ g7 t$ M5 d
if Input.press?(Input::Numkey[1]) 3 g+ ]- y% t8 X
$game_player.equip_item_to_hud(0, @item_window.item)
% B* H# W0 L5 i, x$ ? # Hot Key num 2
4 `: K: ?# _' w( O. X: f; @8 f elsif Input.press?(Input::Numkey[2])
& V% u: ]4 l' @+ g6 r+ y7 D $game_player.equip_item_to_hud(1, @item_window.item)
4 F: D" B0 Y7 M+ |& n # Hot Key num 3 * K( T$ y& e/ M6 u4 N- @
elsif Input.press?(Input::Numkey[3])
1 l0 j. b0 P4 }$ v1 r4 ]% O $game_player.equip_item_to_hud(2, @item_window.item)
. o& v3 z& T G # Hot Key num 4 $ a6 g& w& c6 V% G) @/ L; v
elsif Input.press?(Input::Numkey[4])
$ B! W3 n+ @) W# f' e% I. j8 F; B& e $game_player.equip_item_to_hud(3, @item_window.item)
- G l8 w, B i0 p8 e$ M; ~ # Hot Key num 5
$ c: p. V; s& _ W+ n% z+ w }& e/ w elsif Input.press?(Input::Numkey[5]) & T2 c& X+ [( D
$game_player.equip_item_to_hud(4, @item_window.item)
4 O" F0 @ P* {+ b- Q end
/ r, L! y, K h& } @hot_key_hud.update
, d' [9 o) l1 e5 o8 d end
9 A3 v% j% Q) {( u" u! x end ) P/ N d8 f( P7 M1 u) s0 ~! X
else
! d# i. C5 U: O class Quick_Menu_Item
$ S3 P& n, d% J alias hud_quick_menu_main main
$ \; e+ j6 v; s, c% \' q! p8 l# x def main
$ r$ b1 x' N" U4 `4 a @hot_key_hud = Hot_Key_HUD.new ; e* f* ~. ?5 g7 v
hud_quick_menu_main
2 \- w( A$ n: i8 N, O @hot_key_hud.dispose
& I! L- @2 ]) X/ ~0 ^ y end
6 Y# b8 B( z3 p- _0 C4 ]5 }- D
; M* P9 |8 p9 { G# V alias hud_key_update update F1 ~+ K1 y* C+ C2 l* \8 E
def update ) p( b' C( X: z6 J6 X+ D* o* C, D
hud_key_update
, z) P; D. e% s7 H$ x5 F) g4 x4 J' r # Hot Key num 1 ! b3 a# p0 ^% J1 q9 z% l0 R3 v4 C" w
if Input.press?(Input::Numkey[1]) 1 ?( p; M# \* P' R! D: n+ w
$game_player.equip_item_to_hud(0, @item_window.item) 1 q& B6 p/ y& h' t8 c0 M
# Hot Key num 2 * k% k N% c, f% B8 Z
elsif Input.press?(Input::Numkey[2]) 9 `8 T; |$ }$ R( r2 f' Z* z& s
$game_player.equip_item_to_hud(1, @item_window.item) / [! d; k& F- c, J B7 w& v
# Hot Key num 3
5 z0 Q, P7 T* d# V% w) C elsif Input.press?(Input::Numkey[3])
9 {$ o7 P( W& k/ `% x: J $game_player.equip_item_to_hud(2, @item_window.item) - s2 m6 ]; a( d& z; }; s
# Hot Key num 4 1 j' e5 @/ D! @# l' T
elsif Input.press?(Input::Numkey[4])
# c* |6 K9 p& y& x, { $game_player.equip_item_to_hud(3, @item_window.item)
9 x2 d) n" x- ^8 ~4 c, ?% s # Hot Key num 5
7 e8 R/ N) ?- [1 Z6 H4 X/ I elsif Input.press?(Input::Numkey[5])
" ~$ E. R; Q: \# r: t6 G# ] $game_player.equip_item_to_hud(4, @item_window.item) - I) B; J( h9 c3 `) p# m, f
end # Y7 G2 r. Y9 ]# L5 S0 Z$ W
@hot_key_hud.update 1 z V4 p' J( H+ o
end
3 D' R9 Q, K. Q" t end j7 D2 _% l% S1 Y
end
2 Q/ C& ~( \+ g+ q2 K . v: K* m: b' [! `# u" q3 _4 s
#=============================================================================== 4 g* R- F9 p2 u
# HUD Window % J) g- a8 S* Z5 a
#=============================================================================== * @/ \2 w* Q7 o1 ^7 d2 c
class Hot_Key_HUD < Window_Base
, r* f7 _9 _# y$ g( g) W J' i1 f/ z def initialize(x = HUD_X - 10, y = HUD_Y - 15)
1 m( C# ~8 D$ V% X, W. c l# n super(x, y, 220, 80) . \; L Y9 f5 X9 |( u, K
self.contents = Bitmap.new(width - 32, height - 32)
" I( ^9 i2 Z- q4 q$ H( L) ] self.opacity = 0 " r* o1 H% y/ d$ F. X6 `
@actor = $game_party.actors[0]
7 a: N' j' Q! f. ?: z$ W* o refresh 9 G4 w8 ], a" G6 s: [
end " ^- W, c( j- _
" m4 N8 P0 r6 g0 y i
def refresh
" ~ ], m0 K- L- g self.contents.clear
- Q, M/ u& L- Q& V5 E bitmap = RPG::Cache.picture("Hot_Keys_HUD") $ [' R4 g9 g8 n( s
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32)) 9 ]7 L" |1 W8 i; v5 n/ U
for i in 0..4
8 ~4 Y6 H- C+ S x = 32 * i + 4 9 _" p: E0 g5 U) G
item = $game_player.hud_equip[i] 9 Z4 }' |& {, ?6 U- X2 s
next if item.nil?
9 q7 N% S9 e1 c if item.is_a?(RPG::Weapon)
* [" G) a9 @2 K6 l item = nil if $game_party.weapon_number(item.id) == 0 and
+ h) F! ^' R- a1 |+ G @actor.weapon_id != item.id ' {. R% D; D! Z
elsif item.is_a?(RPG::Armor) + ~7 [! a6 |* l, G3 p" T7 y( e
item = nil if $game_party.armor_number(item.id) == 0 and
% W2 x. S' C$ R1 P7 w0 w @actor.armor1_id != item.id
4 N/ h) K! p: D4 ]0 g" ` elsif item.is_a?(RPG::Item) ! T: A; w" C. Y! h; Q
item = nil if $game_party.item_number(item.id) == 0 or
0 I/ E( b% Y7 ~ !$game_party.item_can_use?(item.id) 1 A5 }2 ~1 ~# l8 J* n6 B
end
/ h ]3 h$ q, l# H bitmap = RPG::Cache.icon(item.icon_name)
" {9 z0 ~" w+ ?7 ` self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) - @* l4 U2 n# N$ H7 S
end * @2 Y/ O" w5 Y( O+ h4 b% p
end 8 k8 x8 f% L3 Q) U4 @
- l9 b. u' `$ y" E4 L% p def equip(item) 9 V5 b1 s2 Y4 l& a) d
if item.nil?
$ F) L5 S- d: Z- E $game_system.se_play($data_system.buzzer_se) 5 G1 y1 d8 x: ] @, w$ Y
return
0 e0 k4 I% X- E% F% R3 R end 1 a s( u9 y$ E, A. _ Z- [
if item.is_a?(RPG::Skill)
* h0 t, R% U. ? if !@actor.skill_can_use?(item.id) 9 u$ z5 Y/ F p4 H. K- R% A
$game_system.se_play($data_system.buzzer_se)
4 f A4 E( Y+ T return ' G5 e, m1 u* U! b( d/ N! t9 x/ Y
end
% R5 e4 ^4 ~( ~+ R) H #$game_system.xas_skill_id = item.id 8 f7 K# H) a; m9 S
@item_type = false 5 d/ j1 s* j% X
elsif item.is_a?(RPG::Weapon) / Q0 p" W+ v1 p, x8 Y; |
@actor.equip(0, item.id)
3 H6 v) |0 c. [0 f6 M elsif item.is_a?(RPG::Armor)
$ T5 `/ I* m. m' u; G; s @actor.equip(1, item.id)
9 J; V1 r% G) \! d( m elsif item.is_a?(RPG::Item) , Z8 i" w/ w+ q4 C1 s- p. q, }( Z
item_tool_id = XAS::XASITEM_ID[item.id]
$ V, w& g/ h2 }6 L if item_tool_id != nil
' E5 c5 a! E2 P+ a+ P, ? unless $game_party.item_can_use?(item.id)
9 c8 S; i+ ]$ h% J( V $game_system.se_play($data_system.buzzer_se) . G) I+ x5 i$ g: ?
return
7 o, a- D% ?( U3 b# z0 A end . H# z4 ?7 V" o1 I! ?8 R& T0 Z1 C4 ^
#$game_system.xas_item_id = item.id
* G' ?* o9 B* N2 _" D @item_type = true
[! m2 G! {7 R/ c end ( G7 j8 m& @! `, q" _
end 8 f( E) {# T% O& Y' w( N' B
#$game_system.se_play($data_system.equip_se) 2 b& O4 Y4 r/ x$ s
end 0 d* V, n9 f- \
1 Z7 K4 Q' f$ @% ?' p# w0 w def use_hud_item(i) 4 Y3 @" D/ d1 r# b2 z
if @item_type " D* c, O* c. N) w A, `$ b
$game_temp.force_action_id = $game_player.hud_item_id[i] ( ^$ u4 f0 `& z) D- |; Z* d
else * I/ i8 U7 ?3 ]- W0 R
$game_temp.force_action_id = $game_player.hud_skill_id[i] ! G3 J, k# ] v- b
end
6 q$ w' ~3 N6 x end
, ]3 W" a6 B& w' u E+ q5 s+ b/ `* [5 d
def update
) U+ z6 b1 a$ }3 C% _3 @ @actor = $game_party.actors[0]
1 T& n- t X0 T+ @9 ? @hot_keys = $game_player.hud_equip
. g* R+ {/ @* |( ~ refresh
" P; x# r" t6 r+ K9 a! @ return if !$scene.is_a?(Scene_Map) ( q3 x7 s1 b- x( h. q. Y
if Input.press?(Input::Numkey[1])
4 o5 Y5 ]( g# u9 u equip($game_player.hud_equip[0]) ! ]9 c* h" r$ s; B* D
use_hud_item(0) 7 K+ b) y$ M: q( C/ m
elsif Input.press?(Input::Numkey[2]) " e" l2 h: q+ L# K) y# a6 u- V
equip($game_player.hud_equip[1])
6 r( Z9 ^; X, u) H use_hud_item(1) ; u% g4 x" c7 X: u) m
elsif Input.press?(Input::Numkey[3]) $ p* j* ~6 Z$ @2 i4 }
equip($game_player.hud_equip[2])
) ~- U% C$ g" Y: D) P: _4 G5 B use_hud_item(2) : V0 h$ a" o- l9 P6 O
elsif Input.press?(Input::Numkey[4]) & a+ r: j8 z7 o& s- ^' `
equip($game_player.hud_equip[3]) . l9 w# T; s8 R% e% o
use_hud_item(3)
. m% m9 G; J% V, J elsif Input.press?(Input::Numkey[5])
: {) p+ u) `# q! G+ N equip($game_player.hud_equip[4])
( {, Z b- r! c2 N- X* ^$ U( e use_hud_item(4) ; U& p) p# D7 J# I" c/ S
end 3 P- Z: v2 A7 V, ^4 t. E
end 2 L+ P7 Y# d5 T
end # ^, G4 P" _% H; F
7 g% h2 y: ~! @' ?: ~' [
#===============================================================================
, G4 D: G0 q) E9 X0 P' p# Scene Map ( X7 Y9 {- D( i2 [( h
#===============================================================================
6 f. c% Q$ H1 z3 Q. g1 M- Hclass Scene_Map
4 L" [! A" O' q7 E7 X( i alias hot_key_hud_init main & l" ^8 A9 r" g9 D
def main + N' Y$ l+ L5 X& H) C6 V
@hot_key_hud = Hot_Key_HUD.new
/ Q4 [6 y$ e* Y6 k: j/ e @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] ) ] }0 r( T; E3 f. ?7 T
hot_key_hud_init 2 ~3 u, m8 J& D0 u0 x
@hot_key_hud.dispose
! ^' p5 d& N9 U- g" v. a; V end
+ J2 s0 {0 r. h( n
$ W, n! x' j& `! J" l alias hot_key_hud_update update
" |) w9 C* l2 N def update 8 o m& `* ~# S- c5 ~8 g }8 b
hot_key_hud_update * _6 W' c. A% `6 ~
@hot_key_hud.update 5 _9 I. @) e' V
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
! v3 N3 K t' |2 |& E: G# f) |* w# r @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
' ~5 `, R" n1 G% g8 H/ P end
- c' i( [' }7 u- y2 @) {& Tend 9 G6 E M# s" G8 [) N o
|
|