|
|
#1 |
|
Junior Member
Join Date: Mar 2008
Posts: 65
|
I have been developing a GUI framework for World of Warcraft. It has been used on several of my addons and, as I've found it a robust concept, decided it was a good time to share it with the community.
Sushi-3.0 Sushi is a library that tries to follow a different approach from most of the current GUI frameworks. It tries to be:
Documentation can be found at this page. Here are some examples: 1) Simple drop down Code:
local myDropdown = SushiDropdown()
myDropdown:SetPoint('CENTER')
myDropdown:SetLabel('My Awesome Dropdown')
myDropdown:AddLine('Salmon')
myDropdown:AddLine('Grouper')
myDropdown:AddLine('None')
myDropdown:SetCall('OnInput', function(self, v)
if v == 'None' then
print('Not hungry?')
else
print('You cannot have it.')
end
end)
Code:
local myGroup = SushiGroup()
group:SetOrientation('HORIZONTAL')
group:SetResizing('VERTICAL') -- not necessary, vertical by default
group:SetChildren(function()
local firstCheck = group:Create('Check')
firstCheck:SetLabel('Banana')
local secondCheck = group:Create('Check')
secondCheck:SetLabel('Orange')
secondCheck:SetCall('OnClick', function()
Eat_Orange = not Eat_Orange
end)
end)
__________________
Developer of addons such as Bagnon, OmniCC and PetTracker. Last edited by Jaliborc; 07-18-2012 at 08:28 AM. |
|
|
|
|
|
#2 |
|
Member
Join Date: Jun 2007
Posts: 12
|
I see you put a lot in gui system.If you have interesting for the code in this pic, you can contact me. Last edited by Phanx; 07-12-2012 at 10:54 PM. Reason: Fixed attachment link |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2008
Posts: 65
|
I have finally started to write the framework's documentation: class reference.
More than half of the classes are already documented, and all others should be as well in less than a week. I will also add images for the most visual classes.
__________________
Developer of addons such as Bagnon, OmniCC and PetTracker. |
|
|
|
|
|
#4 | |
|
Junior Member
Join Date: Mar 2008
Posts: 65
|
Quote:
__________________
Developer of addons such as Bagnon, OmniCC and PetTracker. |
|
|
|
|
|
|
#5 |
|
Seal Cub Clubbing Club
Join Date: May 2005
Location: California, US
Posts: 7,760
|
The one attached to his post. The link was invisible for some reason; I've fixed it now.
__________________
& Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge Troubleshoot an addon | Turn any code into an addon | More addon resources Need help with your code? Attach or paste your whole, real files. Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead! |
|
|
|
|
|
#6 | |
|
Junior Member
Join Date: Mar 2008
Posts: 65
|
Quote:
EDIT: Forget, now I can.
__________________
Developer of addons such as Bagnon, OmniCC and PetTracker. |
|
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Mar 2008
Posts: 65
|
What framework are you using?
__________________
Developer of addons such as Bagnon, OmniCC and PetTracker. |
|
|
|
|
|
#8 |
|
Member
Join Date: Jun 2007
Posts: 12
|
IGAS (In-Game Addon System)
This is a full object-oriented system?and now just in beta version, maybe can be released before mop. The system apply things like: Class Interface Struct Enum Class and interface make custom widget more simple and efficient.Here is a sample for class and interface.It make a button class type that can be changed to movable & resizable mode. Test sample pic: you can visit bbs.ngacn.cc first, then view these pics http://img.ngacn.cc/attachments/mon_...17b7158fe.jpeg Code part: http://img.ngacn.cc/attachments/mon_...17c14832a.jpeg Code:
IGAS:NewAddon "Test" -- Create Addon Test and make env to the addon
import "System.Widget" -- import namespace System.Widget,
--which contains useful wow widgets and interfaces.
class "MButton" -- Start define MButton class
inherit "NormalButton" -- NormalButton is a custom button type
extend "IFMovable" "IFResizable" -- IFMovable apply the ability to into move mode
-- IFResizable apply the ability to into resize mode
-- property definition, IFMovingGroup is difined in IFMovable, need override,
-- to point which group the MButton's object in.
property "IFMovingGroup" {
Get = function(self) return "MButton" end,
}
property "IFResizingGroup" {
Get = function(self) return "MButton" end,
}
-- the function with name as the class name, is the constructor
function MButton(name, parent)
local btn = Super(name, parent) -- Super is NormalButton here
-- Setup
btn.Style = "Classic"
btn.Height = 26
btn.Width = 60
btn.Text = name
btn:SetPoint("CENTER")
return btn
end
endclass "MButton" -- end the definition of MButton
----------------------------------
-- Frame set part
----------------------------------
f = Form("Test") -- no need use local because this code is running in add-on env
-- Form ,you know
for i = 1, 10 do
btn = MButton("Button_" .. i, f)
if i%3 == 0 then btn.Visible = false end
end
------------------------------------
-- Turn move & resize mode on
------------------------------------
IGAS.System.Widget.IFMovable._ModeOn("Mbutton")
IGAS.System.Widget.IFResizable._ModeOn("Mbutton")
Last edited by kurapica; 10-06-2012 at 02:35 PM. |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Sep 2010
Posts: 2
|
I'm starting to think about building a configuration GUI for my new addon and I encountered the problem that you found with other frameworks being data-driven.
I like what I've read about Sushi so far and I'll give it a try. One particular class that I wish Sushi had is a Listbox widget that I could use to build a control like this: http://www.codeproject.com/KB/aspnet...ol/ListBox.jpg I may end up implementing it myself if I can't find what I need anywhere else. |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Mar 2008
Posts: 65
|
Glad you lik!
That should not be hard to implement in Suhsi. I advice you to first make a "ListButton" class (you can use one of the button classes as a base for it, should make most of the work already), and then the List class. You can use Group as a base for the last one, which will take care of managing all the buttons for you!
__________________
Developer of addons such as Bagnon, OmniCC and PetTracker. |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 06:25 AM.
WowAce Forums





