Санкаку
offline
Опыт:
432Активность: |
jBoard, тонкие Multiboard
необходимость простой Multiboard когда-либо? переработки Multiboard занимает слишком много времени? использование vJASS и эта система. это лучше всего.
((код jass
ОК, потому jboard библиотека необычно большое, я просто разместить его в текстовый файл.
examples:
library mbTDHT initializer Init requires jBoardLib
globals MyBoard jBoard_TDHT jBoard jB endglobals ! runtextmacro jBoardCreate("MyBoard","12","2") private function Actions takes nothing returns nothing set jBoard_TDHT = MyBoard.create("TDHT 0.96s") call jBoard_TDHT.field(0,0).setIconPath(iconP) call jBoard_TDHT.field(1,0).setIconPath(iconP) call jBoard_TDHT.field(2,0).setIconPath(iconP) call jBoard_TDHT.field(3,0).setIconPath(iconR) call jBoard_TDHT.field(4,0).setIconPath(iconR) call jBoard_TDHT.field(5,0).setIconPath(iconR) call jBoard_TDHT.field(6,0).setIconPath(iconR) call jBoard_TDHT.field(7,0).setIconPath(iconR) call jBoard_TDHT.field(8,0).setIconPath(iconR) call jBoard_TDHT.field(9,0).setIconPath(iconR) call jBoard_TDHT.field(10,0).setIconPath(iconR) call jBoard_TDHT.field(11,0).setIconPath(iconR) call jBoard_TDHT.field(0,1).setValue(GetPlayerName(Player(0))).setIconPath(iconF).setWidthR(0.10) call jBoard_TDHT.field(1,1).setValue(GetPlayerName(Player(1))).setIconPath(iconF).setWidthR(0.10) call jBoard_TDHT.field(2,1).setValue(GetPlayerName(Player(10))).setIconPath(iconF).setWidthR(0.10) call jBoard_TDHT.field(3,1).setValue(GetPlayerName(Player(2))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(4,1).setValue(GetPlayerName(Player(3))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(5,1).setValue(GetPlayerName(Player(4))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(6,1).setValue(GetPlayerName(Player(5))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(7,1).setValue(GetPlayerName(Player(6))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(8,1).setValue(GetPlayerName(Player(7))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(9,1).setValue(GetPlayerName(Player(8))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(10,1).setValue(GetPlayerName(Player(9))).setIconPath(iconDG).setWidthR(0.10) call jBoard_TDHT.field(11,1).setValue(GetPlayerName(Player(11))).setIconPath(iconDG).setWidthR(0.10) endfunction public function Init takes nothing returns nothing set gg_trg_mbTDHT =CreateTrigger() call TriggerAddAction(gg_trg_mbTDHT,function Actions) endfunction endlibrary library mbTAF initializer Init requires jBoardLib
globals MyBoard jBoard_TAF jBoard jB endglobals ! runtextmacro jBoardCreate("MyBoard","13","2") private function Actions takes nothing returns nothing set jBoard_TAF = MyBoard.create("The Ancient Frontier") call jBoard_TAF.row(4,6).setColourR(c_royalpurple).row(10,12).setColourR(c_orange) call jBoard_TAF.row(1,3).setColourR(c_aqua).row(7,9).setColourR(c_yellow) call jBoard_TAF.col(0,0).hideIconR().field(0,0).hideValue().showIcon().setIconPathR(iconTIME) call jBoard_TAF.field(0,1).hideIcon().setPrefix("0").setSuffix("0").setValueR(":") endfunction public function Init takes nothing returns nothing set gg_trg_mbTAF =CreateTrigger() call TriggerAddAction(gg_trg_mbTAF,function Actions) endfunction endlibrary private struct Data
unit cast unit killer integer quas integer wex integer count integer slot integer slotx integer invoke timer tim static method create takes unit cast, unit killer returns Data local Data d = Data.allocate() set d.cast = cast set d.killer = killer set d.quas = GetUnitLevel(d.cast) set d.wex = GetPlayerId(GetOwningPlayer(d.cast)) set d.slot = returnslot(d.cast) set d.slotx = returnslot(d.killer) set d.invoke = 0 set d.tim = NewTimer() set d.count = 0 set d.invoke = S2I(jBoard_TAF.field(d.slot,1).getSuffix())+1
call jBoard_TAF.field(d.slot,1).setSuffix(I2S(d.invoke)) if d.slotx !=0 then set d.invoke = S2I(jBoard_TAF.field(d.slotx,1).getPrefix())+1 call jBoard_TAF.field(d.slotx,1).setPrefix(I2S(d.invoke)) endif call jBoard_TAF.field(d.slot,0).setValue(I2S(100 - d.count)) if GetPlayerTeamMSGS(GetPlayerId(GetOwningPlayer(d.killer)))==3 then
call msgall(25,"The "+GetUnitName(d.killer)+" of "+GetPlayerName(GetOwningPlayer(d.killer))+" just killed the "+GetUnitName(d.cast)+" of "+GetPlayerName(GetOwningPlayer(d.cast))+"!") call SetTimerData(d.tim, d) return d endif call SetPlayerState(GetOwningPlayer(d.killer), ConvertPlayerState(15), GetPlayerState(GetOwningPlayer(d.killer), ConvertPlayerState(15)) + HEROBOUNTY(d.quas)) call SetPlayerState(GetOwningPlayer(d.killer), ConvertPlayerState(1), GetPlayerState(GetOwningPlayer(d.killer), ConvertPlayerState(1)) + HEROBOUNTY(d.quas)) call msgall(25,"The "+GetUnitName(d.killer)+" of "+GetPlayerName(GetOwningPlayer(d.killer))+" just killed the "+GetUnitName(d.cast)+" of "+GetPlayerName(GetOwningPlayer(d.cast))+"!") call msgall(10,"Bounty awarded to "+GetPlayerName(GetOwningPlayer(d.killer))+" is "+I2S(HEROBOUNTY(d.quas))+" gold!") call SetTimerData(d.tim, d) return d endmethod method onDestroy takes nothing returns nothing call ReleaseTimer(.tim) endmethod endstruct private function Callback takes nothing returns nothing local timer tim = GetExpiredTimer() local Data d = GetTimerData(tim) set d.count = d.count + 1 call jBoard_TAF.field(d.slot,0).setValue(I2S(100 - d.count)) if d.count >=100 then call ReviveHero(d.cast,GetUnitX(hrc[d.wex]),GetUnitY(hrc[d.wex]),true) call msgone(10,GetOwningPlayer(d.cast),"Your "+GetUnitName(d.cast)+" has revived!",true) call msgone(10,GetOwningPlayer(d.cast),"The "+GetUnitName(d.cast)+" of "+GetPlayerName(GetOwningPlayer(d.cast))+" has revived!",false) call d.destroy() endif set tim = null endfunction private function herorevive takes nothing returns boolean local Data d = Data.create(GetTriggerUnit(),GetKillingUnit()) call TimerStart(d.tim, DURATION(d.quas), true, function Callback) return false endfunction call jBoard_TDHT.field(ip,1).setIconPathR(ICON[GetUnitPointValue(x)])
if GetPlayerSlotState(Player(i4rr)) == PLAYER_SLOT_STATE_PLAYING then
call msgall(45,"|cff80FF00"+GetPlayerName(p)+" has killed a special critter! "+GetPlayerName(Player(i4rr))+(" has another chance to play!|r")) call msgone(90,Player(i4rr),"Your demon gate has been respawned! Summon a new runner, before the hunters get you!",true) if GetKillingUnit()==RUNNER[GetPlayerId(p)] then call jBoard_TDHT.field(pik,0).addR(1) ))
каких-либо и все виды табло так легко с Multiboard с очень интересный код составляют magentix, и исправлена ​​ошибка мной.
Санкаку добавил:
У меня есть к сообщению снова, потому что я сломал 50000 символов? Я сообщению инструкции на русском языке, но некоторые из кода приводится в инструкции теряется в переводе... Отредактировано Санкаку, 18.05.2011 в 22:05. |
18.05.2011, 13:09 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Suite
┌_____┐
offline
Опыт:
11,222Активность: |
жду скрины и пример =0 |
18.05.2011, 13:25 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
SomeFire
Всего 20 символов...
offline
Опыт:
26,884Активность: |
Моя не понимать твой русский:( лучше пиши на английском, чтобы не извращать наш великий и могучий язык. |
18.05.2011, 13:42 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Doc
offline
Опыт:
63,163Активность: |
Nice, i think chaining is a good idea, and i also liked the idea with fields selection, but why do we need to declare every multiboard with textmacro? Why didn't you make syntax like that:
where 5 and 6 is cols and rows ? |
18.05.2011, 14:05 | #4
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Санкаку
offline
Опыт:
432Активность: |
|
18.05.2011, 21:41 | #5
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|