|
楼主 |
发表于 2010-8-23 22:39:55
|
显示全部楼层
function draw_status()
win = GetPluginID ()
window_width = 330
--window_height = 150
window_height = 242
window_position = 6
window_bg_color = ColourNameToRGB ("darkgray")
WindowFont (win, "f1", "Arial", 9)
WindowFont (win, "f2", "Fixedsys",8)
WindowCreate (win, 0, 0, window_width, window_height, window_position, 0, window_bg_color)
drawGauge(win, "f1", "精神", 5, 5, me.hp["rec_js"], me.hp["max_js"])
drawGauge(win, "f1", "精力", 5, 25, me.hp["rec_jl"], me.hp["max_jl"])
drawGauge(win, "f1", "气血", 5, 45, me.hp["rec_qx"], me.hp["max_qx"])
drawGauge(win, "f1", "内力", 5, 65, me.hp["rec_nl"], me.hp["max_nl"])
drawGauge(win, "f1", "食物", 5, 85, me.hp["rec_food"], me.hp["max_food"])
drawGauge(win, "f1", "饮水", 5, 105, me.hp["rec_water"], me.hp["max_water"])
w_text(win, "f1", "潜能", 5, 125, me.hp["pot"], "yellow")
w_text(win, "f1", "经验", window_width/2, 125, me.hp["exp"], "deeppink")
WindowShow (win, true)
end
function quest_status()
draw_status()
window_width = 330
window_height = 110
window_position = 7
window_bg_color = ColourNameToRGB ("white")
qst = GetPluginID()
WindowFont (qst, "f1", "Arial", 8)
WindowFont (qst, "f2", "Fixedsys", 8)
WindowFont (qst, "f3", "宋体", 12)
WindowCircleOp (qst, 2, 2 , 148, 0, 258, ColourNameToRGB("blue"), 6, 1, 0x000000, 1)
WindowCreate (qst, 0, 151, window_width, window_height, window_position, 0, window_bg_color)
WindowText (qst, "f1",
"已完成 "..GetVariable("rec_quest").." 个任务,将要进行第 "..GetVariable("next_quest").." 个任务",
10, 10, 0, 0,
ColourNameToRGB ("green"),
flase)
if GetVariable("rw_class") == "0" then
rw_class = "任务"
elseif GetVariable("rw_class") == "1" then
rw_class = "寻"
elseif GetVariable("rw_class") == "2" then
rw_class = "要"
elseif GetVariable("rw_class") == "3" then
rw_class = "杀"
elseif GetVariable("rw_class") == "4" then
rw_class = "口讯"
elseif GetVariable("rw_class") == "5" then
rw_class = "送"
else
rw_class = "无定义"
end
local win_width = WindowTextWidth(qst, "f2", "["..rw_class.."]")
WindowText (qst, "f3",
"["..rw_class.."] "..GetVariable("rw_item"),
10, 35, 0, 0,
ColourNameToRGB ("blue"),
flase)
if rw_class == "送" then
WindowText (qst, "f3",
"[到] "..GetVariable("rw_npc"),
150, 35, 0, 0,
ColourNameToRGB ("red"),
flase)
else
WindowText (qst, "f3",
"[地点] "..GetVariable("rw_place"),
150, 35, 0, 0,
ColourNameToRGB ("red"),
flase)
end
WindowText (qst, "f1",
"当前经验",
10, 55, 0, 0,
ColourNameToRGB ("blue"),
flase)
WindowText (qst, "f2",
GetVariable("rec_exp"),
80, 55, 0, 0,
ColourNameToRGB ("red"),
flase)
WindowText (qst, "f1",
"新增经验",
10, 75, 0, 0,
ColourNameToRGB ("blue"),
flase)
WindowText (qst, "f2",
GetVariable("add_exp"),
80, 75, 0, 0,
ColourNameToRGB ("red"),
flase)
WindowShow (qst, true)
end
这个是我的代码,定义了两个函数,当输入的是hp的时候调用的是function draw_status()
而输入的是quest的时候调用quest_status()这个函数,现在就是当输入hp时只显示draw_status()画的图,而quest_status()画的图隐藏,反之亦然。。。 |
|