|
|

楼主 |
发表于 2016-1-28 18:47
|
显示全部楼层
再確認一下,你的程式功能,
1.在Allegro.ilinit裡面加載 SkillMenu.il
2.開啟Allegro.exe
3.執行sm
4.這時候就加載你所設定的Menu(m1~m7),之後會重覆加載好幾次
這是因為下面的判斷問題
when(g_SkillMenuTimerNum>1
if(isCallable('axlUIMenuFind) then
if(axlUIMenuFind(nil,"wxGrids") then
axlUIWTimerRemove(g_SkillMenuTimerId)
g_SkillMenuTimerId='unbound
g_SkillMenuTimerNum='unbound
return(t);
);if
);if
);when
你的程式工作流程應該是這樣
1.執行sm後,
2.執行下列
g_SkillMenuTimerId=nil
g_SkillMenuTimerNum=0
g_SkillMenuTimerId=axlUIWTimerAdd(nil,2000,nil,'wxSkillMenu_TimerCallBack)
3.時間等待2000後再執行wxSkillMenu()函數,
4.這時候就執行下面並執行好幾次
when(g_SkillMenuTimerNum>1
if(isCallable('axlUIMenuFind) then
if(axlUIMenuFind(nil,"wxGrids") then
axlUIWTimerRemove(g_SkillMenuTimerId)
g_SkillMenuTimerId='unbound
g_SkillMenuTimerNum='unbound
return(t);
);if
);if
);when
如果你只要加載一次的話,你修改成下面試試看,只留紅字部分
if(boundp('g_SkillMenuTimerId) && boundp('g_SkillMenuTimerNum) then
;if(g_SkillMenuTimerNum>5 then
; axlUIWTimerRemove(g_SkillMenuTimerId)
; g_SkillMenuTimerId='unbound
; g_SkillMenuTimerNum='unbound
;else
; g_SkillMenuTimerNum++
;);if
;when(g_SkillMenuTimerNum>1
; if(isCallable('axlUIMenuFind) then
; if(axlUIMenuFind(nil,"wxGrids") then
axlUIWTimerRemove(g_SkillMenuTimerId)
g_SkillMenuTimerId='unbound
g_SkillMenuTimerNum='unbound
return(t);
; );if
; );if
;);when
else
g_SkillMenuTimerId=nil
g_SkillMenuTimerNum=0
g_SkillMenuTimerId=axlUIWTimerAdd(nil,2000,nil,'wxSkillMenu_TimerCallBack)
);if
|
|