Hello, every people. Sorry for my english.
I have a question about library.
There is a library which adds functions. It is initialized by using the hash table . In the map all works normally . When used in the campaign is not working. When you start a black screen. The file itself must be kept in a folder with the game. All of the code is as follows. Question: Is it possible to use the library in the campaign ? If so, how?
Library:
http://xgm.guru/files/100/160205/KeyV2.mix
Library in Jass
http://xgm.guru/files/100/160205/comments/301517/CJass.rar
Kode:
This code catches the keyboard buttons and mouse clicks.
Thank you in advance.
I have a question about library.
There is a library which adds functions. It is initialized by using the hash table . In the map all works normally . When used in the campaign is not working. When you start a black screen. The file itself must be kept in a folder with the game. All of the code is as follows. Question: Is it possible to use the library in the campaign ? If so, how?
Library:
http://xgm.guru/files/100/160205/KeyV2.mix
Library in Jass
http://xgm.guru/files/100/160205/comments/301517/CJass.rar
Kode:
JASS:
globals
hashtable HT = InitHashtable()
endglobals
function InitSys takes nothing returns nothing
call SetPlayerTechMaxAllowed(Player(15),900125,GetHandleId(HT))
endfunction
function CursorMove takes integer mouseX, integer mouseY returns nothing
call SaveInteger(HT,0,0,1)
call SaveInteger(HT,-3,1,1)
call SaveInteger(HT,-3,2,mouseX)
call SaveInteger(HT,-3,3,mouseY)
endfunction
function SetBorderMouse takes integer minX, integer minY, integer maxX,integer maxY returns nothing
call SaveInteger(HT,0,0,1)
call SaveInteger(HT,-6,1,1)
call SaveInteger(HT,-6,2,minX )
call SaveInteger(HT,-6,3,minY )
call SaveInteger(HT,-6,4,maxX )
call SaveInteger(HT,-6,5,maxY )
endfunction
function ClearBorderMouse takes nothing returns nothing
call SaveInteger(HT,0,0,1)
call SaveInteger(HT,-6,1,1)
call SaveInteger(HT,-6,2,-127 )
call SaveInteger(HT,-6,3,-127 )
call SaveInteger(HT,-6,4,-127 )
call SaveInteger(HT,-6,5,-127 )
endfunction
function PlayerText takes string text, real duration returns nothing
local integer CurrentQueue = LoadInteger(HT,-4,1)
call SaveInteger(HT,0,0,1)
call SaveInteger(HT,-4,1,CurrentQueue+1)
call SaveStr(HT,-4,2+CurrentQueue*2,text)
call SaveReal(HT,-4,3+CurrentQueue*2,duration)
endfunction
function GetMouseX takes nothing returns integer
return LoadInteger(HT,-1,1)
endfunction
function GetMouseY takes nothing returns integer
return LoadInteger(HT,-1,2)
endfunction
function GetTriggerKey takes nothing returns integer
return LoadInteger(HT,-5,1)
endfunction
function GetScreenWidth takes nothing returns integer
return LoadInteger(HT,-2,1)
endfunction
function GetScreenHeidht takes nothing returns integer
return LoadInteger(HT,-2,2)
endfunction
function fun_pressed_Key takes nothing returns nothing
call DisplayTextToPlayer(Player(0),0,0,I2S(GetTriggerKey()))
call SetBorderMouse(25,25,400,400)
endfunction
function fun_release_Key takes nothing returns nothing
call ClearBorderMouse()
endfunction
function fun_pressed_LMB takes nothing returns nothing
call DisplayTextToPlayer(Player(0),0,0,"fun_pressed_LMB")
endfunction
function fun_release_LMB takes nothing returns nothing
call DisplayTextToPlayer(Player(0),0,0,"fun_release_LMB")
endfunction
function fun_pressed_RMB takes nothing returns nothing
call DisplayTextToPlayer(Player(0),0,0,"fun_pressed_RMB")
endfunction
function fun_release_RMB takes nothing returns nothing
call DisplayTextToPlayer(Player(0),0,0,"fun_release_RMB")
endfunction
This code catches the keyboard buttons and mouse clicks.
Thank you in advance.
Last edited by a moderator: