Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Plugins
➜ InfoBox
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Cyote
(9 posts) Bio
|
Date
| Wed 27 Aug 2014 07:37 PM (UTC) Amended on Wed 27 Aug 2014 07:54 PM (UTC) by Nick Gammon
|
Message
| I have a problem with InfoBox Columns basically.
Each row will consists of 7 bars and it will move to a new after but it mixes all up.
Below is the Lua Code.
Can someone tell me where I am doing wrong?
function grcall()
WinWith = 900
GW = {}
GW = InfoBox:New("Title")
GW.windowWidth = WinWith
GW:WindowPosition(GW.windowPositions.NE)
GW.columns = 7
-- Title Part Which is also not working.
GW:AddBar("Name")
GW:AddBar("Status")
GW:AddBar("HP")
GW:AddBar("Mana")
GW:AddBar("Move")
GW:AddBar("TNL")
GW:AddBar("Align")
Addgroupmates()
GW:Update()
end -- function
function Addgroupmates()
count = table.getn(GroupList)
for i = 1, count do
GW:AddBar(GroupList[i].Name)
GW:AddBar(GroupList[i].Status)
a = GW:AddBar( GroupList[i].CurHp .. "/" .. GroupList[i].MaxHp,
math.floor(GroupList[i].CurHp / GroupList[i].MaxHp * 100),
"green", "firebrick", false,GW.barStyles.gradientFixed + GW.barStyles.glass )
a.gaugeHeight = a.cellHeight * .3
b = GW:AddBar(GroupList[i].CurMana .. "/" .. GroupList[i].MaxMana,
math.floor(GroupList[i].CurMana / GroupList[i].MaxMana * 100), "dodgerblue",
"purple", false, GW.barStyles.gradientFixed + GW.barStyles.glass)
GW.Bars[4].threshold = 50
b.gaugeHeight = b.cellHeight * .3
c = GW:AddBar(GroupList[i].CurMove .. "/" .. GroupList[i].MaxMove,
math.floor(GroupList[i].CurMove / GroupList[i].MaxMove * 100),
"green", "firebrick", false,GW.barStyles.gradientFixed + GW.barStyles.glass )
c.gaugeHeight = c.cellHeight * .3
d = GW:AddBar(GroupList[i].Tnl, 50)
d.gaugeHeight = d.cellHeight * .3
e = GW:AddBar(GroupList[i].Align, 50)
e.gaugeHeight = e.cellHeight * .3
end -- if
end -- function AddGroupmates
[EDIT] Code tags added, code indented. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 27 Aug 2014 07:52 PM (UTC) |
Message
|
|
To make your code more readable please use [code] tags as described here.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 27 Aug 2014 07:55 PM (UTC) |
Message
| It's hard to say from your description:
- What your data is
- What you expect to see
- What you actually see
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Cyote
(9 posts) Bio
|
Date
| Reply #3 on Wed 27 Aug 2014 08:06 PM (UTC) |
Message
| Oki I did some more test about it
Created another Info Box Set Columns to 7 elements
Added 1st element and then start adding elements 1 by 1.
Everything went normal till 7th element. Then after 7
It divided first row into 2 rows moved 3 elements from first
row to second row and then added new one after the 4th one
to the first row
Next element is added below the 5th one on to second row.
I don't think its working properly or am I doing something
wrong still? | Top |
|
Posted by
| Cyote
(9 posts) Bio
|
Date
| Reply #4 on Wed 27 Aug 2014 08:13 PM (UTC) |
Message
| What I would like to see is like this
Ex:
Name Status HP Mana Move Tnl Align
Tetra Standing 100/100 100/100 100/100 1000 1000
Penta Standing 100/100 100/100 100/100 1000 1000
Octa Standing 100/100 100/100 100/100 1000 1000
But it gives a complete mix.
Thanks :) | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #5 on Thu 28 Aug 2014 04:25 AM (UTC) |
Message
| It looks to me like you are adding the bars each time you call Addgroupmates, so I'm not totally surprised you get more and more bars. You might want to rework so that before adding them you remove existing ones, or just start a new InfoBox from scratch. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Cyote
(9 posts) Bio
|
Date
| Reply #6 on Sun 31 Aug 2014 09:22 AM (UTC) |
Message
| Update:
Well I decided to have each groupie stat to have its own infobox but then, depending on the number of groupmates
windows aligned themselves splitting the space equally,
which was something I don't want generally. (I want to see them as a single group without space between them.) Looks
like tho its nice code, infobox doesn't fit my design goals.
So decided to play with miniwindows instead.
Btw Sublime Flow doesn't open my files automatically when
selected as Script Editor, anyone knows how to fix it?
Thanks. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
19,842 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top