赞 | 0 |
VIP | 15 |
好人卡 | 21 |
积分 | 7 |
经验 | 24727 |
最后登录 | 2021-10-29 |
在线时间 | 2184 小时 |
- 梦石
- 0
- 星屑
- 672
- 在线时间
- 2184 小时
- 注册时间
- 2009-12-6
- 帖子
- 607
|
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑 - |3 }. Z& \3 R9 |4 A* T z- Y6 h/ G
0 w. X. F* Z9 ?7 Z9 T
在Extra Skill里按1~5是设置, N' r" Y1 a o6 i7 ^- {
设置好后回到地图按1~5就是……切换。1 { {3 F5 T. D2 J$ I
& ^! u- t% G* M. i; ~+ U* y+ B1 e请问是要改成直接使用吗?0 |8 ]% t/ _( Z& T+ }1 H
E; j" j: f3 i+ S
那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。) r: V5 Y2 I9 _ m
#=============================================================================== # 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
#===============================================================================
+ I5 j( i$ m4 O6 K I# XAS - Hot Key HUD $ v# f2 t5 [' D7 ~& d/ X# R1 n9 a, k
#===============================================================================
# C3 ?) Z5 D3 @. H4 I7 n9 Q0 K4 J# By Mr_Wiggles
+ m G, f7 d: c+ r7 r5 }, f% N# Version 1.3 # M( k( }+ p* j: Z' ]9 H
# 7/6/10
* j/ d2 J, r+ z+ }. g#------------------------------------------------------------------------------- , `9 l; y) D: _& k
# Instructions: % p7 E, k: y9 z
# Fill in the constants bellow, paste this script above main and bellow XAS in
! c$ i2 V! \5 h% _# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
' ?1 L9 N- K' H: k2 B#
5 C/ [ o# \$ x# Place the "Hot_Keys_HUD" picture file into your game directory
0 w) _3 E3 b( d; s# Graphics/Pictures folder. , q4 k. g0 w9 l, ~) z/ K' b
#-------------------------------------------------------------------------------
* `9 y% ^9 `) b2 i. D% l/ I- X1 o# Directions of Use:
+ s. M) g( O4 |5 Q# Simple just press a number key (1 - 5) when the quick skill or item menu is ( @ ]- P4 R8 M# V/ a- n# V- q7 z
# Showing. . b3 X$ U7 i' e+ ~$ }* ~
#===============================================================================
; t, U6 `' w$ h( m9 ^: wHUD_X = 0 # X pos of HUD
% i" T* l# B/ E: C1 p$ `' UHUD_Y = 0 # Y pos of HUD % a4 N0 b. y6 ^3 Z/ [4 L
XAS_HUDDISABLE_HUD_SWITCH = 1 . @* c5 E2 `% r: k
4 _ w* V/ A* \% K
# Set true if XAS 3.7f
& e* [" z/ Z; x- h; {' ~3 F# set false if XAS 3.6 3 t$ q: X) B- t! \! G2 J' |
XASVER_37 = true 2 J% Z6 {. s5 g
; |' p* }3 H+ d& d% M/ x0 Z
#=============================================================================== 4 c0 `; z+ Q' F
# Numkeys Module
6 Y8 E# R) B% _- b+ F! n#===============================================================================
: ?) R- R4 g& o- Cmodule Input
/ G" c& ?) K* v" L8 ~ Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053} 9 O$ ~2 q" p& x0 x4 B/ \" @
class << self
' B5 z- X4 }/ |% G! g Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
; |5 i1 i2 [( k2 R
7 y9 G& [) M- F7 x def testkey(key)
8 D! g+ H4 e& U9 Z Key.call(key) & 0x01 == 1
& U- G1 P' u0 J: B end
) Q. V, Z' ^9 U; l # ?* R- `, x: Z8 m1 h
alias hud_key_update update
, Z" y4 }8 n5 \# f, w- T def update , e4 s* y0 C- p# B+ j5 z! l
hud_key_update 7 E6 P+ Z, u/ z8 y2 _4 O& G
@pressed = [] 8 z$ F- v. D6 F- s
for key in Numkey.values
+ h' t5 X$ ~5 ?! f1 O key -= 1000 . l) Q% @ E* x I7 b* E( L3 g
@pressed.push(key) if testkey(key) 7 M% \6 Y. H( h: Q' f6 h0 s" G; \9 x
end
% e2 r) @1 g/ r9 j& u4 m$ L; p( @ end
! u2 a3 G' Z- O6 d& d
7 n5 `0 }; K j1 w: } def pressed?(key)
1 G3 L' { I. Z3 @4 ^/ Z key -= 1000 , [9 r+ N e q# {+ l8 D0 R" J) i! Z
@pressed = [] if @pressed.nil? ) C6 l4 D5 M* ?7 U3 J* ^% |
return true if @pressed.include?(key) / }, g8 \& q( B. i7 c" C' Z$ B6 |9 D5 k
return false
! n' s( F! y7 G* F% Y end ( f6 q; X2 Z* ?' b
5 q- }, c1 X+ d
alias hud_key_press? press?
2 Z& c/ s3 z2 e3 ]! {& n def press?(key)
1 ]. k& Q" F7 N g$ {! X/ v9 ? return pressed?(key) if key.to_f > 1000 4 {6 }, h5 E( Z( _' f H7 T
hud_key_press?(key)
( M& [, D; e/ D, I& j3 P3 p! f2 p end
1 L5 t* f! _6 m, t1 L' B' W) r end
6 A. ?7 i7 V9 _/ u, y" fend
( O# ~# f4 @4 q4 @& w$ t
9 ]; i2 V% y4 s# G/ v" P' ^#===============================================================================
* j) l% F$ Y$ U0 Z0 a7 ]$ F# Game Player - m: l( t0 D ]$ ]3 [
#===============================================================================
. r5 P9 v. x' m3 d8 ^8 Fclass Game_Player < Game_Character * y% M0 r" A5 e+ E
attr_accessor :hud_equip
0 H: S: M! f8 O attr_accessor :hud_item_id ) }. n4 M$ T) f& d7 s2 I
attr_accessor :hud_skill_id 2 e! a6 e" P3 s `8 @" w2 {
: o( Q5 T$ I# k5 P% z* x! Z1 s
alias hot_key_hud_init initialize 5 y6 q" N0 u7 x# O N: b
def initialize 5 s( c' l! z4 a
hot_key_hud_init 6 b% ?, o/ x$ R& N% m1 {" D
@hud_equip = []
' u$ l! n1 u: z @hud_item_id = []
6 @7 |/ `4 }5 N: }1 W7 T @hud_skill_id = []
/ B3 o) \- s0 M8 k end ! Y- X( V j' Q" @
8 c: W' Q1 P j6 ? def equip_item_to_hud(n, item) 6 J9 f+ i& z" b& ]" ^
if item.nil?
8 a, U0 ~( b5 \. y# {3 m, s $game_system.se_play($data_system.buzzer_se)
; o9 I$ B# [- }& s# v4 b4 s return
& a0 @- g2 I/ [- ~4 F end ; B4 p$ U9 U5 j7 {
$game_system.se_play($data_system.decision_se) , [% `' u, k% B5 d
@hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item) 0 o+ W9 M, U9 Q8 T) T
@hud_equip[n] = item
) i- F# t2 e: _! q0 R4 f; @! g6 N @hud_item_id[n] = XAS::XASITEM_ID[item.id]
: V1 u: W/ }( K! H @hud_skill_id[n] = item.id
" z" _ e# _( A( t8 i2 Z: Z end
: Q8 ~+ ~6 j% b$ {' i3 I& A6 nend
; k, M5 U7 ~9 ^. u6 t, Z$ R " {& p* Y/ m% a
#===============================================================================
1 l) i1 W0 B; @8 V# L2 ]+ X# Quick Skill Window
& U3 L1 h" p" e* z* B: c/ M#=============================================================================== ' E' O& c" L" q+ Y5 O5 j& f
if XASVER_37 == false
. k9 y1 G) D& d class Xas_Scene_Skill
6 o& J, v9 K, ?8 Q* ` alias hud_quick_menu_main main
8 K2 h+ n1 w0 J3 c8 ` def main : B5 ^1 a% V3 a% }3 f+ F, F
@hot_key_hud = Hot_Key_HUD.new
- M+ Q' x" C4 \: h V4 {5 P hud_quick_menu_main
! z* F/ i( u* g5 a/ w$ i4 t6 a5 Z @hot_key_hud.dispose $ j2 S4 j/ }' ~# C, |
end 5 ]* R% T7 i3 l: _$ u) J, w( k) A7 R: u
! |/ }! t5 @1 X& \ alias hotkey_hud_qucik_menu_update update
& n5 \$ p% W4 C" w! |7 M! S- X def update ! a/ z8 h' H' [/ y& `+ ], c
hotkey_hud_qucik_menu_update
( ?- i7 q9 L- S; o7 b/ z2 q; h # Hot Key num 1 7 J+ Z9 P) l' {
if Input.press?(Input::Numkey[1]) ) U2 t! x5 n6 u3 D4 ~9 @& U+ A, O3 f
$game_player.equip_item_to_hud(0, @skill_window.skill) 0 o' x9 {4 v# F0 E# E5 |& I
# Hot Key num 2 0 Y y; O3 d) |* H
elsif Input.press?(Input::Numkey[2])
. F! H; q; ?: ^. c0 K& z $game_player.equip_item_to_hud(1, @skill_window.skill)
7 e" o0 z1 G, v% m. Z5 {" C) Z, f2 s # Hot Key num 3
$ `$ ?" b) K* o4 V elsif Input.press?(Input::Numkey[3])
% a9 D- {7 L& B6 N* S $game_player.equip_item_to_hud(2, @skill_window.skill)
6 e1 O w8 d# K( b # Hot Key num 4
$ B' ^9 y- P/ u I3 ~$ M7 Q8 ^$ c elsif Input.press?(Input::Numkey[4])
' K+ C. U- J! Q9 @ $game_player.equip_item_to_hud(3, @skill_window.skill) $ j$ L% C8 k7 F
# Hot Key num 5 " L3 [( m/ R9 ~% v- O
elsif Input.press?(Input::Numkey[5]) M% |+ K) d; K7 ^3 R' J
$game_player.equip_item_to_hud(4, @skill_window.skill) # u6 \8 O& B8 `5 Y+ {
end 3 W0 \# Y3 k1 A0 j% y+ G7 P: R
@hot_key_hud.update
% _9 b8 i2 @# X! n& k end 5 F& H7 g, u. a- B0 g; h
end
) \" b6 `! u. V+ E m& felse , r5 A7 j3 j' }" h7 L1 H/ A2 K
class Quick_Menu_Skill
6 ?5 F+ w, _0 X: X$ x7 ^" ~! K alias hud_quick_menu_main main ) j0 _" p5 E7 ?" n; S; g2 D
def main
+ T1 _. X8 C, V5 X% q @hot_key_hud = Hot_Key_HUD.new
5 R! Q, X7 e9 {2 ?: _9 D hud_quick_menu_main
! A1 c4 D- @) n- i @hot_key_hud.dispose
* o# L, L! }' ^ end / n. `$ ^" V' m6 v( s/ J% y2 \
4 S5 }1 ^& m2 O- v) E8 C# w
alias hotkey_hud_qucik_menu_update update
) G0 ]2 J6 {. f. x5 `6 V* e9 r def update 7 `4 q( p4 j' b H/ ]# O
hotkey_hud_qucik_menu_update 9 V3 N" A& N6 x
# Hot Key num 1 . ~4 Q" |! O1 P$ Y! O# \' ?; ?7 R
if Input.press?(Input::Numkey[1])
# w( f6 [: c& ~& k" J/ Z $game_player.equip_item_to_hud(0, @skill_window.skill) ) [$ `/ v: q# k- n3 M; A4 I( ]
# Hot Key num 2 3 i5 R2 ?: g" W8 B8 E
elsif Input.press?(Input::Numkey[2]) ; J4 e/ K1 I$ {- g" o( x- K- l
$game_player.equip_item_to_hud(1, @skill_window.skill) . l/ k* _/ p$ z: {2 b
# Hot Key num 3 3 Q4 h+ T8 a2 t, F" |* K7 z
elsif Input.press?(Input::Numkey[3])
7 z4 r, ~% @* H1 Q: r- j7 r $game_player.equip_item_to_hud(2, @skill_window.skill)
! `9 o; z Q& M# G # Hot Key num 4
/ Y( F* e) {7 p2 x; \' [, `% ]# _, l elsif Input.press?(Input::Numkey[4]) 3 d( r0 h0 y( U1 f1 Y, t6 L! j' g
$game_player.equip_item_to_hud(3, @skill_window.skill) ; X' G- n0 T- Y, p# s8 i
# Hot Key num 5 : U& H6 ~6 B) {% \) X8 z1 U
elsif Input.press?(Input::Numkey[5])
/ Y2 S* I/ q+ F6 ]' n $game_player.equip_item_to_hud(4, @skill_window.skill) . W) y3 x; I& ~
end : ^! g1 B; U" f8 \, g' D
@hot_key_hud.update % \4 `3 _" P+ [3 |
end 0 h X. {: i4 s* r4 [; x
end 0 a7 t. k& G& q% z( L) O1 U
end
+ `1 X, D# L9 Z8 I
$ i' w$ j" z, y' `$ B#=============================================================================== - J7 J4 c% l" Y/ U z6 l* ~
# Quick Item Window ! }: L9 F+ g, j* {: k
#=============================================================================== 2 f7 a- t& K& F k9 {5 E
if XASVER_37 == false
/ `: s2 Y) _) t5 M5 B9 \% C! S% I class Xas_Scene_Item
. ~; E2 z- w9 O5 o alias hud_quick_menu_main main : C% W. g, I& r( D4 c# A' i$ F
def main 8 F% G! U9 J3 _" G$ f# W
@hot_key_hud = Hot_Key_HUD.new
: B+ X: M9 G6 B4 W8 ^ hud_quick_menu_main
1 \+ }* i7 D6 U, ]) I% K: } @hot_key_hud.dispose
! N+ P: O) e3 ^( W end / L" s& L2 G/ N8 {# h( L( ]# [& r
9 S( c6 s3 o- |) a# V) J! p alias hud_key_update update
7 x. R; N. ]6 ]9 |( p" Y4 _. c! J1 r9 { def update
+ K/ k/ @9 a, P4 e hud_key_update " C/ h0 j. O) P7 Y! `) F+ }2 U
# Hot Key num 1
# Q0 \) F1 L$ Z2 Z if Input.press?(Input::Numkey[1])
8 I* W) [; {$ s K+ X $game_player.equip_item_to_hud(0, @item_window.item) $ X' |, H& E/ a. g( o
# Hot Key num 2 $ z* ~' r8 W0 Q% d
elsif Input.press?(Input::Numkey[2]) , R6 I- h H8 {( `, j
$game_player.equip_item_to_hud(1, @item_window.item)
' a% S- f6 D5 J2 ?( x # Hot Key num 3 8 Z0 O) U4 N: E! F3 [" {9 K
elsif Input.press?(Input::Numkey[3])
: U2 D: d) p! L. h, | $game_player.equip_item_to_hud(2, @item_window.item)
) D) h. \: Q { A# R" e; S # Hot Key num 4
* T: U( J' v+ o9 r4 m elsif Input.press?(Input::Numkey[4]) % z/ P0 e5 p6 E3 u/ I7 T- ?
$game_player.equip_item_to_hud(3, @item_window.item)
/ |0 J: c% t+ T$ | # Hot Key num 5 * S+ x* _0 N4 j/ {& F
elsif Input.press?(Input::Numkey[5]) % R5 ] c$ L' }1 H# Y- i) B5 f
$game_player.equip_item_to_hud(4, @item_window.item)
# V7 a1 s4 Z9 w* i, H$ W end
2 A. M$ l6 v+ y: c @hot_key_hud.update ( ^7 |# u( k C; k& I% ~
end
7 d( X9 |! D; [9 a* ]6 K end
X5 Y8 p+ A# q1 W: _3 Jelse
: ~& e9 b% s7 t8 ]( }+ [. O& V class Quick_Menu_Item 8 ]: N/ V: o, Q, K# U+ C+ k5 b
alias hud_quick_menu_main main % z- T8 e4 I+ }% t- ] i: w& y
def main
: ^) l/ p* d' a [5 G! A6 m @hot_key_hud = Hot_Key_HUD.new
' E/ Q3 k3 y+ u4 X5 m' L6 Y hud_quick_menu_main ( b- i9 O. {+ P. w, m$ N; K
@hot_key_hud.dispose
) w" j: G) h5 T! ~ end
) ^7 }, i0 R6 d% h$ w) X a 0 C( g9 @ K/ n' J2 |8 r+ }. }7 w
alias hud_key_update update ! b& I2 B9 n6 f7 R! {, d. ~2 `- P
def update
/ [2 g. q u8 O" ?; T" _ hud_key_update
8 \& _1 E/ `0 t* {( \7 M L# C # Hot Key num 1
. T- l* R+ s1 K& ?) _/ Q if Input.press?(Input::Numkey[1]) ) y2 n1 j. ~1 J9 z* z
$game_player.equip_item_to_hud(0, @item_window.item)
% q0 u n* t2 a2 \2 @" L# H # Hot Key num 2
J/ J3 l7 a/ G% X' M elsif Input.press?(Input::Numkey[2])
5 d0 j8 i( [, }6 u* ?. O& R $game_player.equip_item_to_hud(1, @item_window.item) 3 z& S R r' ~* J
# Hot Key num 3 # j3 M" h$ @* X7 o* K7 f% ]9 M% B+ j @4 }
elsif Input.press?(Input::Numkey[3]) / p: \) n) F& F& V4 F1 e/ T
$game_player.equip_item_to_hud(2, @item_window.item) ) k5 T g p# n; Y8 M. S4 \
# Hot Key num 4 ) N0 ^& h9 h4 N% ]. |
elsif Input.press?(Input::Numkey[4])
L3 m, v: I0 O $game_player.equip_item_to_hud(3, @item_window.item)
& H1 `/ k1 r W( m # Hot Key num 5
) S& b4 c9 m+ I) r' n: @ elsif Input.press?(Input::Numkey[5]) & H7 a# i- z6 q! r
$game_player.equip_item_to_hud(4, @item_window.item) & e0 J, _. I" Y% D! s
end
! e2 |5 h, Z5 Q! W0 D. g1 j. s @hot_key_hud.update
8 B7 Q+ L$ W; l& M h9 I end * e2 T! ?6 y& w
end
: O, u: l% `: A! l1 _end $ z6 N: }, W# x. G; h
4 R8 z! {7 N6 f8 s#===============================================================================
# c, l h0 R9 }* Y- |; t# HUD Window
3 M! C! ?$ w& B. {7 B- P+ `' v#=============================================================================== ( b% K4 Y ^- o8 W9 I
class Hot_Key_HUD < Window_Base ( K" E; I, L% a* f" y
def initialize(x = HUD_X - 10, y = HUD_Y - 15)
5 x/ ]/ l4 m9 N$ M& n super(x, y, 220, 80) 0 M- q/ @8 T8 d0 W8 k3 M( h
self.contents = Bitmap.new(width - 32, height - 32) 5 Y9 ?, R; D/ j O2 ]
self.opacity = 0 9 t C# L: |6 J; d* A4 O. ^2 H+ p
@actor = $game_party.actors[0] " h6 F* T) D7 S; i9 d$ a. ]
refresh
1 a) _4 Y# n; n2 p1 } end
# G5 `: i6 \9 I
$ P9 W& A, D6 y3 B: T( c1 D8 y def refresh ! m2 G v. s) S
self.contents.clear
( f4 N/ n8 Y! ]/ a% V bitmap = RPG::Cache.picture("Hot_Keys_HUD")
+ F* h/ A0 Z1 Z5 c" S1 I self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32)) $ s7 ], l1 Y5 T4 i* P
for i in 0..4 + @! Z( a6 v$ `" U" C `, ~1 c
x = 32 * i + 4
+ U: V# t5 z9 D/ Z item = $game_player.hud_equip[i] * L8 |0 r# c, K3 `
next if item.nil? $ o( l% |( W+ o2 Y4 } C% C; D
if item.is_a?(RPG::Weapon) ( w8 g+ ^1 d4 [: d
item = nil if $game_party.weapon_number(item.id) == 0 and
: \% w5 K: A, x5 Y, N9 L6 W @actor.weapon_id != item.id ' e% K- q# S3 Z- S4 b: \ J8 _
elsif item.is_a?(RPG::Armor)
' H" |5 c8 d8 r. J, Q, w7 U item = nil if $game_party.armor_number(item.id) == 0 and ; l8 N9 n( r# ]. a/ g0 ~0 e* Y
@actor.armor1_id != item.id
6 G, l% x; g# Z2 T" P elsif item.is_a?(RPG::Item)
* u) S; L: Z" @/ ]) ?8 d/ j8 F item = nil if $game_party.item_number(item.id) == 0 or
( `, l" u; \. y5 j; t( _ !$game_party.item_can_use?(item.id)
' m1 q9 M# O4 g: _2 j( Q end
+ G; A B0 p' x" \' ?6 X bitmap = RPG::Cache.icon(item.icon_name) : ^; ]* D7 p5 [' E0 y
self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24)) * n" N. ^! h4 f/ d$ N. m' m
end ( S( u% P- w/ h6 a6 C* S
end 5 q7 c4 K6 G {
" H" g% g* _, I8 ~$ J2 o' l% k$ D
def equip(item)
2 a7 Q+ S) ]0 B" K; f$ K if item.nil? % ^' U2 u3 ~+ P( t! v
$game_system.se_play($data_system.buzzer_se) & Y$ z# U" u2 h# t/ [
return ( v7 \4 \7 ~7 D8 C$ I0 Y" C
end 9 V; {9 c& D% _& P5 R6 |
if item.is_a?(RPG::Skill) ) o6 f2 t7 h; p4 F; m
if !@actor.skill_can_use?(item.id) 0 \ n3 L. E, m) F, g5 n! X; q4 o
$game_system.se_play($data_system.buzzer_se) ' o8 F' K0 {6 Z
return
D9 u$ c' |1 {2 O end
9 ]! Q6 ]6 {8 ] #$game_system.xas_skill_id = item.id ! L8 |% P! [( D0 i
@item_type = false
# N( S& _: v% Z. \- s& U4 |2 G elsif item.is_a?(RPG::Weapon) / t: `. @& a% I- }; B
@actor.equip(0, item.id)
) k! X: G+ w# x2 W elsif item.is_a?(RPG::Armor)
* F& ^ A8 R9 q2 b1 t: g @actor.equip(1, item.id) i! E5 I; P7 ^$ Z6 E
elsif item.is_a?(RPG::Item) 5 L% Y! E# F/ q- K5 H. }
item_tool_id = XAS::XASITEM_ID[item.id] & G+ t$ g! Q' h" P* @, {
if item_tool_id != nil
% T. E" n9 _4 S5 V unless $game_party.item_can_use?(item.id) , y1 l1 H- R1 s) v: w/ m; \; b
$game_system.se_play($data_system.buzzer_se)
! A$ J7 f" V3 R return ) R2 E# e" \, ^* p
end
( u1 ~: V1 n- j, H4 ] #$game_system.xas_item_id = item.id ' M5 q/ [* ]5 Z) u* B
@item_type = true
0 L" t N4 r3 x" o end & T& s( q; a) A3 c+ Z! c
end
/ O" q" ?' N5 U: x5 G* M# S4 V8 \ #$game_system.se_play($data_system.equip_se)
1 D% ?( E9 S, D* f/ ]9 S. T end
. K- ~% J2 J4 E! J " Z4 ~. s* f( @ L
def use_hud_item(i)
F4 R9 I/ U, r$ ~& K4 u if @item_type
/ n( Y- e# R3 m* F1 i/ l- \% W: Y) l $game_temp.force_action_id = $game_player.hud_item_id[i] 7 u* G8 P5 F! W$ c$ k
else " Q8 q3 W" g3 c: }+ B# N0 t
$game_temp.force_action_id = $game_player.hud_skill_id[i] $ e$ w7 G9 f) O0 g( v% B
end
& m& _% ]+ I! y) l9 l& J end
6 a2 V' n- R* R) h1 R
( g' C3 H2 q" q @2 n) k* I1 ^% J def update
$ l3 q$ j m, P9 N4 H @actor = $game_party.actors[0]
! w: r0 R* G! M6 t @hot_keys = $game_player.hud_equip
+ U# V' t6 B. n5 U$ B+ c refresh 2 L- }$ y/ n( U- I- U3 ~5 t
return if !$scene.is_a?(Scene_Map) , d/ D: d2 g h J7 F
if Input.press?(Input::Numkey[1]) - i2 W" l0 y- X: ]/ V
equip($game_player.hud_equip[0])
. b2 E2 c# u6 Q1 J4 q use_hud_item(0) * |6 G( {8 w& B1 f2 G8 _
elsif Input.press?(Input::Numkey[2])
6 L, H, I4 h X# `5 x4 g equip($game_player.hud_equip[1]) ' b8 o7 l# e2 n) Q$ K; R4 b2 C
use_hud_item(1) ( l$ p1 d2 h/ e( C, P
elsif Input.press?(Input::Numkey[3])
" }% U' |7 E+ b8 O# y equip($game_player.hud_equip[2])
6 d* l ~1 j% [, g! o' k use_hud_item(2)
: i' w8 M% R1 G elsif Input.press?(Input::Numkey[4])
+ P; j7 T1 p$ U7 [8 l( | equip($game_player.hud_equip[3])
' o5 X9 z: b# @4 Z use_hud_item(3) ! [% R( M3 ~ t# G' Q9 w" C
elsif Input.press?(Input::Numkey[5])
4 W8 J8 v9 s' P5 ]- ] equip($game_player.hud_equip[4])
5 k( W, i+ S" M use_hud_item(4) " n8 p+ }" v1 ~! Z! K
end
6 U. U. t3 t+ o+ j& w# k; n7 G end
o3 X+ V ?. f' E! Y, H( V9 tend ; g, J+ `5 s, K5 q! _0 \; F
1 z u. f% |+ |! A#=============================================================================== 1 e |2 E% R& f" N9 \
# Scene Map
$ C4 a; a4 d+ `. e9 J#=============================================================================== * w7 u1 j: c# L% i5 s
class Scene_Map 4 O/ {! \ S5 q' V7 @4 `6 S; [! l
alias hot_key_hud_init main
]1 Z- [; i! x+ H$ I- @/ q def main 4 G9 S8 \# l$ p4 m! X7 @! }
@hot_key_hud = Hot_Key_HUD.new
1 d& |1 J/ T( K& @' [ @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH] & \3 ~' K9 Y" @3 a! U
hot_key_hud_init
! B' z' [$ p( }( k' ~' X! Y @hot_key_hud.dispose $ |4 `/ y% G7 G
end . m7 m$ i3 o6 t1 O7 N5 ?# d7 H' r
7 A6 ^5 {' X5 F" A" m; i, \
alias hot_key_hud_update update / w4 K* {6 l5 m. I8 F7 P
def update 9 s+ q# E9 m2 ~0 y" `% V! I9 P
hot_key_hud_update # n4 s0 {. R* G( R; {: U% x
@hot_key_hud.update 0 c; c3 k; M2 g* @6 g
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
1 h1 [) @$ G* Y @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
) H9 X5 V; m4 h) h) f7 m end ) l( j, p2 R C0 v
end
4 ]/ g2 @, m# e" ~
|
|