First off I would like to thank Nick and the community for helping me in the past. Each time I have learned a little more and in turn my small MUD community has profited from the improved plugins.
I am currently working on improving my existing plugins to make them look and work a little better, as well as some minor bug fixes. The majority of the code works off of the item window tutorial Nick gave on youtube and the help he gave in improving it later.
Now I would like to figure out a way to make these nice miniwindows movable. This would make them a ton better and would silence some complaints in my MUD community.
I will try to make this brief. The plugin works by reading this information every one second, which is updated and sent by the server to the client.
Then it displays it in a miniwindow with this:
Before I have asked here, I have tried it on my own by calling the movewindow.lua module, installing it then putting it into the windowcreate. Unfortunately, I do not yet have a deep enough understanding to get it to work. Would anyone in the here be willing to modify it to be moveable and add the ability for the window position to be save on exit? By the way, I have read the around the forums for info but at this point I just feel overwhelmed.
I am currently working on improving my existing plugins to make them look and work a little better, as well as some minor bug fixes. The majority of the code works off of the item window tutorial Nick gave on youtube and the help he gave in improving it later.
Now I would like to figure out a way to make these nice miniwindows movable. This would make them a ton better and would silence some complaints in my MUD community.
I will try to make this brief. The plugin works by reading this information every one second, which is updated and sent by the server to the client.
%PLUGINATOR_START%
Riln: 7905
Fully Rested - Well-Fed
P-avoid, T-none, A-random
Standing
You are suffering no significant wounds.
[[Stealthed]]
~~ GUILD ~~
Rank 99 member of Rook Parlour
Promotion: 0 / 25250
%PLUGINATOR_END%
Then it displays it in a miniwindow with this:
<triggers>
<trigger
enabled="y"
group="godlyplugin"
match="^\%PLUGINATOR\_START\%$"
name="status3"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>require "wait"
wait.make (function () -- coroutine starts here
local win = GetPluginID () .. ":status3"
local font = "k"
if not WindowInfo (win, 1) then
WindowCreate (win, 0, 0, 0, 0, 6, 0, 0)
WindowFont (win, font, "Lucida Console", 8)
end -- if
-- request inventory
-- wait for status screen to start
local line, wildcard, styles = wait.match ("*", 10, trigger_flag.OmitFromOutput)
if not line then
ColourNote ("white", "blue", "No status received within 10 seconds")
return
end -- if
local inv = {}
local max_width = WindowTextWidth (win, font, "Status")
-- loop until end of status
while true do
-- save status line
table.insert (inv, styles)
-- work out max width
max_width = math.max (max_width, WindowTextWidth (win, font, line))
line, wildcards, styles = wait.match ("*", 10, trigger_flag.OmitFromOutput)
-- see if end of status
if string.match (line, "%%PLUGINATOR_END*") then
break
end -- if
end -- while loop
local font_height = WindowFontInfo (win, font, 1)
local window_width = max_width + 10
local window_height = font_height * (#inv + 2) + 10
-- make window correct size
WindowCreate (win, 0, 0, window_width, window_height, 6, 0, ColourNameToRGB "black")
WindowGradient (win, 0, 0, 0, 0, ColourNameToRGB ("#2F2F4F"), ColourNameToRGB ("black"), 2)
-- heading line
WindowText (win, font, "Status", 5, 5, 0, 0, ColourNameToRGB "dodgerblue")
-- draw each status line
local y = font_height * 2 + 5
for i, styles in ipairs (inv) do
local x = 5
for _, style in ipairs (styles) do
x = x + WindowText (win, font, style.text, x, y, 0, 0, style.textcolour)
end -- for
y = y + font_height
end -- for each status item
WindowShow (win, true)
end) -- end of coroutine</send>
</trigger>
</triggers>
Before I have asked here, I have tried it on my own by calling the movewindow.lua module, installing it then putting it into the windowcreate. Unfortunately, I do not yet have a deep enough understanding to get it to work. Would anyone in the here be willing to modify it to be moveable and add the ability for the window position to be save on exit? By the way, I have read the around the forums for info but at this point I just feel overwhelmed.