Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes, new actions, improved action logging; etc. #100

Closed
wants to merge 9 commits into from

Conversation

MnFeN
Copy link
Contributor

@MnFeN MnFeN commented Nov 30, 2023

Supplement for 1.1.8.0 beta (PR #98)

  • ActionViewer

    • Add Copy Conditions, Paste Conditions, Test Action in the right-click menu
  • ActionForm / Action

    • Fix the null reference bug related with template trigger
    • The log entries for exceptions occurring in actions will now include the corresponding descriptions and trigger path
    • Added two actions:
      • VariableScalar - Increment (for convenience)
      • VariableTable - AppendH (append tables horizontally)
    • Update the links to the keypress documentations and switch to the corresponding links for the selected language option
    • Fix the issue that some table actions did not set their changer and time, such as Resize and Copy
  • Context

    • ${estorage:xxx}: check if the scripting storage contains the key xxx
    • ${_storage[xxx]}: output the objects in the scripting storage
    • ${_configpath} ${_pluginpath}: the corresponding local folder paths
    • Added ${_config[UnsafeUsage]};
    • Changed the ${_config[API]} results to bitwise (0-7, Local << 2 | Remote << 1 | Admin)
  • RealPlugin

    • Fix a bug where the version in cfg.Constants was not updated on the first launch after updating the plugin, but on the second launch
    • Expand the exceptions in named callbacks (delegates) to show their actual exception messages
    • Added a static RealPlugin RealPlugin.plug for convenient referencing (all the RealPlugin instances throughout the entire program are the same one).
  • Others

    • Minor changes:
      • Change void Context.XxxxxError() to Exception Context.XxxxxError()
      • Change some internal to public for scripts
      • Translation improvements and fixes

@MnFeN
Copy link
Contributor Author

MnFeN commented Mar 27, 2024

MathParser

  • Added an operator °, for example, 180° = 3.14159...
  • Added a function isanglebetween(θ, θ1, θ2) to determine if a given angle θ is within the range from θ1 to θ2 (in the direction of increasing angle, i.e. counter-clockwise in FFXIV coordinate system).
    • The input angles do not need to be normalized to [-pi, pi]. The output is 0 or 1.
      isanglebetween(pi/4, 0, pi/2) = 1
      isanglebetween(pi, pi/2, -pi/2) = 1
      isanglebetween(0, pi/2, -pi/2) = 0
    • Example: Determine if the character's heading is safe in a back-facing mechanism.

Actions

  • In the LogMessage action, a new option "Add log to ACT combat record" has been added to facilitate browsing both regular and custom logs together in the ACT combat record.
    • e.g., A 1B (HeadMarker) log with offset removed can be added to the combat record with a custom format, as if a log without offset was generated at the same time.

Entity

  • New entity attributes added: subrole and roleid (corresponding to the text and numeric values defined below).
    Related discussion
  public enum RoleType
  { 
      None          = 0,
      Tank          = 8,
      Healer        = 16,
      DPS           = 24,
      Crafter       = 32,
      Gatherer      = 48,
      MainRole      = 56,

      PureHealer    = Healer | 1,
      FlexHealer    = Healer | 2,
      BarrierHealer = Healer | 3,
      StrengthMelee  = DPS | 1,
      DexterityMelee = DPS | 2,
      PhysicalRanged = DPS | 4,
      MagicalRanged  = DPS | 6,
  }
  • Added a new query pattern for _entity: ${_entity[key=value].prop}
    • For example, ${_entity[bnpcid=12601].heading} can be used to query the entity of BNpcId 12601.
    • It returns the first entity found. If no entity is found, it returns the data of NullCombatant.
    • You can determine whether you are in the door boss based on the BNpcId of some characteristic entities.
    • If you need more complex query conditions, or to query multiple entities that meet the conditions, you can use the Table action to query all entities, or use scripts directly:
      List<VariableDictionary> Triggernometry.PluginBridges.BridgeFFXIV.GetAllEntities()

Interpreter

  • Added a static utility class StaticHelpers to the Interpreter to facilitate the use of methods that are independent of the Context instance.
  • All methods of TriggernometryHelpers are still available.
  • Example:
using Triggernometry.Variables;
using static Triggernometry.Interpreter;

class ConfigForm
{
    //...

    public void LoadFromConfig()
    {
        VariableDictionary config = StaticHelpers.GetDictVariable(isPersistent, configName);
        // ...
    }
}

Others

  • Modified action descriptions for actions requiring specific window titles and procid, following the newly added logic about procid.

  • Fixed several null reference exceptions, such as ActionViewer.Actions = null causing sporadic errors when clicking in the ActionForm interface, and RealPlugin.plug.currentZone = null causing potential errors when editing group area restrictions with FFXIV not running.

  • Renamed the testmode property to testByPlaceholder to avoid ambiguity, due to previously added properties for testing actions.

  • Renamed several incorrectly named cbx... checkboxes to chk....

  • Other minor modifications.

…olor Settings, etc.

(combined with a previous submit)
@MnFeN
Copy link
Contributor Author

MnFeN commented Apr 8, 2024

MessageBox

  • More intelligent autofill:
    • If a string with one or no ${...} expressions was input in a textbox for variable names, it would be saved into a corresponding dynamic variable list;
    • If any input string contains a single-layer variable expressions like ${var:name}, the name would be save into the corresponding dynamic variable list;
    • If the user is typing after expressions like ${v:..., or typing in an expreesion textbox for variable names, it would also check all the names in the dynamic list.
    • This feature is compatitable with all kinds of variables (session/persistent), text/image auras, and named callbacks.
  • Changed behaviour for Enter key in the ActionForm:
    • When pressing Enter in a single-line mode expression textbox, it would change to multi-line mode;
    • When pressing in multi-line mode, it would add a linebreak directly, and the next line would be added the same indent with the previous line.

Text Aura

  • Color expressions
    • Added 3 expression textboxes for the text aura's forecolor, backcolor and outlinecolor.
    • Color expressions are the same as in the action descriptions, and would show the corresponding parsed color as the background color of the textbox:
      • aaccff / #aaccff
      • acf / #acf
      • 192, 0, 18
    • Those colors accept expressions, so it would be possible to dynamically change the colors based on some real values in a same action, without using several different actions with only the color different. (but for now, the action still needs to be executed to refresh the color)
      e.g. Changed the text color based on the 2 dragons' HP in DSR P6.
    • The color selector is still kept, for providing users a direct way to select colors.

RealPlugin / Interpreter

  • Moved the RealPlugin.WindowsUtils class to Triggernometry.Utilities namespace, and added the corresponding scripting API safety option
  • Added a ffxiv process handle (with all access):
      public IntPtr Triggernometry.Realplugin.plug.XivHandle
    Note: It is still safe because all APIs were still restricted. It could also be used in the future to read some entity properties which are not available in ACT / update too slowly in ACT (like coordination).
  • Added 2 Json methods since the current scripting environment cannot access System.Text.Json directly:
      public static string Triggernometry.Interpreter.StaticHelpers.Serialize(object o, bool indent = true);
      public static T Triggernometry.Interpreter.StaticHelpers.Deserialize<T>(string s);

…olor settings, etc.

(Combined with a previous submit)
MnFeN added a commit to MnFeN/Triggernometry that referenced this pull request Apr 9, 2024
@MnFeN MnFeN closed this Apr 9, 2024
@MnFeN MnFeN deleted the submit branch April 25, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants