====== Adding a New Icon (SDT) ====== Authors: Vawser ===== Tools ===== * [[https://github.com/jindrapetrik/jpexs-decompiler|JPEXS Free Flash Decompiler]] * [[https://github.com/vawser/Smithbox/releases|Smithbox]] * [[https://github.com/ividyon/WitchyBND|WitchyBND]] * [[https://notepad-plus-plus.org/|Notepad++]] * Batch Scripts from [[tutorial:ffdec-tutorial]] ===== Tutorial ===== In this tutorial, we will be adding a new icon, specifically icon ID ''1099''. The same instructions apply for any icon ID, so substitute ''1099'' for your actual icon ID when reading the instructions below. ==== Shoebox Layout ==== === General === To start with, the new icon needs to be added to the shoebox layout files that are used to define the icon atlases. To do this, copy the ''01_common.sblytbnd.dcx'' file into your mod structure. It should be placed like so: ''\menu\hi''. Unpack the ''01_common.sblytbnd.dcx'' file with WitchyBND. This will result in a folder called ''01_common-sblytbnd-dcx'', containing all the layout files. You can edit the ''layout'' files with a text editor (Notepad++ is used during this tutorial). Within the ''layout'' file, the following terms are: * **SubTexture**: this is a definition for a subtexture within the overall image file. * **name**: this is the internal name of the subtexture, and contains the icon ID. * **x**: this is the x coordinate the subtexture starts from (assuming 0 is left edge of image). * **y**: this is the y coordinate the subtexture starts from (assuming 0 is top edge of image). * **width**: this is the width of the subtexture (e.g. x + width is the right edge of the icon) * **height**: this is the height of the subtexture (e.g. y + height is the bottom edge of the icon). Once the the layout files have been edited, you can repack the file by using WitchyBND with the ''01_common-sblytbnd-dcx'' folder, which will place the edited layout files into a new ''01_common.sblytbnd.dcx''. === Specifics === These are the specific actions you should take for this tutorial: - Unpack the ''01_common.sblytbnd.dcx'' file. - Open the ''SB_Icon.layout'' file. - Duplicate the SubTexture line with ''MENU_ItemIcon_01100.png'' as its name, placing the new line above it. - Change the name attribute to ''MENU_ItemIcon_01099.png''. - Change the ''x'' attribute to ''0''. - Change the ''y'' attribute to ''2048'' - Repack the ''01_common.sblytbnd.dcx'' file. ==== Image ==== === General === Edit the icon file found within the ''01_common.tpf.dcx'' file. === Specifics === - Unpack the ''01_common.tpf.dcx'' file. - Open the ''SB_Icon.dds'' file (with Photoshop or other image editoring software). - The icon has been placed a placed at x-coordinate 0 and y-coordinate 2048, covering the x-coordinate space to 256, and the y-coordinate space to 2304. Create your new icon within that square. - Save the ''SB_Icon.dds'' file. - Repack the ''01_common.tpf.dcx'' file. ==== Interface ==== === General === The new icon as defined in the shoebox layout needs to be explicitly added to all relevant ''GFX'' files. You need to edit the following ''GFX'' files: - ''01_000_FE.gfx'' - ''01_000_FE_Stadia.gfx'' (can be skipped) - ''01_012_itemquantityselect.gfx'' - ''01_990_Trial_FE.gfx'' (can be skipped) - ''02_200_mainmenu.gfx'' - ''02_202_equipweaponselect.gfx'' - ''02_205_bossselect.gfx'' - ''02_206_costumeselect.gfx'' - ''02_207_bossselect_multi.gfx'' - ''02_280_getitem.gfx'' - ''02_281_getitem_middle.gfx'' - ''02_282_getitem_high.gfx'' - ''02_284_getitem_event.gfx'' - ''02_991_Trial_MainMenu.gfx'' (can be skipped) - ''03_001_shop.gfx'' - ''03_202_bonfire.gfx'' - ''03_204_upgrade.gfx'' - ''03_206_skill.gfx'' You should use the batch scripts as found in [[tutorial:ffdec-tutorial]], they will let you quickly decompile the ''GFX'' files into ''XML'', and vice versa. To add a new icon, you to define and the display it within the GFX file. To define a new icon, you need to define a new ''DefineExternalImage2'' (see below). To display a new icon, you need to add three new selements to a ''DefineSpriteTag'' section: - **RemoveObject2Tag**: this removes the definition previously defined. - **PlaceObject3Tag**: this is the external image you want to place as a tag. - **ShowFrameTag**: this displays the tag you defined previously. The reason it is done like this is because the ''DefineSpriteTag'' section uses the icon ID of the external image as an index to indicate which ''frameTag'' to show. Therefore each group of ''RemoveObject2Tag'', ''PlaceObject3Tag'' and ''ShowFrameTag'' can be thought of as representing a group, indexed by their position in the list. Note, the ''DefineSpriteTag'' sections are split into blocks of 1000, which tend to be groups of individual types of icons, such as weapons, equipment, etc. === Specifics === These are the specific actions you should take for this tutorial. Note this only covers the HUD, e.g. 01_000_FE, you'll need to do the same process for all of the ''GFX'' files as listed in the general section. == Defining the Texture == - With the ''01_000_FE.xml'' file open in your text editor, search for ''MENU_ItemIcon_01100'' - You will find the ''DefineExternalImage2'' line for it. Duplicate this line, placing it above. - In the new ''DefineExternalImage2'' line, change the ''characterID'' attribute to a unique ID (e.g. it must not match any existing ID). As it doesn't have to be sequential, you can simply change this to a high number, such as ''5000''. - In the new ''DefineExternalImage2'' line, change the ''exportName'' attribute to ''MENU_ItemIcon_01099''. - In the new ''DefineExternalImage2'' line, change the ''fileName'' attribute to ''MENU_ItemIcon_01099.tga''. - In the new ''DefineExternalImage2'' line, change the ''imageID'' attribute to match the ID you chose for ''characterID''. == Displaying the Texture == - With the ''01_000_FE.xml'' file open in your text editor, search for the ''characterID="532"''. - You will find a ''PlaceObject3Tag'' section. - Duplicate both the ''RemoveObject2Tag'' and the ''PlaceObject3Tag'' section, placing them above the ''ShowFrameTag'' that precedes the found ''PlaceObject3Tag'' section. - Change the ''characterId'' in the duplicated ''PlaceObject3Tag'' to your new ''characterID''. == Save === - Convert the ''01_000_FE.xml'' back to ''01_000_FE.gfx''. ===== Source ===== [[https://www.youtube.com/watch?v=hAOD9TTw1mU|View Youtube Video]]