1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

UI: toc-Files

Discussion in 'Tutorial Submission' started by Tasyen, May 29, 2019.

Tags:
  1. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,721
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37

    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 (Text):

    UI\FrameDef\GlobalStrings.fdf
    UI\FrameDef\InfoPanelStrings.fdf
    UI\FrameDef\NetworkStrings.fdf
    UI\FrameDef\DateStrings.fdf
    UI\FrameDef\Glue\DialogWar3.fdf
    UI\FrameDef\Glue\MapInfoPane.fdf
    UI\FrameDef\Glue\AdvancedOptionsDisplay.fdf
    UI\FrameDef\Glue\AdvancedOptionsPane.fdf
    UI\FrameDef\Glue\ListBoxWar3.fdf
    UI\FrameDef\Glue\MapListBox.fdf
    UI\FrameDef\Glue\DecoratedMapListBox.fdf
    UI\FrameDef\Glue\MapPreferenceBox.fdf
    UI\FrameDef\Glue\CheckListBox.fdf
    UI\FrameDef\Glue\MainMenu.fdf
    UI\FrameDef\Glue\MovieScreen.fdf
    UI\FrameDef\Glue\Loading.fdf
    UI\FrameDef\Glue\LoadSavedGameScreen.fdf
    UI\FrameDef\Glue\OptionsMenu.fdf
    UI\FrameDef\Glue\SinglePlayerMenu.fdf
    UI\FrameDef\Glue\ViewReplayScreen.fdf
    UI\FrameDef\Glue\CustomCampaignMenu.fdf
    UI\FrameDef\Glue\CampaignMenu.fdf
    UI\FrameDef\Glue\TeamSetup.fdf
    UI\FrameDef\Glue\PlayerSlot.fdf
    UI\FrameDef\Glue\Skirmish.fdf
    UI\FrameDef\Glue\ScoreScreen.fdf
    UI\FrameDef\Glue\LocalMultiplayerJoin.fdf
    UI\FrameDef\Glue\LocalMultiplayerCreate.fdf
    UI\FrameDef\Glue\LocalMultiplayerLoad.fdf
    UI\FrameDef\Glue\GameChatroom.fdf
    UI\FrameDef\Glue\CampaignListBox.fdf
    UI\FrameDef\Glue\BattleNetMain.fdf
    UI\FrameDef\Glue\BattleNetMatchmakerPanel.fdf
    UI\FrameDef\Glue\BattleNetNewsBox.fdf
    UI\FrameDef\Glue\BattleNetUserListBox.fdf
    UI\FrameDef\Glue\BattleNetChatPanel.fdf
    UI\FrameDef\Glue\BattleNetChatActionMenu.fdf
    UI\FrameDef\Glue\BattleNetStandardPanel.fdf
    UI\FrameDef\Glue\BattleNetTeamPanel.fdf
    UI\FrameDef\Glue\BattleNetTeamInvitation.fdf
    UI\FrameDef\Glue\BattleNetProfilePanel.fdf
    UI\FrameDef\Glue\BattleNetCustomJoinPanel.fdf
    UI\FrameDef\Glue\BattleNetCustomCreatePanel.fdf
    UI\FrameDef\Glue\BattleNetCustomLoadPanel.fdf
    UI\FrameDef\Glue\BattleNetScheduledGame.fdf
    UI\FrameDef\Glue\BattleNetChatroom.fdf
    UI\FrameDef\Glue\BattleNetFriendsListBox.fdf
    UI\FrameDef\Glue\BattleNetFriendsPane.fdf
    UI\FrameDef\Glue\BattleNetClanMateListBox.fdf
    UI\FrameDef\Glue\BattleNetClanPane.fdf
    UI\FrameDef\Glue\BattleNetClanInvitation.fdf
    UI\FrameDef\Glue\BattleNetStatusBox.fdf
    UI\FrameDef\Glue\BattleNetIconSelectBox.fdf
    UI\FrameDef\UI\ConsoleUI.fdf
    UI\FrameDef\UI\AllianceSlot.fdf
    UI\FrameDef\UI\AllianceDialog.fdf
    UI\FrameDef\UI\ChatDialog.fdf
    UI\FrameDef\UI\LogDialog.fdf
    UI\FrameDef\UI\EscMenuMainPanel.fdf
    UI\FrameDef\UI\EscMenuOptionsPanel.fdf
    UI\FrameDef\UI\EscMenuSaveGamePanel.fdf
    UI\FrameDef\UI\GameResultDialog.fdf
    UI\FrameDef\UI\UpperButtonBar.fdf
    UI\FrameDef\UI\ResourceBar.fdf
    UI\FrameDef\UI\SimpleInfoPanel.fdf
    UI\FrameDef\UI\SuspendDialog.fdf
    UI\FrameDef\UI\UnresponsiveDialog.fdf
    UI\FrameDef\UI\ReplayPanel.fdf
    UI\FrameDef\UI\ObserverPanel.fdf
    UI\FrameDef\UI\QuestDialog.fdf
    UI\FrameDef\UI\TimerDialog.fdf
    UI\FrameDef\UI\Leaderboard.fdf
    UI\FrameDef\UI\Multiboard.fdf
    UI\FrameDef\UI\CinematicPanel.fdf
    UI\FrameDef\UI\ScriptDialog.fdf
    UI\FrameDef\UI\GameSaveSplashDialog.fdf
    UI\FrameDef\UI\BrowserFrame.fdf
     

    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 (Text):
    ui\framedef\ui\escmenutemplates.fdf
    ui\framedef\glue\standardtemplates.fdf
    ui\framedef\glue\battlenettemplates.fdf
     
    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
    Code (Text):
    war3mapImported\myStatusBar.fdf

     
    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


     

    Attached Files:

    Last edited by a moderator: Jan 7, 2021
  2. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,035
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    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?
     
  3. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,721
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    TOC beeing an acronym for Table of Contents would make sense.
    No, one can not load a toc in a toc. I would kinda doubt the practical use of it, if it would be possible.
     
  4. GetLocalPlayer

    GetLocalPlayer

    Joined:
    Apr 11, 2018
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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.
     
  5. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,102
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    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.
     
  6. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,721
    Resources:
    37
    Tools:
    2
    Maps:
    3
    Spells:
    11
    Tutorials:
    20
    JASS:
    1
    Resources:
    37
    What is wrong with short tutorials?
    Unlike my other UI-Tutorials this one can be of use to people that don't create custom UI themself. They can change the paths fdf/tocs take in their map to fit their file structure.

    Any of my tutorials can be graveyarded, if you like.