111
This commit is contained in:
@@ -18,9 +18,20 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
//输入框
|
||||
InputObject = null;
|
||||
|
||||
AniList = null;
|
||||
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
Childrens = [];
|
||||
AniList = [];
|
||||
for (local i = 0; i< 13; i++) {
|
||||
local obj = sq_getMyCharacter();
|
||||
local ani = obj.getVar().GetAnimationMap("common/horseguessing/knight" + i + ".ani", "common/horseguessing/knight" + i + ".ani");
|
||||
AniList.append({
|
||||
ani = ani,
|
||||
flag = false
|
||||
});
|
||||
}
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
|
||||
@@ -39,6 +50,10 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
}
|
||||
SendPackEx(T);
|
||||
}.bindenv(this);
|
||||
BetButton.SetCallBackFunc(function(Button) {
|
||||
if (Parent.MyState != 0) Button.Visible = false;
|
||||
else Button.Visible = true;
|
||||
}.bindenv(this));
|
||||
Childrens.append(BetButton);
|
||||
|
||||
InputObject = LenheartNewUI_BaseInput(80, 564, 76, 20);
|
||||
@@ -64,17 +79,21 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
|
||||
|
||||
//骑手胜率信息
|
||||
if (Parent.RiderInfo && Parent.RiderInfo.len() >= 5) {
|
||||
L_sq_DrawCode("获胜 : " + Parent.RiderInfo[2] + "次", X + 25 + 5, Y + 56 + 17, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
L_sq_DrawCode(Parent.RiderInfo[0] + "胜" + Parent.RiderInfo[1] + "败", X + 25 + 5, Y + 56 + 17 + 19, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
if (Parent.RiderInfo && Parent.RiderInfo.len() > Parent.NowSelectRider && "outcome" in Parent.RiderInfo[Parent.NowSelectRider]) {
|
||||
local Info = Parent.RiderInfo[Parent.NowSelectRider].outcome;
|
||||
L_sq_DrawCode("获胜 : " + Info[2] + "次", X + 15 + 5, Y + 20, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
//胜负情况字符串
|
||||
local outcomeStr = Info[0] + "胜" + Info[1] + "败";
|
||||
L_sq_DrawCode(outcomeStr, X + 50 - LenheartTextClass.GetStringLength(outcomeStr) / 2, Y + 38, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
local WinRate = 0;
|
||||
if (Parent.RiderInfo[0] + Parent.RiderInfo[1] != 0)
|
||||
WinRate = ((Parent.RiderInfo[0].tofloat() / (Parent.RiderInfo[0] + Parent.RiderInfo[1]).tofloat()) * 100.0).tointeger();
|
||||
L_sq_DrawCode("胜率 : " + WinRate + "%", X + 25 + 5, Y + 56 + 17 + 19 + 15, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
if (Info[0] + Info[1] != 0) //判断不要0 / 0
|
||||
WinRate = ((Info[0].tofloat() / (Info[0] + Info[1]).tofloat()) * 100.0).tointeger();
|
||||
WinRate = "胜率 : " + WinRate + "%";
|
||||
L_sq_DrawCode(WinRate, X + 55 - LenheartTextClass.GetStringLength(WinRate) / 2, Y + 54, sq_RGBA(255, 255, 255, 250), 0, 1);
|
||||
|
||||
if (Parent.RiderInfo[3] != 0 && Parent.RiderInfo[4] != 0) {
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Parent.RiderInfo[3], X + 25 + 5 + 152, Y + 62);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Parent.RiderInfo[4], X + 25 + 5 + 152, Y + 62 + 36);
|
||||
if (Info[3] != 0 && Info[4] != 0) {
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Info[3], X + 25 + 5 + 152, Y + 10);
|
||||
L_sq_DrawImg("interface2/event/chn_event_2016/160927_joustmatches/joustmatches_info_window.img", Info[4], X + 25 + 5 + 152, Y + 46);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +126,14 @@ class HorseGuessing_KnightInfoC extends LenheartNewUI_Windows {
|
||||
if (InputObject.str.len() > 0 && InputObject.str.tointeger() > Parent.ResidueCoin) {
|
||||
InputObject.SetStr(Parent.ResidueCoin.tostring());
|
||||
}
|
||||
|
||||
//在城镇的时候才播放
|
||||
if (sq_GetCurrentModuleType() == 1) {
|
||||
foreach(value in AniList) {
|
||||
sq_AnimationProc(value.ani);
|
||||
sq_drawCurrentFrame(value.ani, -600, 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user