UI: toc-Files

Level 26
Joined
Jul 18, 2010
Messages
1,813

Introduction

A TOC file is a file listing one or more fdf (frame definition files). Each line is a path to one fdf. Each fdf is an own file. In Warcraft 3 this TOC-Files are used to load the fdfs beeing listed.​
After a fdf was loaded into the game using a TOC lisiting it, main-Frames defined in the fdf can be created. Main-Frames are in my talking Frame definitions outside of Blocks { }.​
A TOC-File is not case sensitve.​
One can load a TOC-File using the native provided in Warcraft 3 1.31.​
native BlzLoadTOCFile takes string TOCFile returns boolean
it returns true if the TOC file was loaded successfuly. It might be smart to create a new function telling your, if a TOC load failed/succeeded.​
On default "ui/framedef/framedef.toc" is loaded, it contains most default fdf of warcraft 3.​
Code:
[/INDENT]
[INDENT]UI\FrameDef\GlobalStrings.fdf[/INDENT]
[INDENT]UI\FrameDef\InfoPanelStrings.fdf[/INDENT]
[INDENT]UI\FrameDef\NetworkStrings.fdf[/INDENT]
[INDENT]UI\FrameDef\DateStrings.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\DialogWar3.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\MapInfoPane.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\AdvancedOptionsDisplay.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\AdvancedOptionsPane.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\ListBoxWar3.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\MapListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\DecoratedMapListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\MapPreferenceBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\CheckListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\MainMenu.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\MovieScreen.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\Loading.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\LoadSavedGameScreen.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\OptionsMenu.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\SinglePlayerMenu.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\ViewReplayScreen.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\CustomCampaignMenu.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\CampaignMenu.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\TeamSetup.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\PlayerSlot.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\Skirmish.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\ScoreScreen.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\LocalMultiplayerJoin.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\LocalMultiplayerCreate.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\LocalMultiplayerLoad.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\GameChatroom.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\CampaignListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetMain.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetMatchmakerPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetNewsBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetUserListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetChatPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetChatActionMenu.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetStandardPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetTeamPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetTeamInvitation.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetProfilePanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetCustomJoinPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetCustomCreatePanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetCustomLoadPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetScheduledGame.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetChatroom.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetFriendsListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetFriendsPane.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetClanMateListBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetClanPane.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetClanInvitation.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetStatusBox.fdf[/INDENT]
[INDENT]UI\FrameDef\Glue\BattleNetIconSelectBox.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\ConsoleUI.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\AllianceSlot.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\AllianceDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\ChatDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\LogDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\EscMenuMainPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\EscMenuOptionsPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\EscMenuSaveGamePanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\GameResultDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\UpperButtonBar.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\ResourceBar.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\SimpleInfoPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\SuspendDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\UnresponsiveDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\ReplayPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\ObserverPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\QuestDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\TimerDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\Leaderboard.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\Multiboard.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\CinematicPanel.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\ScriptDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\GameSaveSplashDialog.fdf[/INDENT]
[INDENT]UI\FrameDef\UI\BrowserFrame.fdf[/INDENT]
[INDENT]

Although there are 3 further default fdf, providing quite useful basic frame templates which might be good to have in your map, if one does not create own custom fdf.​
Code:
ui\framedef\ui\escmenutemplates.fdf[/INDENT]
[INDENT]ui\framedef\glue\standardtemplates.fdf[/INDENT]
[INDENT]ui\framedef\glue\battlenettemplates.fdf[/INDENT]
[INDENT]
The path written in the TOC file is the file the game will load. For imported fdf write the path you imported it into your map.​
It is recommented to add an empty line at the end of your TOC-Files text. It failed on the ptr without the empty ending line.​

Example

"myStatusBar.toc" imported to "war3mapImported\myStatusBar.toc"​
"myStatusbar.fdf" imported to "war3mapImported\myStatusBar.fdf"​
TOC-Content​
Toc empty Line White.jpg
in this example this line of code would load the imported TOC-File.​
call BlzLoadTOCFile("war3mapimported\\mystatusbar.toc")
TOC-Files are important when you want to create new frames or load further fdf.​
Edit: Added a zip containing "Templates.toc" it is loading the 2 templates mentioned.​


Other UI-Frame Tutorials

The following links might provide more insight into this subject.​
Default Names for BlzGetFrameByName (Access to Existing game-Frames)​
 

Attachments

  • Templates.zip
    181 bytes · Views: 255
Last edited:
Level 25
Joined
Aug 18, 2009
Messages
4,081
Probably stands for 'Table Of Contents'.
The paths in the file are not case-sensitive? Since the mpq archive uses some hash algorithm to locate a file, that's a bit strange. Either this must already not consider case or mentioning the FDFs in listfile would be a must?
Can you reference another toc in a toc?
 
Level 3
Joined
Apr 11, 2018
Messages
23
It is recommented to add an empty line at the end of your TOC-Files text. It failed on the ptr without the empty ending line.
It depends on the end of line sequence of the text file you're working in. If it's "CRLF", you need at least 1 empty line. If it's "LF", you need at least 2 empty lines.
 

Chaosy

Tutorial Reviewer
Level 39
Joined
Jun 9, 2011
Messages
13,081
I am cautious about this one.

The introduction gives a brief rundown of what the file format and a few fun facts about how it works in the background. This I have no problem with. But the important knowledge is just 3-4 sentences of information.
Importing a file is basic knowledge and does not really need to be taught. There are other tutorials that cover such.
Lastly, loading the file is also very useful but can also be explained in a single line.

This leaves the tutorial in my mind to feel extremely short. Yet those few lines are useful.
 
Top