Name | Type | is_array | initial_value |
GameStatus = {
--[[
by TriggerHappy converted by Tasyen
Simple API for detecting if the game is online, offline, or a replay.
How To use:
At 0s GameStatus.Init()
GameStatus.OFFLINE
GameStatus.REPLAY
GameStatus.ONLINE
GameStatus.Status
]]
-- The dummy unit is only created once, and removed directly after.
DUMMY_UNIT_ID = FourCC'hfoo'
,Status = 0
,OFFLINE = 0
,ONLINE = 1
,REPLAY = 2
,Init = function()
GameStatus.Init = DoNothing
local firstPlayer = Player(0)
local u
local selected
-- find an actual player
for i = 0, bj_MAX_PLAYER_SLOTS do
firstPlayer = Player(i)
if (GetPlayerController(firstPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(firstPlayer) == PLAYER_SLOT_STATE_PLAYING) then break end
end
-- force the player to select a dummy unit
u = CreateUnit(firstPlayer, GameStatus.DUMMY_UNIT_ID, 0, 0, 0)
SelectUnit(u, true)
selected = IsUnitSelected(u, firstPlayer)
RemoveUnit(u)
u = nil
if (selected) then
-- detect if replay or offline game
if (ReloadGameCachesFromDisk()) then
GameStatus.Status = GameStatus.OFFLINE
else
GameStatus.Status = GameStatus.REPLAY
end
else
-- if the unit wasn't selected instantly, the game is online
GameStatus.Status = GameStatus.ONLINE
end
return GameStatus.Status
end
}
-- in 1.31 and upto 1.32.9 PTR (when I wrote this). Frames are not correctly saved and loaded, breaking the game.
-- This runs all functions added to it with a 0s delay after the game was loaded.
FrameLoader = {
OnLoadTimer = function ()
for _,v in ipairs(FrameLoader) do v() end
end
,OnLoadAction = function()
TimerStart(FrameLoader.Timer, 0, false, FrameLoader.OnLoadTimer)
end
}
function FrameLoaderAdd(func)
if not FrameLoader.Timer then
FrameLoader.Trigger = CreateTrigger()
FrameLoader.Timer = CreateTimer()
TriggerRegisterGameEvent(FrameLoader.Trigger, EVENT_GAME_LOADED)
TriggerAddAction(FrameLoader.Trigger, FrameLoader.OnLoadAction)
end
table.insert(FrameLoader, func)
end
--[[
CustomConsoleUI by Tasyen
CustomConsoleUI allows to change the UI during the game, when setuped correctly. This excludes the mouse cursor and the UI sounds.
In non reforged it can also not change the Idle worker Button nor the no inventory cover.
How to setup this: First you have to make the default Console Textures be hidden that is done in Game Interface.
Set ConsoleTexture01 to ConsoleTexture06 to UI\Widgets\EscMenu\Human\blank-background.blp
The Day of Time clock has hardcoded textures therefore you need to swap it out. That also should be done in Gameinterface.
TimeOfDayIndicator to the model included in this system.
Now export and Import war3mapImported\CustomConsoleUI.toc & war3mapImported\CustomConsoleUI.fdf
Finally you have to set the used textures into local data
UseCustomConsole(player, index)
CreateCustomConsole()
--]]
do
local AutoRun = true -- false call CustomConsoleUIInit() and if FrameLoaderAdd then FrameLoaderAdd(CustomConsoleUIInit) end
local idleWorkerButton, idleWorkerButtonOverlay, idleWorkerButtonOverlayParent
local customInventoryCoverParent, customInventoryCover
local data = {
[GetHandleId(RACE_HUMAN)] = { --1
"ui\\console\\human\\humanuitile01",
"ui\\console\\human\\humanuitile02",
"ui\\console\\human\\humanuitile03",
"ui\\console\\human\\humanuitile04",
"ui\\console\\human\\humanuitile05",
"ui\\console\\human\\humanuitile06",
"ui\\console\\human\\humanuitile-timeindicatorframe",
"ui\\console\\human\\humanuitile-inventorycover",
"ReplaceableTextures\\CommandButtons\\BTNPeasant",
-- postion offset
x = 0.0009,
y = 0.0
},
[GetHandleId(RACE_ORC)] = { --2
"ui\\console\\orc\\orcuitile01",
"ui\\console\\orc\\orcuitile02",
"ui\\console\\orc\\orcuitile03",
"ui\\console\\orc\\orcuitile04",
"ui\\console\\orc\\orcuitile05",
"ui\\console\\orc\\orcuitile06",
"ui\\console\\orc\\orcuitile-timeindicatorframe",
"ui\\console\\orc\\orcuitile-inventorycover",
"ReplaceableTextures\\CommandButtons\\BTNPeon",
x = 0.0009,
y = 0.0
},
[GetHandleId(RACE_UNDEAD)] = { --3
"ui\\console\\undead\\undeaduitile01",
"ui\\console\\undead\\undeaduitile02",
"ui\\console\\undead\\undeaduitile03",
"ui\\console\\undead\\undeaduitile04",
"ui\\console\\undead\\undeaduitile05",
"ui\\console\\undead\\undeaduitile06",
"ui\\console\\undead\\undeaduitile-timeindicatorframe",
"ui\\console\\undead\\undeaduitile-inventorycover",
"ReplaceableTextures\\CommandButtons\\BTNAcolyte",
x = 0.0009,
y = 0.0
},
[GetHandleId(RACE_NIGHTELF)] = { --4
"ui\\console\\nightelf\\nightelfuitile01",
"ui\\console\\nightelf\\nightelfuitile02",
"ui\\console\\nightelf\\nightelfuitile03",
"ui\\console\\nightelf\\nightelfuitile04",
"ui\\console\\nightelf\\nightelfuitile05",
"ui\\console\\nightelf\\nightelfuitile06",
"ui\\console\\nightelf\\nightelfuitile-timeindicatorframe",
"ui\\console\\nightelf\\nightelfuitile-inventorycover",
"ReplaceableTextures\\CommandButtons\\BTNWisp",
x = 0.0009,
y = 0.0
},
[GetHandleId(RACE_DEMON)] = { --5
"ui\\console\\human\\humanuitile01",
"ui\\console\\human\\humanuitile02",
"ui\\console\\human\\humanuitile03",
"ui\\console\\human\\humanuitile04",
"ui\\console\\human\\humanuitile05",
"ui\\console\\human\\humanuitile06",
"ui\\console\\human\\humanuitile-timeindicatorframe",
"ui\\console\\human\\humanuitile-inventorycover",
"ReplaceableTextures\\CommandButtons\\BTNPeasant",
x = 0.0009,
y = 0.0
},
[GetHandleId(RACE_OTHER)] = { --7
"ui\\console\\human\\humanuitile01",
"ui\\console\\human\\humanuitile02",
"ui\\console\\human\\humanuitile03",
"ui\\console\\human\\humanuitile04",
"ui\\console\\human\\humanuitile05",
"ui\\console\\human\\humanuitile06",
"ui\\console\\human\\humanuitile-timeindicatorframe",
"ui\\console\\human\\humanuitile-inventorycover",
"ReplaceableTextures\\CommandButtons\\BTNPeasant",
x = 0.0009,
y = 0.0
}
}
function UseCustomConsole(player, index)
if GetLocalPlayer() ~= player then return end
if not index then index = GetHandleId(GetPlayerRace(player)) end
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI5T", 0), data[index][5], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI6T", 0), data[index][6], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI4T", 0), data[index][4], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI3T", 0), data[index][3], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2TL", 0), data[index][2], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2TR", 0), data[index][2] , 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI1T", 0), data[index][1], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI1B", 0), data[index][1], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2B", 0), data[index][2], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI3B", 0), data[index][3], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI4B", 0), data[index][4], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI5B", 0), data[index][5], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI6B", 0), data[index][6], 0, false)
BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUIClock", 0), data[index][7] ,0, true)
if GetLocalizedString("REFORGED") ~= "REFORGED" then
BlzFrameSetTexture(BlzGetFrameByName("InventoryCoverTexture", 0), data[index][8] ,0, true)
BlzFrameSetTexture(idleWorkerButtonOverlay, data[index][9], 0, false)
else
BlzFrameSetTexture(customInventoryCover, data[index][8] ,0, true)
end
if data[index].x then BlzFrameSetPoint(BlzGetFrameByName("CustomConsoleUIClock", 0), FRAMEPOINT_TOP, BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_TOP, data[index].x, data[index].y) end
end
function CreateCustomConsole()
BlzLoadTOCFile( "war3mapimported\\CustomConsoleUI.toc" )
BlzCreateSimpleFrame( "CustomConsoleUI", BlzGetFrameByName("ConsoleUI", 0), 0)
BlzFrameSetLevel(BlzGetFrameByName("CustomConsoleUI", 0), 0)
if GetLocalizedString("REFORGED") ~= "REFORGED" then
idleWorkerButton = BlzFrameGetChild(BlzGetFrameByName("ConsoleBottomBar", 0), 3)
idleWorkerButtonOverlayParent = BlzCreateSimpleFrame( "SimpleTextureFrame", idleWorkerButton, 0 )
idleWorkerButtonOverlay = BlzGetFrameByName("SimpleTextureFrameValue", 0)
BlzFrameSetAllPoints(idleWorkerButtonOverlay, idleWorkerButton)
BlzFrameSetLevel(idleWorkerButtonOverlayParent, 4)
if GameStatus then
GameStatus.Init()
if GameStatus.Status == GameStatus.REPLAY then
-- BlzFrameSetVisible(idleWorkerButtonOverlayParent, false)
end
end
else
customInventoryCoverParent = BlzCreateSimpleFrame( "SimpleTextureFrame", BlzGetFrameByName("ConsoleUI", 0), 0)
BlzFrameSetLevel(customInventoryCoverParent, 4)
customInventoryCover = BlzGetFrameByName("SimpleTextureFrameValue", 0)
BlzFrameSetAbsPoint(customInventoryCover, FRAMEPOINT_BOTTOMRIGHT, 0.6, 0)
BlzFrameSetAbsPoint(customInventoryCover, FRAMEPOINT_TOPLEFT, 0.6 - 0.128, 0.2558)
end
-- Preload
BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)
BlzGetFrameByName("InventoryCoverTexture", 0)
BlzGetFrameByName("CustomConsoleUIClock", 0)
BlzGetFrameByName("CustomConsoleUI5T", 0)
BlzGetFrameByName("CustomConsoleUI6T", 0)
BlzGetFrameByName("CustomConsoleUI4T", 0)
BlzGetFrameByName("CustomConsoleUI3T", 0)
BlzGetFrameByName("CustomConsoleUI2TL", 0)
BlzGetFrameByName("CustomConsoleUI2TR", 0)
BlzGetFrameByName("CustomConsoleUI1T", 0)
BlzGetFrameByName("CustomConsoleUI1B", 0)
BlzGetFrameByName("CustomConsoleUI2B", 0)
BlzGetFrameByName("CustomConsoleUI3B", 0)
BlzGetFrameByName("CustomConsoleUI4B", 0)
BlzGetFrameByName("CustomConsoleUI5B", 0)
BlzGetFrameByName("CustomConsoleUI6B", 0)
end
function CustomConsoleUIInit()
CreateCustomConsole()
UseCustomConsole(GetLocalPlayer())
if GetLocalizedString("REFORGED") == "REFORGED" then
TimerStart(CreateTimer(), 1/32.0, true, function()
BlzFrameSetVisible(customInventoryCoverParent, not BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)))
end)
end
end
if AutoRun then
local real = MarkGameStarted
function MarkGameStarted()
xpcall(function()
real()
CustomConsoleUIInit()
if FrameLoaderAdd then FrameLoaderAdd(CustomConsoleUIInit) end
end, print)
end
end
end
do
local real = MarkGameStarted
function MarkGameStarted()
xpcall(function()
real()
local trigger = CreateTrigger()
for i=0, 23 do
TriggerRegisterPlayerChatEvent(trigger, Player(i), "", false )
end
TriggerAddAction(trigger, function()
xpcall(function()
local text = string.lower(GetEventPlayerChatString())
local player = GetTriggerPlayer()
if text == "human" then
UseCustomConsole(player, 1)
end
if text == "orc" then
UseCustomConsole(player, 2)
end
if text == "undead" then
UseCustomConsole(player, 3)
end
if text == "nightelf" then
UseCustomConsole(player, 4)
end
end, print)
end)
BlzLoadTOCFile( "war3mapimported\\Templates.toc" )
local frameA = BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local frameB = BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local frameC = BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local frameD = BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local frameE = BlzCreateFrame("EscMenuEditBoxTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
BlzFrameSetAbsPoint(frameA, FRAMEPOINT_TOPRIGHT, 0.78, 0.4)
BlzFrameSetAbsPoint(frameB, FRAMEPOINT_TOPRIGHT, 0.78, 0.36)
BlzFrameSetAbsPoint(frameC, FRAMEPOINT_TOPRIGHT, 0.78, 0.32)
BlzFrameSetAbsPoint(frameD, FRAMEPOINT_TOPRIGHT, 0.78, 0.28)
BlzFrameSetAbsPoint(frameE, FRAMEPOINT_TOPRIGHT, 0.78, 0.24)
BlzFrameSetSize(frameA, 0.06, 0.04)
BlzFrameSetSize(frameB, 0.06, 0.04)
BlzFrameSetSize(frameC, 0.06, 0.04)
BlzFrameSetSize(frameD, 0.06, 0.04)
BlzFrameSetSize(frameE, 0.06, 0.04)
BlzFrameSetText(frameA, "0.128")
BlzFrameSetText(frameB, "0.064")
BlzFrameSetText(frameC, "0.0009")
BlzFrameSetText(frameD, "0.000")
BlzFrameSetText(frameE, "4")
trigger = CreateTrigger()
BlzTriggerRegisterFrameEvent(trigger, frameA, FRAMEEVENT_EDITBOX_ENTER)
BlzTriggerRegisterFrameEvent(trigger, frameB, FRAMEEVENT_EDITBOX_ENTER)
BlzTriggerRegisterFrameEvent(trigger, frameC, FRAMEEVENT_EDITBOX_ENTER)
BlzTriggerRegisterFrameEvent(trigger, frameD, FRAMEEVENT_EDITBOX_ENTER)
BlzTriggerRegisterFrameEvent(trigger, frameE, FRAMEEVENT_EDITBOX_ENTER)
TriggerAddAction(trigger, function()
local x = tonumber(BlzFrameGetText(frameA))
local y = tonumber(BlzFrameGetText(frameB))
local x2 = tonumber(BlzFrameGetText(frameC))
local y2 = tonumber(BlzFrameGetText(frameD))
print(x,y,x2,y2)
BlzFrameSetSize(BlzGetFrameByName("CustomConsoleUIClock", 0), x, y)
BlzFrameSetPoint(BlzGetFrameByName("CustomConsoleUIClock", 0), FRAMEPOINT_TOP, BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_TOP, x2, y2)
BlzFrameSetLevel(idleWorkerButtonOverlayParent, tonumber(BlzFrameGetText(frameE)))
end)
end, print)
end
end
library GameStatus uses optional PlayerUtils
/***************************************************************
*
* v1.0.0 by TriggerHappy
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* Simple API for detecting if the game is online, offline, or a replay.
* _________________________________________________________________________
* 1. Installation
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* Copy the script to your map and save it (requires JassHelper *or* JNGP)
* _________________________________________________________________________
* 2. API
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
* This library provides one function
*
* function GetGameStatus takes nothing returns integer
*
* It returns one of the following constants
*
* - GAME_STATUS_OFFLINE
* - GAME_STATUS_ONLINE
* - GAME_STATUS_REPLAY
*
***************************************************************/
// Configuration:
globals
// The dummy unit is only created once, and removed directly after.
private constant integer DUMMY_UNIT_ID = 'hfoo'
endglobals
// (end)
globals
constant integer GAME_STATUS_OFFLINE = 0
constant integer GAME_STATUS_ONLINE = 1
constant integer GAME_STATUS_REPLAY = 2
private integer status = 0
endglobals
function GetGameStatus takes nothing returns integer
return status
endfunction
private module GameStatusInit
private static method onInit takes nothing returns nothing
local player firstPlayer
local unit u
local boolean selected
// find an actual player
static if not (LIBRARY_PlayerUtils) then
set firstPlayer = Player(0)
loop
exitwhen (GetPlayerController(firstPlayer) == MAP_CONTROL_USER and GetPlayerSlotState(firstPlayer) == PLAYER_SLOT_STATE_PLAYING)
set firstPlayer = Player(GetPlayerId(firstPlayer)+1)
endloop
else
set firstPlayer = User.fromPlaying(0).toPlayer()
endif
// force the player to select a dummy unit
set u = CreateUnit(firstPlayer, DUMMY_UNIT_ID, 0, 0, 0)
call SelectUnit(u, true)
set selected = IsUnitSelected(u, firstPlayer)
call RemoveUnit(u)
set u = null
if (selected) then
// detect if replay or offline game
if (ReloadGameCachesFromDisk()) then
set status = GAME_STATUS_OFFLINE
else
set status = GAME_STATUS_REPLAY
endif
else
// if the unit wasn't selected instantly, the game is online
set status = GAME_STATUS_ONLINE
endif
endmethod
endmodule
private struct GameStatus
implement GameStatusInit
endstruct
endlibrary
library FrameLoader initializer init_function
// in 1.31 and upto 1.32.9 PTR (when I wrote this). Frames are not correctly saved and loaded, breaking the game.
// This library runs all functions added to it with a 0s delay after the game was loaded.
// function FrameLoaderAdd takes code func returns nothing
// func runs when the game is loaded.
globals
private trigger eventTrigger = CreateTrigger()
private trigger actionTrigger = CreateTrigger()
private timer t = CreateTimer()
endglobals
function FrameLoaderAdd takes code func returns nothing
call TriggerAddAction(actionTrigger, func)
endfunction
private function timerAction takes nothing returns nothing
call TriggerExecute(actionTrigger)
endfunction
private function eventAction takes nothing returns nothing
call TimerStart(t, 0, false, function timerAction)
endfunction
private function init_function takes nothing returns nothing
call TriggerRegisterGameEvent(eventTrigger, EVENT_GAME_LOADED)
call TriggerAddAction(eventTrigger, function eventAction)
endfunction
endlibrary
library CustomConsoleUI initializer init_function requires optional FrameLoader, optional GameStatus
// CustomConsoleUI by Tasyen
// CustomConsoleUI allows to change the UI during the game, when setuped correctly. This excludes the mouse cursor and the UI sounds.
// In non reforged it can also not change the Idle worker Button nor the no inventory cover.
// How to setup this: First you have to make the default Console Textures be hidden that is done in Game Interface.
// Set ConsoleTexture01 to ConsoleTexture06 to UI\Widgets\EscMenu\Human\blank-background.blp
// The Day of Time clock has hardcoded textures therefore you need to swap it out. That also should be done in Gameinterface.
// TimeOfDayIndicator to the model included in this system.
// Now export and Import war3mapImported\CustomConsoleUI.toc & war3mapImported\CustomConsoleUI.fdf
// Finally you have to set the used textures into local data
globals
// workerFace = true can only be used when you save the map in 1.32.6+
private constant boolean workerFace = false
private framehandle idleWorkerButton
private framehandle idleWorkerButtonOverlay
private framehandle idleWorkerButtonOverlayParent
private framehandle customInventoryCover
private framehandle customInventoryCoverParent
public string array data
public integer array dataCount
private integer dataPageSize = 11
public real array x
public real array y
endglobals
function AddCustomConsole takes integer index, string texture returns nothing
set dataCount[index] = dataCount[index] + 1
set data[index*dataPageSize + dataCount[index]] = texture
endfunction
function UseCustomConsole takes player p, integer index returns nothing
local integer pageValue
if GetLocalPlayer() != p then
return
endif
if index < 1 then
set index = GetHandleId(GetPlayerRace(p))
endif
set pageValue = index*dataPageSize
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI5T", 0), data[pageValue + 5], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI6T", 0), data[pageValue + 6], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI4T", 0), data[pageValue + 4], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI3T", 0), data[pageValue + 3], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2TL", 0), data[pageValue + 2], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2TR", 0), data[pageValue + 2], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI1T", 0), data[pageValue + 1], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI1B", 0), data[pageValue + 1], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI2B", 0), data[pageValue + 2], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI3B", 0), data[pageValue + 3], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI4B", 0), data[pageValue + 4], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI5B", 0), data[pageValue + 5], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUI6B", 0), data[pageValue + 6], 0, false)
call BlzFrameSetTexture(BlzGetFrameByName("CustomConsoleUIClock", 0), data[pageValue + 7] ,0, true)
if GetLocalizedString("REFORGED") != "REFORGED" then
call BlzFrameSetTexture(BlzGetFrameByName("InventoryCoverTexture", 0), data[pageValue + 8] ,0, true)
static if workerFace then
call BlzFrameSetTexture(idleWorkerButtonOverlay, data[pageValue + 9], 0, false)
endif
else
call BlzFrameSetTexture(customInventoryCover, data[pageValue + 8] ,0, true)
endif
call BlzFrameSetPoint(BlzGetFrameByName("CustomConsoleUIClock", 0), FRAMEPOINT_TOP, BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_TOP, x[index], y[index])
endfunction
function CreateCustomConsole takes nothing returns nothing
call BlzLoadTOCFile( "war3mapimported\\CustomConsoleUI.toc" )
call BlzCreateSimpleFrame( "CustomConsoleUI", BlzGetFrameByName("ConsoleUI", 0), 0)
call BlzFrameSetLevel(BlzGetFrameByName("CustomConsoleUI", 0), 0)
if GetLocalizedString("REFORGED") != "REFORGED" then
// Requires a native existing only in Reforged
static if workerFace then
set idleWorkerButton = BlzFrameGetChild(BlzGetFrameByName("ConsoleBottomBar", 0), 3)
set idleWorkerButtonOverlayParent = BlzCreateSimpleFrame( "SimpleTextureFrame", idleWorkerButton, 0 )
set idleWorkerButtonOverlay = BlzGetFrameByName("SimpleTextureFrameValue", 0)
call BlzFrameSetAllPoints(idleWorkerButtonOverlay, idleWorkerButton)
call BlzFrameSetLevel(idleWorkerButtonOverlayParent, 4)
static if LIBRARY_GameStatus then
if GetGameStatus() == GAME_STATUS_REPLAY then
// call BlzFrameSetVisible(idleWorkerButtonOverlayParent, false)
endif
endif
endif
else
set customInventoryCoverParent = BlzCreateSimpleFrame( "SimpleTextureFrame", BlzGetFrameByName("ConsoleUI", 0), 0)
call BlzFrameSetLevel(customInventoryCoverParent, 4)
set customInventoryCover = BlzGetFrameByName("SimpleTextureFrameValue", 0)
call BlzFrameSetAbsPoint(customInventoryCover, FRAMEPOINT_BOTTOMRIGHT, 0.6, 0)
call BlzFrameSetAbsPoint(customInventoryCover, FRAMEPOINT_TOPLEFT, 0.6 - 0.128, 0.2558)
endif
// Preload
call BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)
call BlzGetFrameByName("InventoryCoverTexture", 0)
call BlzGetFrameByName("CustomConsoleUIClock", 0)
call BlzGetFrameByName("CustomConsoleUI5T", 0)
call BlzGetFrameByName("CustomConsoleUI6T", 0)
call BlzGetFrameByName("CustomConsoleUI4T", 0)
call BlzGetFrameByName("CustomConsoleUI3T", 0)
call BlzGetFrameByName("CustomConsoleUI2TL", 0)
call BlzGetFrameByName("CustomConsoleUI2TR", 0)
call BlzGetFrameByName("CustomConsoleUI1T", 0)
call BlzGetFrameByName("CustomConsoleUI1B", 0)
call BlzGetFrameByName("CustomConsoleUI2B", 0)
call BlzGetFrameByName("CustomConsoleUI3B", 0)
call BlzGetFrameByName("CustomConsoleUI4B", 0)
call BlzGetFrameByName("CustomConsoleUI5B", 0)
call BlzGetFrameByName("CustomConsoleUI6B", 0)
endfunction
private function Init takes nothing returns nothing
call CreateCustomConsole()
call UseCustomConsole(GetLocalPlayer(), 0)
endfunction
private function at0s takes nothing returns nothing
call Init()
call DestroyTimer(GetExpiredTimer())
endfunction
private function update takes nothing returns nothing
call BlzFrameSetVisible(customInventoryCoverParent, not BlzFrameIsVisible(BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)))
endfunction
private function init_function takes nothing returns nothing
local integer index = 0
set index = GetHandleId(RACE_HUMAN)
call AddCustomConsole(index, "ui\\console\\human\\humanuitile01")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile02")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile03")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile04")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile05")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile06")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeasant")
// offset this mostly is used to fit to the glowing orbs showing the houers
set x[index] = 0.0009
set y[index] = 0.0
set index = GetHandleId(RACE_ORC)
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile01")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile02")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile03")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile04")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile05")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile06")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\orc\\orcuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeon")
set x[index] = 0.0004
set y[index] = 0.0
set index = GetHandleId(RACE_UNDEAD)
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile01")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile02")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile03")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile04")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile05")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile06")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\undead\\undeaduitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNAcolyte")
set x[index] = 0.0009
set y[index] = 0.0
set index = GetHandleId(RACE_NIGHTELF)
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile01")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile02")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile03")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile04")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile05")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile06")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\nightelf\\nightelfuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNWisp")
set x[index] = 0.0009
set y[index] = 0.0
set index = GetHandleId(RACE_DEMON)
call AddCustomConsole(index, "ui\\console\\human\\humanuitile01")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile02")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile03")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile04")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile05")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile06")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile-timeindicatorframe")
call AddCustomConsole(index, "ui\\console\\human\\humanuitile-inventorycover")
call AddCustomConsole(index, "ReplaceableTextures\\CommandButtons\\BTNPeasant")
set x[index] = 0.000
set y[index] = 0.0
if GetLocalizedString("REFORGED") == "REFORGED" then
call TimerStart(CreateTimer(), 1/32.0, true, function update)
endif
call TimerStart(CreateTimer(), 0, false, function at0s)
static if LIBRARY_FrameLoader then
call FrameLoaderAdd(function Init)
endif
endfunction
endlibrary