Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
- Add explicit frame sync to tooltips.
  • Loading branch information
algernon-A committed Dec 19, 2023
1 parent 354cbe4 commit 84cbc34
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BepInEx/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace LineTool
/// <summary>
/// BepInEx plugin to substitute for IMod support.
/// </summary>
[BepInPlugin(GUID, "Line Tool Lite", "1.2.0")]
[BepInPlugin(GUID, "Line Tool Lite", "1.2.1")]
[HarmonyPatch]
public class Plugin : BaseUnityPlugin
{
Expand Down
2 changes: 1 addition & 1 deletion BepInEx/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Line_Tool_Lite",
"version_number": "1.2.0",
"version_number": "1.2.1",
"website_url": "https://github.com/algernon-A/LineToolLite",
"description": "Place objects in lines, curves, or circles. A variety of options and controls are availalbe to specify and fine-tune results.",
"dependencies": [
Expand Down
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.2.1
- Add explicit frame sync to tooltips.

1.2.0
- Add tooltips to tool panel.
- Add localization.
Expand Down
12 changes: 9 additions & 3 deletions UI/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,19 @@ if (typeof lineTool.showTooltip !== 'function') {
// Set text and position.
lineTool.tooltipTitle.innerHTML = engine.translate("LINETOOL." + tooltipKey);
lineTool.tooltipPara.innerHTML = engine.translate("LINETOOL_DESCRIPTION." + tooltipKey);
lineTool.setTooltipPos(parent);

// Set visibility tracking to prevent race conditions with popup delay.
lineTool.tooltipVisibility = "visible";

// Slightly delay popup to prevent premature activation and to ensure layout is ready.
window.setTimeout(function () { lineTool.setTooltipPos(parent) }, 25);
// Slightly delay popup by three frames to prevent premature activation and to ensure layout is ready.
window.requestAnimationFrame(() => {
window.requestAnimationFrame(() => {
window.requestAnimationFrame(() => {
lineTool.setTooltipPos(parent);
});

});
});
}
}

Expand Down

0 comments on commit 84cbc34

Please sign in to comment.