RynthSuite as of 2026-10-04 (internal c94715f): RynthOracle (based on Oracle of Dereth by Advis Eveldan) and RynthInventory, RynthAi patrol doorways and rooms, healing priority, strict monster priority, finish the wounded target, slayer weapons, arcs when clear, blasts like rings, learn unknown spells, looting fixes, release 2026.10.4.6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c33e24a610
commit
12ca25f911
426 changed files with 108239 additions and 7521 deletions
56
Plugins/RynthCore.Plugin.RynthLua/Examples/hud-demo.lua
Normal file
56
Plugins/RynthCore.Plugin.RynthLua/Examples/hud-demo.lua
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
-- hud-demo.lua: a small window (script windows): a counter button, a checkbox and a
|
||||
-- running time.
|
||||
-- Needs RynthCore API v71 (engine) with ImGui on. Start it with /lua start hud-demo,
|
||||
-- close the window with its X, bring it back with /hud (or the bar's Scripts button).
|
||||
--
|
||||
-- OnRender runs about 20 times a second on the plugin thread and records what to draw;
|
||||
-- the engine draws it every frame. A click shows up as ImGui.Button returning true on the
|
||||
-- next pass (one pass late), and ImGui.Checkbox returns (changed, newValue).
|
||||
-- The full list of ImGui functions is in docs/RYNTHLUA.md ("Script windows"); see also
|
||||
-- xp-tracker.lua, hunt-settings.lua and salvage-list.lua.
|
||||
|
||||
local views = require("views")
|
||||
local ImGui = require("imgui")
|
||||
|
||||
if not views.Available then
|
||||
print("Script windows aren't available here (engine older than API v71, or ImGui is off).")
|
||||
end
|
||||
|
||||
local hud = views.Huds.CreateHud("Tracker")
|
||||
hud.Title = "Tracker demo"
|
||||
hud.Visible = true
|
||||
|
||||
local startedAt = clock()
|
||||
local clicks = 0
|
||||
local showTime = true
|
||||
|
||||
hud.OnRender.Add(function()
|
||||
ImGui.Text("Hello, " .. (game.Character.Name or "?"))
|
||||
ImGui.Separator()
|
||||
|
||||
if ImGui.Button("Count") then
|
||||
clicks = clicks + 1
|
||||
end
|
||||
ImGui.SameLine()
|
||||
ImGui.Text("clicked " .. clicks .. " time(s)")
|
||||
|
||||
local changed
|
||||
changed, showTime = ImGui.Checkbox("Show running time", showTime)
|
||||
if changed then print("Show running time: " .. tostring(showTime)) end
|
||||
|
||||
if showTime then
|
||||
local s = math.floor((clock() - startedAt) / 1000)
|
||||
ImGui.Text(("Running for %d:%02d"):format(math.floor(s / 60), s % 60))
|
||||
end
|
||||
|
||||
if ImGui.SmallButton("Reset") then
|
||||
clicks, startedAt = 0, clock()
|
||||
end
|
||||
end)
|
||||
|
||||
-- The player's X sets hud.Visible to false; /hud shows it again.
|
||||
game.RegisterCommand("/hud", function()
|
||||
hud.Visible = not hud.Visible
|
||||
end)
|
||||
|
||||
print("Tracker hud open. /hud toggles it; /lua stop hud-demo closes it.")
|
||||
Loading…
Reference in a new issue