function UpdateCamera takes nothing returns boolean
local real distance=BlzGetTriggerFrameValue()
local real farZ=distance+2100
if (GetTriggerPlayer()==GetLocalPlayer()) then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, distance, 0)
call SetCameraField(CAMERA_FIELD_FARZ, farZ, 0 )
call SetTerrainFogEx(0, farZ, farZ, 0, 1.00, 1.00, 1.00)
endif
return false
endfunction
function Camera_Zoom_Slider takes nothing returns nothing
local trigger cameraZoomSlider=CreateTrigger()
local framehandle verticalSlider=BlzCreateFrameByType("SLIDER", "distance", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "QuestMainListScrollBar", 0)
local framehandle sliderToolTip=BlzCreateFrameByType("TEXT", "SliderTitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
local integer color= BlzConvertColor(255, 255, 255, 0)
// Set parametees for the Slider...
// call BlzFrameSetVertexColor(verticalSlider, color) // does not work
call BlzFrameSetSize(verticalSlider, 0.018, 0.076)
call BlzFrameSetAbsPoint(verticalSlider, FRAMEPOINT_BOTTOMLEFT, 0.20, 0.027)
call BlzFrameSetMinMaxValue(verticalSlider, 100, 7900)
call BlzFrameSetValue(verticalSlider, 2600)
call BlzFrameSetStepSize(verticalSlider, 50)
// ... and for the sliderToolTip
call BlzFrameSetTextColor(sliderToolTip, color)
call BlzFrameSetText(sliderToolTip, "USE THIS SLIDER TO CONTROL THE CAMERA ZOOM")
call BlzFrameSetScale(sliderToolTip, 1.60)
call BlzFrameSetAbsPoint(sliderToolTip, FRAMEPOINT_BOTTOMLEFT, 0.22, 0.16)
call BlzFrameSetTooltip(verticalSlider, sliderToolTip)
// Set Initial camera distance for all players
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 2600, 0)
// Add event and actions in conditions to trigger for the Slider
call BlzTriggerRegisterFrameEvent(cameraZoomSlider, verticalSlider, FRAMEEVENT_SLIDER_VALUE_CHANGED)
call TriggerAddCondition(cameraZoomSlider, function UpdateCamera)
// nulling
set verticalSlider=null
set sliderToolTip=null
set cameraZoomSlider=null
endfunction