Akirane / XIVHotbar

13 stars 9 forks source link

XIVHotbar - [Version 0.5]

This version is further work on SirEdeonX's original addon, you can check his work from here: https://github.com/SirEdeonX/FFXIAddons/tree/master/xivhotbar.

XIVHotbar

12/10/2020 update

Implemented a workaround for private server players. Keep in mind if you are playing on a private server you need to use a different font than Sans-Serif, you can find this setting under Texts/Font in settings.xml. Feel free to report if other fonts crashes the game.

Note about 17/09/2020 update

Hand-to-hand Dagger Sword
Great Sword Axe Great Axe
Scythe Polearm Scythe
Polearm Katana Great Katana
Club Staff Bow
Marksmanship

Note about 15/09/2020 update

How this version differentiates

XIVHotbar

XIVHotbar

Note about 23/08/2020 update

Keybinds have been moved to data/keybinds.lua. Make a backup of your old keyboard_mapper.lua file, then copy the table keyboard.hotbar_rows and paste its contents into the table in keybinds.lua

Customization

Not every setting in settings.xml has been re-tested, there's a lot of things that is different now. The following has been tested out:

You can change the following from the settings.xml file:

  1. Number of rows and columns. Modify the section Hotbar/rows and Hotbar/columns for this. For now I recommend leaving the columns on 12.

Less Columns and Rows

  1. It's possible to change a row to be vertical or horizontal, if you want a specific hotbar to be vertical set Vertical to true whic you can find under the hotbar section in the settings.xml file. Below is showing the fifth row as an example.

Less Columns and Rows Less Columns and Rows

  1. It's now possible to hide the inventory count and which hotbar environment you are currently in. Modify Hotbar/HideBattleNotice and Hotbar/HideInventoryCount for this.

No extra labels

  1. The slot icons are now scalable. Check the Hotbar/SlotIconScale option.
  2. It's now possible to change the textsize. Check the Texts/Size option.

UI Scaling

  1. It's now possible to tell this addon to change out weapon skill actions on the fly. Currently only works for club/dagger/sword. Look at the file data/Akirane/RDM.lua, at line 113 you have xivhotbar_keybinds_job['Sword'] and at line 125 you have xivhotbar_keybinds_job['Dagger']. The addon can now switch between these two action tables after it has registered you have changed weapon type. Until I have finished this implementation, it will remain disabled for now. You can turn it on by changing the value Hotbar/EnableWeaponSwitching from false to true.

  2. This addon recognizes the abilities light arts and dark arts, when you activate one of them and you have a table called xivhotbar_keybinds_job['Light Arts'] you can update the hotbars with new actions. Look at data/Akirane/WHM.lua for example.

Known issues

If the spells are spelled incorrectly, the ui.lua file will spam an error in the console. If you get this error, check if the spells in your .lua are spelled out correctly. For spells with the character ' in them you need to add a backslash to escape the character like this: \'.

Slots with no actions show feedback if you click on them.

What's next

Getting started

Create a folder with following structure inside data folder:

    <name-of-character>/<job>.lua

Example of a basic RDM.lua file:


    -- Main job
    xivhotbar_keybinds_job['Base'] = {
      {'battle 1 1', 'ma', 'Cure IV', 'stal', ' '},
    }

    -- Sub job
    xivhotbar_keybinds_job['SCH'] = {
      {'b 3 1', 'ja', 'Light Arts', 'me', 'L.A.'},
    }

    --Console Commands --Example General.lua for given character.
    xivhotbar_keybinds_general['Root'] = {
     --send a command using send addon to alt character.
       {'f 1 1', 's','altCharacterName /assist <bt>','','AltAssist'},
       -- eg:{'f 1 1', 's','Ahsoka /assist <bt>','','AltAssist'}

        -- input normal command as if player into chat log.
       {'f 1 2', 'input','/assist <bt>','','Assist'},

       --Generic variant of option 1 1 above.
       --execute a macro command, which inputs starting with //. Good for all windower macros.
       {'f 1 1', 'macro','send altCharacterName /assist <bt>','','AltAssist'} 
       -- eg:{'f 1 1', 'macro','send Ahsoka /assist <bt>','','AltAssist'}
    }

    return xivhotbar_keybinds_job

When you've saved the changes you've made, proceed with reloading using //htb reload or //lua reload xivhotbar. More in-depth examples are provided, check data/Akirane and data/Waruharu.

Breakdown of each value in an action

Let's say you have the following action:

    {'b 1 1', 'ja', 'Stymie', 'me', 'Sty.', 'Stymie-image'}
Column Value Description
1 b 1 1 First row, first column in battle field.
2 ja Action Type OR custom command.
3 Stymie Name of the spell/ability/command
4 me Target, this field can be empty
5 Sty. Text which will appear on screen
6 Stymie-image This field is optional, if the field is not nil it will use an image from images/custom folder.

Commands

Upgrading from older version

Make a backup of your previous job-files located under data/<character>.

Latest Changes:
 22/08/2020
    - Fixed a bug with the show() function for ui.
 20/08/2020
    - It's now possible to move the hotbars by using the command `//htb move`
 10/08/2020
    - Old .xml-files has been removed.
    - Added further customization.
 08/06/2020
    - Fixed OffsetX and OffsetY in settings.xml, now they should reposition the hotbar properly.
 07/06/2020
    - Added clickable icons and first version of hovering.
 05/06/2020
    - Added a brief explanation on getting started.
    - Removed old libraries related to .xml-files.
    - keyboard_mapper.lua has received an overhaul which makes it easier to work with keybinds now. Instead of '!a' you type in 'ALT + A' instead. 
    - An inventory counter has been implemented.
    - The number of hotbars has been increased to 5. I would like to implement a way to toggle as many hotbars as you like eventually.
    - The hotbar now is now hidden during conversations with NPC or zoning.
    - player.lua has been simplified.
    - The functions `windower.ffxi.get_spell_recasts()` and `windower.ffxi.get_ability_recasts()` will now only be called once per prerender update.
 2/1/20 
    - Corrected some minor spelling errors, will eventually push a new update based on feedback received. 
 1/1/20
    - Added support for changing actions based on which avatar you are summoning. Take a look at data/Akirane/SMN.lua if you need an example on how to use it.
 30/11/19
    - Now most file operations use .lua instead of .xml files, making loading much faster.
    - Increased the number of hotbars showed simultaneously from 3 to 4.
    - Added numbers to distinguish which hotbars are currently in use.
    - Disabled the auto switching of hotbars in battle, press "\" to toggle between them instead.
    - Removed MP and TP cost as they were inaccurate.
    - Removed progression bar on abilities/spells because of changing between hotbars caused them to start over with full boxes.

 09/05/17
    - Added various addon commands
 08/05/17
    - Hotbar files are now inside a server directory so characters with same name don't override each other
    - fixed chat input triggering hotbar
    - removed key to hide bar and added setting ToggleBattleMode
    - fixed job change and battle notice bugs. 
    - added PSDs for custom icons to repository
 07/05/17
    - released WIP version

Currently supported addons

How to use:

Limitations:

  1. Due to how all SP share the same recast timer, it's currently not possible to show an icon for SP-abilities automatically, I recommend referencing to an image like this:

Adding an image to SP-abilities

  1. Copy the matching icon from <xivhotbar-location>/images/icons/abilities then paste it to <xivhotbar-location>/images/icons/custom remember to rename it to something else.
  2. I want to map Stymie to the hotbar, therefore I renamed the image to "Stymie.png".
  3. Each action accepts 5 or 6 items, the difference with the ladder is it tells the addon to use a custom .png image.
  {'battle 5 0', 'ja',  'Stymie', 'me', 'Stym.', 'Stymie'},

If you have done everything correctly, you'll end up with the following:

Stymie

Done:

  1. Add key mapping