Name | Type | is_array | initial_value |
function UISetup takes nothing returns nothing
//Local Variables
local framehandle fh = null
local framehandle chatButton = null
local framehandle questButton = null
local framehandle allyButton = null
local framehandle MiniMap = null
local framehandle gridButtons = null
local framehandle imageTest = BlzCreateFrameByType("BACKDROP", "image", BlzGetFrameByName("ConsoleUIBackdrop", 0), "ButtonBackdropTemplate", 0)
//Top UI & System Buttons
set fh = BlzGetFrameByName("UpperButtonBarFrame", 0)
call BlzFrameSetVisible(fh, true)
set allyButton = BlzGetFrameByName("UpperButtonBarAlliesButton", 0)
set fh = BlzGetFrameByName("UpperButtonBarMenuButton", 0)
set chatButton = BlzGetFrameByName("UpperButtonBarChatButton", 0)
set questButton = BlzGetFrameByName("UpperButtonBarQuestsButton", 0)
call BlzFrameClearAllPoints(fh)
call BlzFrameClearAllPoints(allyButton)
call BlzFrameClearAllPoints(chatButton)
call BlzFrameClearAllPoints(questButton)
call BlzFrameSetAbsPoint(questButton, FRAMEPOINT_TOPLEFT, 0.77, 0.6)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.85, 0.6)
call BlzFrameSetAbsPoint(allyButton, FRAMEPOINT_TOPLEFT, 0.77, 0.583)
call BlzFrameSetAbsPoint(chatButton, FRAMEPOINT_TOPLEFT, 0.85, 0.583)
//Hiding clock UI and creating new frame bar
call BlzFrameSetTexture(imageTest, "UI\\ResourceBar.tga", 0, true)
call BlzFrameSetPoint(imageTest, FRAMEPOINT_TOP, BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0), FRAMEPOINT_TOP, 0, 0)
call BlzFrameSetSize(imageTest, 0.4, 0.025)
call BlzFrameSetVisible(BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 5), 0), false)
call BlzFrameSetLevel(imageTest, 1)
//Food
set fh = BlzGetFrameByName("ResourceBarSupplyText", 0)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.58, 0.5965)
//Upkeep
set fh = BlzGetFrameByName("ResourceBarUpkeepText", 0)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.295, 0.5965)
//Gold
set fh = BlzGetFrameByName("ResourceBarGoldText", 0)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.389, 0.5965)
//Lumber
set fh = BlzGetFrameByName("ResourceBarLumberText", 0)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.485, 0.5965)
//Bottom UI & Idle Worker Icon
set fh = BlzGetFrameByName("ConsoleUI", 0)
set fh = BlzFrameGetChild(fh, 7)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.09, 0.179)
//Remove Deadspace
set fh = BlzGetFrameByName("ConsoleUI", 0)
call BlzFrameSetVisible(BlzFrameGetChild(fh, 5), false)
//Minimap
set MiniMap = BlzGetFrameByName("MiniMapFrame", 0)
call BlzFrameSetVisible(MiniMap, true)
call BlzFrameClearAllPoints(MiniMap)
call BlzFrameSetAbsPoint(MiniMap, FRAMEPOINT_BOTTOMLEFT, 0.0525, 0.0)
call BlzFrameSetAbsPoint(MiniMap, FRAMEPOINT_TOPRIGHT, 0.2125, 0.141)
//Minimap Buttons
set fh = BlzGetFrameByName("MinimapSignalButton", 0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.222, 0.116)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.242, 0.136)
call BlzFrameSetTexture(fh, "UI\\ButtonBorder.dds", 0, true)
set fh = BlzGetFrameByName("MiniMapAllyButton", 0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.242, 0.116)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.262, 0.136)
call BlzFrameSetTexture(fh, "UI\\ButtonBorder.dds", 0, true)
set fh = BlzGetFrameByName("MiniMapTerrainButton", 0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.262, 0.116)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.282, 0.136)
call BlzFrameSetTexture(fh, "UI\\ButtonBorder.dds", 0, true)
set fh = BlzGetFrameByName("MiniMapCreepButton", 0)
call BlzFrameSetVisible(fh, false)
set fh = BlzGetFrameByName("FormationButton", 0)
call BlzFrameSetVisible(fh, false)
//Minimap Border
set fh = BlzCreateFrameByType("BACKDROP", "MinimapBorder", MiniMap, "", 0)
call BlzFrameSetPoint(fh, FRAMEPOINT_TOPLEFT, MiniMap, FRAMEPOINT_TOPLEFT, 0, 0)
call BlzFrameSetPoint(fh, FRAMEPOINT_BOTTOMRIGHT, MiniMap, FRAMEPOINT_BOTTOMRIGHT, 0, 0)
call BlzFrameSetTexture(fh, "UI\\MiniMapBorder.dds", 0, true)
//Tooltips
set fh = BlzGetOriginFrame(ORIGIN_FRAME_TOOLTIP, 0)
call BlzFrameSetVisible(fh, true)
set fh = BlzGetOriginFrame(ORIGIN_FRAME_UBERTOOLTIP, 0)
call BlzFrameSetVisible(fh, true)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMRIGHT, 0.7725, 0.141)
//Command Buttons
set gridButtons = BlzGetFrameByName("CommandBarFrame", 0)
call BlzFrameSetVisible(gridButtons, true)
call BlzFrameClearAllPoints(gridButtons)
call BlzFrameSetAbsPoint(gridButtons, FRAMEPOINT_BOTTOMLEFT, 0.5950, 0.005)
//Backdrop
set fh = BlzGetFrameByName("ConsoleUIBackdrop", 0)
call BlzFrameClearAllPoints(fh)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.052, 0)
call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.770, 0.141)
//Command buttons border
set fh = BlzCreateFrameByType("BACKDROP", "CommandBorder", MiniMap, "", 0)
call BlzFrameSetPoint(fh, FRAMEPOINT_TOPLEFT, gridButtons, FRAMEPOINT_TOPLEFT, -0.007, 0.007)
call BlzFrameSetPoint(fh, FRAMEPOINT_BOTTOMRIGHT, gridButtons, FRAMEPOINT_BOTTOMRIGHT, 0.0025, -0.005)
call BlzFrameSetTexture(fh, "UI\\CommandCard.dds", 0, true)
// Prevent multiplayer desyncs by forcing the creation of the QuestDialog frame
call BlzFrameClick(BlzGetFrameByName("UpperButtonBarQuestsButton", 0))
call ForceUICancel()
// Expand TextArea
call BlzFrameSetPoint(BlzGetFrameByName("QuestDisplay", 0), FRAMEPOINT_TOPLEFT, BlzGetFrameByName("QuestDetailsTitle", 0), FRAMEPOINT_BOTTOMLEFT, 0.003, -0.003)
call BlzFrameSetPoint(BlzGetFrameByName("QuestDisplay", 0), FRAMEPOINT_BOTTOMRIGHT, BlzGetFrameByName("QuestDisplayBackdrop", 0), FRAMEPOINT_BOTTOMRIGHT, -0.003, 0.)
// Relocate button
call BlzFrameSetPoint(BlzGetFrameByName("QuestDisplayBackdrop", 0), FRAMEPOINT_BOTTOM, BlzGetFrameByName("QuestBackdrop", 0), FRAMEPOINT_BOTTOM, 0., 0.017)
call BlzFrameClearAllPoints(BlzGetFrameByName("QuestAcceptButton", 0))
call BlzFrameSetPoint(BlzGetFrameByName("QuestAcceptButton", 0), FRAMEPOINT_TOPRIGHT, BlzGetFrameByName("QuestBackdrop", 0), FRAMEPOINT_TOPRIGHT, -0.016, -0.016)
call BlzFrameSetText(BlzGetFrameByName("QuestAcceptButton", 0), "×")
call BlzFrameSetSize(BlzGetFrameByName("QuestAcceptButton", 0), 0.03, 0.03)
// Add back ally resource icons
call BlzFrameSetTexture(BlzGetFrameByName("InfoPanelIconAllyGoldIcon", 7), "UI\\RGReplacement.dds", 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("InfoPanelIconAllyWoodIcon", 7), "UI\\RLReplacement.dds", 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("InfoPanelIconAllyFoodIcon", 7), "UI\\RSReplacement.dds", 0, false)
endfunction
scope init initializer Init
private function Init takes nothing returns nothing
call UISetup()
endfunction
endscope
library CameraSlider initializer init
globals
private real max_dist = 5000
private real min_dist = 500
private real array current_dist
endglobals
private function periodic takes nothing returns nothing
local integer i = 0
loop
exitwhen i > bj_MAX_PLAYERS
if Player(i) == GetLocalPlayer() then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, current_dist[i], 0)
call SetCameraField(CAMERA_FIELD_FARZ, 1.5 * current_dist[i], 0)
endif
set i = i + 1
endloop
endfunction
private function chatCam takes nothing returns nothing
local real zoom = S2R(SubString(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString())))
local integer pid = GetPlayerId(GetTriggerPlayer())
if zoom < min_dist then
set zoom = min_dist
elseif zoom > max_dist then
set zoom = max_dist
endif
set current_dist[pid] = zoom
endfunction
private function sliderCam takes nothing returns nothing
local real zoom = BlzGetTriggerFrameValue()
local integer pid = GetPlayerId(GetTriggerPlayer())
set current_dist[pid] = zoom
endfunction
private function init takes nothing returns nothing
local integer i = 0
local trigger chatTrigger = CreateTrigger()
local trigger CameraControl = CreateTrigger()
local framehandle VSlider = 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, 80, 80, 0) // Change values of alpha, red, green and blue for another custom color
call TimerStart(CreateTimer(), 0.1, true, function periodic) // change loop speed as desired.
call TriggerAddAction(chatTrigger, function chatCam)
loop
exitwhen i > bj_MAX_PLAYERS
call TriggerRegisterPlayerChatEvent(chatTrigger, Player(i), "-cam ", false)
set current_dist[i] = 1650 //default zoom
set i = i + 1
endloop
// Set parameter for the Slider
call BlzFrameSetSize(VSlider, 0.015, 0.085)
call BlzFrameSetAbsPoint(VSlider, FRAMEPOINT_BOTTOMLEFT, 0.2920, 0.022)
call BlzFrameSetMinMaxValue(VSlider, min_dist, max_dist)
call BlzFrameSetValue(VSlider, current_dist[0])
call BlzFrameSetStepSize(VSlider, 50)
// ... and for the SliderToolTip
call BlzFrameSetText(SliderToolTip, "") // Sets display text when hovered over the frame
call BlzFrameSetScale(SliderToolTip, 1.60)
call BlzFrameSetTextColor(SliderToolTip, Color)
call BlzFrameSetAbsPoint(SliderToolTip, FRAMEPOINT_BOTTOMLEFT, 0.22, 0.16)
call BlzFrameSetTooltip(VSlider, SliderToolTip)
// Add event and callback to trigger for the Slider
call BlzTriggerRegisterFrameEvent(CameraControl, VSlider, FRAMEEVENT_SLIDER_VALUE_CHANGED)
call TriggerAddAction(CameraControl, function sliderCam)
set VSlider = null
set CameraControl = null
endfunction
endlibrary
library TimerUpdate initializer init
globals
integer GameTimeSec = 1
endglobals
function Sec2Timer takes integer i returns string
local integer timeSec = i
local integer timeMin = 0
local string timeString = ""
set timeMin = timeSec / 60
set timeSec = timeSec - (timeMin * 60)
if timeMin < 10 then
set timeString = "0" + I2S(timeMin) + ":"
else
set timeString = I2S(timeMin) + ":"
endif
if timeSec < 10 then
set timeString = timeString + "0" + I2S(timeSec)
else
set timeString = timeString + I2S(timeSec)
endif
return timeString
endfunction
private function periodic takes nothing returns nothing
local framehandle timerTextFrame = BlzGetFrameByName("ResourceBarUpkeepText", 0)
set GameTimeSec = (GameTimeSec + 1)
call BlzFrameSetText(timerTextFrame, Sec2Timer(GameTimeSec))
endfunction
private function init takes nothing returns nothing
call TimerStart(CreateTimer(), 1, true, function periodic)
endfunction
endlibrary
//Coming soon!
//Coming soon!
//Coming soon!