| 03-03-2005, 01:52 AM | #1 |
After a closer look at the new common.j I found quite a bunch of interesting stuff. Here's the list: Code:
type pathingtype extends handle type image extends handle type ubersplat extends handle constant pathingtype PATHING_TYPE_ANY = ConvertPathingType(0) constant pathingtype PATHING_TYPE_WALKABILITY = ConvertPathingType(1) constant pathingtype PATHING_TYPE_FLYABILITY = ConvertPathingType(2) constant pathingtype PATHING_TYPE_BUILDABILITY = ConvertPathingType(3) constant pathingtype PATHING_TYPE_PEONHARVESTPATHING = ConvertPathingType(4) constant pathingtype PATHING_TYPE_BLIGHTPATHING = ConvertPathingType(5) constant pathingtype PATHING_TYPE_FLOATABILITY = ConvertPathingType(6) constant pathingtype PATHING_TYPE_AMPHIBIOUSPATHING = ConvertPathingType(7) //============================================================================ // Visual API // native SetTextTagSuspended takes texttag t, boolean flag returns nothing native SetTextTagPermanent takes texttag t, boolean flag returns nothing native SetTextTagAge takes texttag t, real age returns nothing native SetTextTagLifespan takes texttag t, real lifespan returns nothing native SetTextTagFadepoint takes texttag t, real fadepoint returns nothing native EnableDragSelect takes boolean state, boolean ui returns nothing native EnablePreSelect takes boolean state, boolean ui returns nothing native EnableSelect takes boolean state, boolean ui returns nothing //============================================================================ // Effects API // native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning native MoveLightningEx takes lightning whichBolt, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns boolean //============================================================================ // Terrain API // native GetTerrainType takes real x, real y returns integer native GetTerrainVariance takes real x, real y returns integer native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing native IsTerrainPathable takes real x, real y, pathingtype t returns boolean native SetTerrainPathable takes real x, real y, pathingtype t, boolean flag returns nothing //============================================================================ // Image API // native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image native DestroyImage takes image whichImage returns nothing native ShowImage takes image whichImage, boolean flag returns nothing native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing native SetImagePosition takes image whichImage, real x, real y, real z returns nothing native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing native SetImageRender takes image whichImage, boolean flag returns nothing native SetImageRenderAlways takes image whichImage, boolean flag returns nothing native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing native SetImageType takes image whichImage, integer imageType returns nothing //============================================================================ // Ubersplat API // native CreateUbersplat takes real x, real y, string name, integer red, integer green, integer blue, integer alpha, boolean forcePaused, boolean noBirthTime returns ubersplat native DestroyUbersplat takes ubersplat whichSplat returns nothing native ResetUbersplat takes ubersplat whichSplat returns nothing native FinishUbersplat takes ubersplat whichSplat returns nothing native ShowUbersplat takes ubersplat whichSplat, boolean flag returns nothing native SetUbersplatRender takes ubersplat whichSplat, boolean flag returns nothing native SetUbersplatRenderAlways takes ubersplat whichSplat, boolean flag returns nothing native GetLocationZ takes location whichLocation returns real The splat and image API as well as the pathingtype constants look really promising. Also SetTerrainType should allow us to dynamically place tiles. Afterall the patch is better than it seemed at the beginning. BTW the Trigger-Name Function is just a lame helper that doesn't actually have a JASS implementation. It just creates a string literal with the name of 'this trigger' for those that can't manage to correctly type a trigger name twice. |
| 03-03-2005, 10:29 AM | #2 |
Here're changes in blizzard.j: Code:
a) Added global variables:
image bj_lastCreatedImage = null // 用于CreateImageBJ
ubersplat bj_lastCreatedUbersplat = null // 用于CreateUbersplatBJ
b) Changed functions:
// Changed to use AddLightningEx
function AddLightningLoc takes string codeName, location where1, location where2 returns lightning
set bj_lastCreatedLightning = AddLightningEx(codeName, true, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
return bj_lastCreatedLightning
endfunction
// Changed to use MoveLightningEx
function MoveLightningLoc takes lightning whichBolt, location where1, location where2 returns boolean
return MoveLightningEx(whichBolt, true, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
endfunction
// First parameter is changed from string abilString to integer abilcode
function GetAbilityEffectBJ takes integer abilcode, effecttype t, integer index returns string
return GetAbilityEffectById(abilcode, t, index)
endfunction
// First parameter is changed from string abilString to integer abilcode
function GetAbilitySoundBJ takes integer abilcode, soundtype t returns string
return GetAbilitySoundById(abilcode, t)
endfunction
// Changed from using SetTextTagText to using SetTextTagTextBJ
function CreateTextTagLocBJ takes string s, location loc, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
call SetTextTagPosBJ(bj_lastCreatedTextTag, loc, zOffset)
call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)
return bj_lastCreatedTextTag
endfunction
// Changed from using SetTextTagText to using SetTextTagTextBJ
function CreateTextTagUnitBJ takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
call SetTextTagPosUnitBJ(bj_lastCreatedTextTag, whichUnit, zOffset)
call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)
return bj_lastCreatedTextTag
endfunction
c)Added functions:
function GetTerrainTypeBJ takes location where returns integer
return GetTerrainType(GetLocationX(where), GetLocationY(where))
endfunction
function GetTerrainVarianceBJ takes location where returns integer
return GetTerrainVariance(GetLocationX(where), GetLocationY(where))
endfunction
function SetTerrainTypeBJ takes location where, integer terrainType, integer variation, integer area, integer shape returns nothing
call SetTerrainType(GetLocationX(where), GetLocationY(where), terrainType, variation, area, shape)
endfunction
function IsTerrainPathableBJ takes location where, pathingtype t returns boolean
return IsTerrainPathable(GetLocationX(where), GetLocationY(where), t)
endfunction
function SetTerrainPathableBJ takes location where, pathingtype t, boolean flag returns nothing
call SetTerrainPathable(GetLocationX(where), GetLocationY(where), t, flag)
endfunction
function CreateImageBJ takes string file, real size, location where, real zOffset, integer imageType returns image
set bj_lastCreatedImage = CreateImage(file, size, size, size, GetLocationX(where), GetLocationY(where), zOffset, 0, 0, 0, imageType)
return bj_lastCreatedImage
endfunction
function ShowImageBJ takes boolean flag, image whichImage returns nothing
call ShowImage(whichImage, flag)
endfunction
function SetImagePositionBJ takes image whichImage, location where, real zOffset returns nothing
call SetImagePosition(whichImage, GetLocationX(where), GetLocationY(where), zOffset)
endfunction
function SetImageColorBJ takes image whichImage, real red, real green, real blue, real alpha returns nothing
call SetImageColor(whichImage, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-alpha))
endfunction
function GetLastCreatedImage takes nothing returns image
return bj_lastCreatedImage
endfunction
function CreateUbersplatBJ takes location where, string name, real red, real green, real blue, real alpha, boolean forcePaused, boolean noBirthTime returns ubersplat
set bj_lastCreatedUbersplat = CreateUbersplat(GetLocationX(where), GetLocationY(where), name, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-alpha), forcePaused, noBirthTime)
return bj_lastCreatedUbersplat
endfunction
function ShowUbersplatBJ takes boolean flag, ubersplat whichSplat returns nothing
call ShowUbersplat(whichSplat, flag)
endfunction
function GetLastCreatedUbersplat takes nothing returns ubersplat
return bj_lastCreatedUbersplat
endfunction
function SetTextTagTextBJ takes texttag tt, string s, real size returns nothing
local real textHeight = TextTagSize2Height(size)
call SetTextTagText(tt, s, textHeight)
endfunction
function SetTextTagPosBJ takes texttag tt, location loc, real zOffset returns nothing
call SetTextTagPos(tt, GetLocationX(loc), GetLocationY(loc), zOffset)
endfunction
function SetTextTagPosUnitBJ takes texttag tt, unit whichUnit, real zOffset returns nothing
call SetTextTagPosUnit(tt, whichUnit, zOffset)
endfunction
function SetTextTagSuspendedBJ takes texttag tt, boolean flag returns nothing
call SetTextTagSuspended(tt, flag)
endfunction
function SetTextTagPermanentBJ takes texttag tt, boolean flag returns nothing
call SetTextTagPermanent(tt, flag)
endfunction
function SetTextTagAgeBJ takes texttag tt, real age returns nothing
call SetTextTagAge(tt, age)
endfunction
function SetTextTagLifespanBJ takes texttag tt, real lifespan returns nothing
call SetTextTagLifespan(tt, lifespan)
endfunction
function SetTextTagFadepointBJ takes texttag tt, real fadepoint returns nothing
call SetTextTagFadepoint(tt, fadepoint)
endfunction |
