灌水成绩
等级头衔
ID : 1
管理员
积分成就
威望 : 8
点
贡献 : 9 次
下载币 : 449 枚
在线时间 : 2007 小时
注册时间 : 2013-9-5
最后登录 : 2026-10-27
平常他是不显示的,默认的是只有血条,没有数字!
9 A" O+ }. R4 r 8 P7 n, Z' V0 X" g
如果想让他这样显示按照下面方法做:5 i8 I8 d' D3 u8 T: I
. [& Q3 u; Y: Z* d 把下面的lua脚本复制到你服务端5 B( G. y) p7 U# d
, S& H S6 w: {8 A/ a3 L, n
\龙途\Flying3D\scripts\模块\主界面\主逻辑.lua
! \- n1 Y4 W, ^# T
$ O8 Z/ k/ X; Q( n6 Z/ R8 W0 L) x# t 里面全部覆盖,注意是全部覆盖!$ F9 I& @* w! B& z
: [' K8 P. Q% z2 d9 D
然后重新打包pack) A: _, _/ F5 ]# z: A9 e+ N
module(..., package.seeall)
* L* Y6 d9 Z* R6 F/ {, b# _ local 实用工具 = require("公用.实用工具")
& C& g0 |: w% R7 S* ] m_FlytextPool = {}/ G/ w6 {$ ?8 b! l y8 j9 E
m_Flytexts = {}& |: ~: i3 j& d/ Z0 n
function pushFlytext(flytext)5 B* U5 S3 u% c; b4 X
if flytext.minus then
) j$ f0 p8 g, @* m flytext.minus:setVisible(false)
- p" t. n* I a6 l. a1 w' m. g end
/ q$ C8 X j# `) } flytext:setAlpha(1)/ s; a: X' Y0 Z- [$ E
flytext:reset()- R) ^9 ]1 |; s
flytext:removeFromParent()
1 H% n2 [. A& ]9 v- Y9 M' ] m_Flytexts[flytext] = nil
5 P; f) K* J7 ]3 K3 X, j m_FlytextPool[#m_FlytextPool+1] = flytext
& |& m1 m8 l' T# o. K; t0 N end
( ]2 V, U- e' ?/ _; S function popFlytext()
. v) p: P+ H5 H# P. a if #m_FlytextPool > 0 then% S2 J1 ~! H$ |% b5 c
local flytext = m_FlytextPool[#m_FlytextPool]% J- K& o' r! a; D8 X
table.remove(m_FlytextPool, #m_FlytextPool)6 J0 d* j' v$ v6 r2 f5 `% r2 m
return flytext
( F" |* T; X2 P9 Z% `8 r5 o end
4 p$ m9 t. B1 @: |, A) t end2 {9 T4 e, Q9 o8 N& w* I
function showFlytext(role, dechp, crit)) W+ W2 v; o( B+ E# d4 M- q
if 1 then; J! M2 U" p& I: i) |
return. o7 }* [9 G% z+ ? W
end
% ]* [6 ]* E3 o3 d, y local flytext = popFlytext() or F3DImage3D:new()+ a1 r' _, U9 o" d ?, ?! Z
if dechp == 0 then
; Y1 R2 o1 } K4 e* W i flytext:setWidth(0)
9 m+ b! z# t1 S% `+ X flytext:setTextureFile(UIPATH.."公用/fight/miss.png")0 |) }4 S$ @5 U5 Z$ b+ D
flytext:setOffset(-52, -35)
/ \: y! Y' M7 s- H elseif dechp < 0 then. d4 P: y' t2 I) C9 c8 {5 b& m
dechp = -dechp4 A& P/ L* V5 u
flytext:setTextureFile(UIPATH.."公用/fight/addHit.png")
5 ?1 d5 a! G: |$ B flytext:setWidth(22)$ I7 O/ X' R; ? ?/ C
if not flytext.clips then7 B* R* ^1 U- L: ]" ~" a9 H: R
flytext.clips = F3DPointVector:new()$ z3 W7 Z, x, q# s! v$ C0 f
end ^ e- P% X7 p6 v# j6 ?3 J7 Q7 \" v
flytext.clips:clear()
4 v: d: e) p$ u+ n6 ` while dechp >= 1 do# F* P* @) \3 C1 A! y5 m' ]$ E/ V
flytext.clips:push(math.floor(dechp%10), -flytext.clips:size()*22)
( U/ K, ]$ Z) O dechp = dechp / 100 ?2 F# ], W0 X
end* {1 t9 `: j; X% M; x D
flytext:setBatchClips(10, flytext.clips)
; ^5 Y2 P2 |1 M9 n; j flytext:setOffset(-22+flytext.clips:size()*11, -50)0 ~; N) j1 s+ i- ^* c! D
if not flytext.minus then
5 B% h+ r0 ^& }. V) O flytext.minus = F3DImage:new()
0 ]. U8 x# X# h$ x9 i9 Z flytext:addChild(flytext.minus)9 d& X7 x0 x9 s" ]. G# \- F7 `- q$ @* \
end/ c+ J/ `& @9 t6 H) Z1 f4 P
flytext.minus:setTextureFile(UIPATH.."公用/fight/addFlag.png")3 F' z& a/ M4 v( I* p- p" o
flytext.minus:setPositionX(-(flytext.clips:size()-1)*22-27)+ f8 ~9 J K% m$ K& k
flytext.minus:setPositionY(4)
6 x+ e6 }8 S) Q" S flytext.minus:setVisible(true)0 |; \4 I+ I+ `( S9 `
elseif crit == 1 then' b9 H* h0 F! [" W
flytext:setTextureFile(UIPATH.."公用/fight/criticalHit.png")
5 N7 \: D0 A, A/ u flytext:setWidth(28)' X* i2 A* H2 H+ C' q
if not flytext.clips then+ T$ E# g+ f9 K% Z; F
flytext.clips = F3DPointVector:new()
; `$ e4 f- s1 r end
7 L, w, [5 R4 ^' | flytext.clips:clear()
- ~) X3 H$ `( h$ { while dechp >= 1 do
2 T% i N+ P; D! _* c# `" p$ t flytext.clips:push(math.floor(dechp%10), -flytext.clips:size()*28); z- t) ~9 O4 G" k
dechp = dechp / 10
0 l* r" y; U m2 \# a& r$ t4 C- _ end) N3 l' g2 r r- I+ Y
flytext:setBatchClips(10, flytext.clips), U( S: A* g6 J. h
flytext:setOffset(-28+flytext.clips:size()*14, -50)
5 e5 i) U+ u* Y5 B9 K7 G! n if not flytext.minus then
& `2 h; e( i* K: e1 p flytext.minus = F3DImage:new() _% k/ \* K8 w- z
flytext:addChild(flytext.minus), Z& d) i0 y7 F5 |8 ^, @ \& g$ E
end% ~6 Z5 T B: L" `' `
flytext.minus:setTextureFile(UIPATH.."公用/fight/criticalFlag.png")
5 O5 f: ^, i# z. k4 [' |3 G9 D flytext.minus:setPositionX(-(flytext.clips:size()-1)*28-55)
6 Y- x: u) Z2 l: d flytext.minus:setPositionY(-5)
1 u3 Y4 i& j+ B+ _# j2 ~ flytext.minus:setVisible(true)
' @; F* V: N+ i# R else$ Z7 ~4 N6 o: o$ a F
flytext:setTextureFile(UIPATH.."公用/fight/otherHit.png")
. ^2 L( F/ `/ S% f1 N! i flytext:setWidth(22)
' A* P5 u& B. X3 e( ^" v) m if not flytext.clips then
8 J: [1 }1 a4 C4 V0 S flytext.clips = F3DPointVector:new()+ z! e2 y. `, B0 G
end% o x# i5 U4 [( S% J% H0 R, w
flytext.clips:clear()
1 M% k/ C7 o& h2 ~/ @1 o3 G while dechp >= 1 do
1 s# W4 F- H) | flytext.clips:push(math.floor(dechp%10), -flytext.clips:size()*22)
( ?' u! H# m7 o# K6 }) m/ J9 v dechp = dechp / 105 o* f! ?) r4 P! c1 k' G# c
end
0 U3 `& i) @- p5 f" ~ flytext:setBatchClips(10, flytext.clips)
# Z- U7 p2 @) y1 t" c flytext:setOffset(-22+flytext.clips:size()*11, -50)8 R1 _6 k1 S' i5 T- I
if not flytext.minus then7 u( `/ L( m% ^& B
flytext.minus = F3DImage:new()
2 ^5 J U D6 c0 l( v- d) V, g flytext:addChild(flytext.minus)
- N2 Y( j8 f! A8 `& P" G9 s! o% i end4 ~' g5 q& n/ }( d2 n
flytext.minus:setTextureFile(UIPATH.."公用/fight/otherFlag.png")" A7 n! q8 F% \7 o( k4 i8 |
flytext.minus:setPositionX(-(flytext.clips:size()-1)*22-17): H- X* [% z, H5 b7 l& i
flytext.minus:setPositionY(12)6 i* E! ]; B+ q0 ?( ^: _6 T8 o# v
flytext.minus:setVisible(true)2 Y; a' y5 h# [. |
end
- Z# U. ~% c# O8 h! s flytext:setPosition(role:getPositionX(), role:getPositionY(), role:getPositionZ() + 100)--role:getBoxHeight() + 10)
% H( N% Z" P5 s a dechpcont:addChild(flytext)
& X Z3 y4 C& C! u0 u% l# I' Y m_Flytexts[flytext] = 1
3 B1 P; u2 U0 {0 P local prop = F3DTweenProp:new()
% O/ A W- h0 m* e$ [1 y. z prop:push("offsetY", -100, F3DTween.TYPE_SPEEDDOWN)
2 m3 t) R% T/ j prop:push("alpha", 0, F3DTween.TYPE_LINEAR)4 S8 @$ L, F i: Y
F3DTween:fromPool():start(flytext, prop, 1, func_n(function()& P2 T# r3 m# m; j# a7 d% z
pushFlytext(flytext)--flytext:removeFromParent(true)
* I2 r; r( V2 F. w' E end))
5 q6 z% S# l2 C, T8 p end& {2 A! C! E; z
hpbarpool = {}
1 p; i! {9 A# [2 l- b; B function removeMergeHP(hpbar)" N2 v8 }( e: U
if hpbar.mergehp then, q+ W. w( O5 b: L/ L' l% J
for i,v in ipairs(hpbar.mergehp) do
P4 P" K# R% Q3 Q' V$ v4 p0 R v:removeFromParent(true)
O( j- ~8 d1 |9 W5 n4 L5 e end$ ^5 v. k1 R' b2 o. `1 w: t
hpbar.mergehp = nil m( P" Z2 `+ Z, }4 C7 k/ l8 F
end1 G* W5 v7 L& p. }% q, f2 T
end" }+ m) V$ I; @7 @
function createMergeHP(hpbar, hp, hpmax, mergehp)
, E5 W' ]! K3 c1 [0 E# ~ d5 F hpmax = hp
! O9 W2 p m3 o for i,v in ipairs(mergehp) do* _% w+ }. D7 E
hpmax = hpmax + (i == #mergehp and v.hpmax or v.hp)
! {; X" r q+ p( p8 W9 Z& J end
% c9 o8 W3 M4 b, K* j+ _' P; s+ V. a local perc = hp / hpmax
, u p7 @" E1 `) |1 x" ? hpbar.hpimg:setWidth(hpbar.track:getWidth()*perc)
2 R" z, B- n, i7 G hpbar.mergehp = {}
9 Y+ m0 C2 u- s9 \ for i,v in ipairs(mergehp) do
( m2 z" {+ j* _. M* ^ local hpimg = F3DImage:new()5 ?) F8 E; v/ o/ ?8 w- ] x
local pc = (i == #mergehp and v.hpmax or v.hp) / hpmax
$ W3 t, [; {+ n# e% a) \ hpimg:setTextureFile("tex_white")) B. h* X3 P1 N$ a r
hpimg:setWidth(hpbar.track:getWidth()*pc-1)
1 j$ m& B1 ?8 g$ x0 a& z2 R' l) f+ z hpimg:setHeight(hpbar.track:getHeight())0 m4 {: P5 t( B+ B
hpimg:setPositionX(hpbar.track:getWidth()*perc+1)
, l ]6 g) k5 Q+ W+ G; o* j hpimg:getColor():setRGB(v.color)* A6 \$ W5 w( O/ Q
hpbar.track:addChild(hpimg), c% t P# ^& _8 v# o- z# w
hpbar.mergehp[#hpbar.mergehp+1] = hpimg
5 }9 h% X x; N0 A+ ]/ @ perc = perc + pc1 k. _. T4 j, g4 L6 |, v
hp = hp + v.hp
6 N- [+ `) x( G8 [' }0 ?: z6 h7 B% { end3 s( g4 \% S/ l, g
return hp, hpmax
. R. }# W+ y2 Y end/ m" O0 r1 s/ @6 ~/ Q6 h
function onHpBarInit(e)
. h+ }1 {1 n4 p" P2 H& f3 U; E/ m4 M local hpbar = e:getTarget()
; C: @9 L" \% Z+ z hpbar.name = hpbar:findComponent("name")- s V9 {0 F# U9 o' ~
local ss = 实用工具.SplitString(hpbar.v.name,"\")% e* W+ \9 i8 g8 l" S% B! t
hpbar.name:setTitleText(txt(ss[1]))8 ?* ?+ m% ^) S4 k2 J# {/ K& h
if #ss > 1 then: n% s% z, l0 _$ m0 L9 b
hpbar.nameexs = hpbar.nameexs or {}9 b/ c9 I/ E7 x( }* V5 W# \# ~% T% `
for i=2,#ss do
' q, S; Q7 ?0 K local tf = hpbar.nameexs[i-1] or F3DTextField:new()8 W# b& X9 B9 M4 {% D
if g_mobileMode then! V1 V( Q4 L* a* o7 a% V
tf:setTextFont("宋体",16,false,false,false): V$ l; X- `2 f6 N8 p/ O
end
7 Z, W/ X# O) w' V7 K tf:setText(txt(ss[i]))
/ H: H4 @3 `* Z5 k) \3 n tf:setTextColor(hpbar.namecolor or 0xffffff,0)
! u' E: @; P" ?* d tf:setPivot(0.5,0.5)
, G; N& T1 F: W8 C. L tf:setPositionX(0)- N8 C, ~! m. l- f
tf:setPositionY(50+(i-1)*14)& j; B3 `% @& E" M3 X
hpbar:addChild(tf)7 W1 R& t9 B3 P
hpbar.nameexs[i-1] = tf6 C V; o u. ]. x
end( Z" _* Q) Y1 e/ z
end. F2 x8 D! P4 h6 d; }& o4 z
hpbar.name:setVisible(hpbar.showname)& G9 M( _8 R% l e& N6 a! v
hpbar.name:setTextColor(hpbar.namecolor or 0xffffff)( F1 v% L, T) d; y
hpbar.guildname = hpbar:findComponent("guildname")& S8 M+ [" u: S& T4 b5 A
hpbar.guildname:setTitleText(txt(hpbar.v.guildname or ""))
' T1 `. r9 z3 s; z' P hpbar.guildname:setVisible(hpbar.showname), b& `7 F% I. k
hpbar.guildname:setTextColor(hpbar.namecolor or 0xffffff)
% [7 B5 ]0 [6 |; a3 b6 M hpbar.pro = tt(hpbar:findComponent("hpbar"),F3DProgress)# d1 B6 V1 b3 s: B. X% \- l' z+ t
hpbar.track = hpbar.pro:getTrack()) X$ c) u! r \; x) {
hpbar.hpimg = F3DImage:new()
" C8 x* R8 ?/ s4 k" v4 c hpbar.hpimg:setTextureFile("tex_white")2 P# J' s& q& t0 g6 _
hpbar.hpimg:setWidth(hpbar.track:getWidth())1 j `; c2 K( _: X% ~
hpbar.hpimg:setHeight(hpbar.track:getHeight())- j1 f) u8 n# x: p0 i0 D
hpbar.hpimg:getColor():setRGB(hpbar.v.color)
6 b4 ]4 r m( ^6 L hpbar.track:addChild(hpbar.hpimg)
! h9 O, E ]& Q4 K5 B2 P/ q3 k local count = F3DTextField:new() --创建一个文字5 y* e. ]9 o$ u& g8 @9 `: j
count:setPivot(0.5,0.5) --血条文字改为居中. N: s" w I+ S
count:setPositionX(20)--变更一下血条x位置
& f0 i6 I( z7 Z* {) A- ~/ q count:setPositionY(-10)--变更一下血条y位置% f, M/ ~5 F) U# }! }
hpbar.pro:addChild(count)--跟名字绑定# O) h( w( d8 g/ o
hpbar.count = count --方便下面随时修改血量% E6 w2 u4 Q% c& H _( U. E
hpbar.count:setText(txt(hpbar.v.hp == hpbar.v.hpmax and "" or hpbar.v.hp.."/"..hpbar.v.hpmax))--变成血量在其它动态变更的地方都做一下修改
% b2 q% w3 b1 P- W! R3 U% Y/ I9 h --hpbar.count:setText(txt(hpbar.v.hp == hpbar.v.hpmax and "" or hpbar.v.hp .."/"..hpbar.v.hpmax))--变成血量在其它动态变更的地方都做一下修改- {% u2 L9 r* {% w9 x8 r- \" \/ I* F
if not hpbar.v.mergehp then
) x& j0 {. q. Q4 d/ G hpbar.mergehp = nil- U3 X9 t( C" G. E1 I8 M
hpbar.pro:setMaxVal(hpbar.v.hpmax)6 l1 W( F, G" j- w9 }- B
hpbar.pro:setCurrVal(hpbar.v.hp)
# Q' ?; [5 \: C) G6 Y- { hpbar.pro:setVisible(hpbar.v.hp > 0); G ]+ i$ W* N7 ]# z8 B
else7 z' f4 i, d# E
local hp, hpmax = createMergeHP(hpbar, hpbar.v.hp, hpbar.v.hpmax, hpbar.v.mergehp)
3 }' O* x) u. d2 i& s: ] hpbar.pro:setMaxVal(hpmax)5 P+ Y8 J/ v* x+ G, ]! e+ b
hpbar.pro:setCurrVal(hp), W% s' V0 T& o6 M; K$ ~
hpbar.pro:setVisible(hp > 0)
7 h3 @( ^0 W7 K' S( z end4 T2 i) x5 J) C* B# G1 v
end
# W: H! @4 z! [( N1 W function setHPBar(role, hp, hpmax, color, name, mergehp, showname, guildname, namecolor)2 D; E$ _- s: E2 M# o
local newcreate" p; y6 k! @ I* X* w6 Z5 ^
local hpbar
( q# {4 r5 [ s3 n; _- H showname = showname or 显示名字 == 1# A) K( H8 v4 Z
if role.hpbar then
) ?% G9 s4 B$ Y# d# @1 ^8 ~ hpbar = role.hpbar* U5 b3 y. g5 _! i7 I# x
hpbar.showname = showname
2 R; k3 z4 g: }* y p/ M hpbar.namecolor = namecolor
|1 a1 i/ d/ s: w, {: e6 a else: K' F G) y% } B4 f
if #hpbarpool == 0 then
K) {% D* @& I1 s( i. B hpbar = F3DLayout:new()* S* l% L+ D8 z. `" H6 N
hpbar.showname = showname7 y6 f1 j9 _) W7 N; q3 ]* l7 J
hpbar.namecolor = namecolor
: X9 U' R# s. R6 y hpbar:setLoadPriority(g_uiFastPriority)
# X, w. {; c5 c' \ hpbar.v = {hp = hp,hpmax = hpmax,color = color,name = name,mergehp = mergehp,guildname = guildname}/ Y. k* Y5 W4 U3 P2 O; T) E
hpbar:addEventListener(F3DObjEvent.OBJ_INITED, func_oe(onHpBarInit))
2 N* L1 [" S5 O+ Q, N. u hpbar:setLayout(g_mobileMode and UIPATH.."血条UIm.layout" or UIPATH.."血条UI.layout")--IS3G and UIPATH.."血条UIn.layout" or
# i& P$ g- @9 W newcreate = true
3 C, I$ }3 @7 D- t D( Q0 t else
" ^. t) L7 D8 h6 T! r2 [ hpbar = hpbarpool[#hpbarpool]2 B* n' x3 K. F$ f, r" x A
hpbar.showname = showname* s2 v( H6 [* n7 W8 p1 @# @$ t
hpbar.namecolor = namecolor, G2 }8 a2 S" c& a1 y
table.remove(hpbarpool)9 k N4 {9 p' {# G: K5 y& @8 j2 ~. P, V
end
" n% B" }/ X) ]0 r8 I role.hpbar = hpbar
( i9 O: H5 Y/ t. r# U q; g5 r) S hpbar:setZOrder(-role:getPositionY())
8 a* i0 e1 l' G" n1 h* K7 X% f hpcont:addChild(hpbar)/ r5 R) t* @3 k' }2 Y" \
end9 C! z9 Y0 q6 V7 B) J- A# Z
if newcreate then
" x$ \7 g- f1 S& Z# C9 k/ @ elseif hpbar:isInited() then; Z: e3 H0 Y0 M
local ss = 实用工具.SplitString(name,"\"), E" V( b7 l! w8 V3 z6 y6 t
hpbar.name:setTitleText(txt(ss[1]))$ G# R( I6 b0 A5 d) ~# L0 o
if #ss > 1 then; Y& G% u8 d8 P
hpbar.nameexs = hpbar.nameexs or {}3 A2 o2 Z9 q: P
for i=2,#ss do8 j' c3 }9 H# ~; R
local tf = hpbar.nameexs[i-1] or F3DTextField:new()
% z0 b3 |4 c& U$ p! |( |. o/ }- ~1 X if g_mobileMode then" D& \; i; A$ h7 \# n7 z
tf:setTextFont("宋体",16,false,false,false)
$ `; Z- c p8 g) R- g1 d end
6 j7 H" } h- O2 W tf:setText(txt(ss[i]))% G8 U9 R# ?" ?0 }9 |. N0 k
tf:setTextColor(hpbar.namecolor or 0xffffff,0)0 @* I5 _. W& t% j7 m
tf:setPivot(0.5,0.5)
' I5 `' ?! f; b8 c s tf:setPositionX(0)$ Y% J R, I% W K5 ]
tf:setPositionY(50+(i-1)*14), j4 R: k3 D- _8 R F5 T
hpbar:addChild(tf)! H1 W5 F* J) G
hpbar.nameexs[i-1] = tf
' i9 P( e* c0 B- s end
; X: T$ H4 {/ u' R end5 V& W( ?7 z1 W! Q8 w& K
hpbar.guildname:setTitleText(txt(guildname or ""))
$ E6 F. W) m- e6 Y$ Z. w8 b hpbar.name:setVisible(hpbar.showname or role == g_hoverObj)
5 B; u! \ S5 G$ b4 T) e hpbar.name:setTextColor(hpbar.namecolor or 0xffffff)
% v5 h) r4 J+ u0 K) ? hpbar.guildname:setVisible(hpbar.showname or role == g_hoverObj)
( A% N; C- } E6 m1 Y hpbar.guildname:setTextColor(hpbar.namecolor or 0xffffff). I+ r. a5 Q) q" v- ?, x
if not mergehp then
# G9 i1 L* ]$ D4 w# w removeMergeHP(hpbar)
, \4 z, Y m! Q hpbar.hpimg:setWidth(hpbar.track:getWidth())
# w- X5 w6 T1 N& q3 n( ?0 ` hpbar.hpimg:getColor():setRGB(color)+ ~# U- ^* ?3 Q
hpbar.pro:setMaxVal(hpmax)$ {2 B9 l+ D+ ~4 M1 C1 X- s
hpbar.pro:setCurrVal(hp)
8 [- h( I. M9 B1 v hpbar.pro:setVisible(hp > 0)6 n. j. O1 p6 I- ~
else
8 n/ n N( W! N& x removeMergeHP(hpbar)
% x% }& }8 `# b+ S- p hpbar.hpimg:setWidth(hpbar.track:getWidth()): }, g( a- H A- c) I2 [0 u' a7 G
hpbar.hpimg:getColor():setRGB(color)9 R. b6 J! a% D+ [9 X
hp, hpmax = createMergeHP(hpbar, hp, hpmax, mergehp); {! |: O& M# s/ l
hpbar.pro:setMaxVal(hpmax)5 s3 A/ B* g" r6 D1 m
hpbar.pro:setCurrVal(hp)
! F( s" s: H- |6 M hpbar.pro:setVisible(hp > 0)
* U3 e+ p# T+ u+ d2 l3 B4 C+ G end
! Z5 V+ j, }" X7 `* w7 j2 j8 F hpbar.count:setText(txt(hp == hpmax and "" or hp.."/"..hpmax)), `2 h) x3 w5 t8 \5 K: I
else+ `0 C( h# u: K5 r$ W
hpbar.v = {hp = hp,hpmax = hpmax,color = color,name = name,mergehp = mergehp,guildname = guildname}
) p% n6 w2 u' M end
: N! M! @' I1 ?5 C I Q if not role:isVisible() or (hp == hpmax and not mergehp) then
5 z* e2 y7 G0 a; J hpbar:setVisible(true)--false)) i( _ J4 N/ t- P( Y5 ?9 U5 v
else
* Q% f! o* v! E1 ^0 S, b hpbar:setVisible(true)
- C* K6 E& f9 C0 d& t0 { end' d( L( A' ^+ Y7 Y. ~5 A7 V
end" p6 {3 \- ]. Z& D
function delHPBar(role)
3 H6 v) s0 s0 @% Y3 o. |* A local hpbar = role.hpbar3 }8 I" }/ M+ w: q
if hpbar then7 \# r7 H: u7 g4 s& c% n( g+ S$ l
hpbar.showname = nil
4 z6 B, X- C) M4 N, A$ T hpbar.namecolor = nil
6 w, R$ k1 d! y0 A9 A( l1 L$ I { if hpbar.titles then
) ^$ A I8 P- Z& x# Z, O) _ for i,v in ipairs(hpbar.titles) do2 E ^2 w8 R W. Q1 y
v:removeFromParent(true)7 o" \% |, l$ _) [: z j* ~3 s
end
5 t" O. i1 N, L" \$ U7 ~% ] 实用工具.DeleteTable(hpbar.titles), s8 Q: l6 f- X( r# F* a
end3 d( C# u6 P& _
if hpbar.nameexs then
) c: L% f& N3 ^; w for i,v in ipairs(hpbar.nameexs) do6 n8 C0 ^7 |+ p9 t, T+ ?, y
v:removeFromParent(true)
/ p0 u. `/ q3 h: q7 E0 h! T end; p$ {0 o: x* a L# C
实用工具.DeleteTable(hpbar.nameexs)6 z- o8 r$ {* d. d. `
end6 w4 S. o- S5 ^! n ?7 |; r
hpbar:removeFromParent()" b2 {2 X4 h( ^) T6 e& N5 ?- \! r
hpbarpool[#hpbarpool] = hpbar
! Z8 ]0 S, L6 }/ R0 ~* ?% q role.hpbar = nil
( d C( \! {4 o* x5 {2 D0 Q8 j end
! f0 p( F5 J! k1 }6 W end& Y$ H: @0 y- Y8 C
function updateHPBar(role)
& c8 a' ` {0 S- K+ c! v local hpbar = role.hpbar
; j, B$ B1 S! m4 m4 s8 ~ if hpbar then
9 ^8 Z% Z |, Z# X hpbar:setVisible(role:isVisible())% j' Z- d. I1 B h2 f
end. ^) I% I( S+ b' z
if hpbar and hpbar:isVisible() then
! k- d+ L1 f8 @) b hpbar:setZOrder(-role:getPositionY())
. H6 b' X% ]9 |" j local pt = F3DUtils:getScreenPosition(role:getPositionX(), role:getPositionY(), role:getPositionZ() + 100)--role:getBoxHeight() + 20)
6 B5 U6 D( h8 D" `, P' W' Z' ] if pt then w( A' {$ L5 o9 B# s3 A
hpbar:setPositionX(pt.x)
5 M/ o* x# C# e, U. p; j: M" C hpbar:setPositionY(pt.y)
5 V" L' C' n/ o1 H: Y7 t end' c2 O: o! j k4 I% B1 X% O0 _
end, {9 s' f) J3 h
end 复制代码
" b" K4 m7 P8 ?( }
7 W8 b( O5 F# s& O) J7 ]0 g
免责
帖子地址
打造全网最多免费游戏网站,部分资源失效,私聊站长补