Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- I HATE writing GUIs
- DroidButtons.ui = {}
- local ui = DroidButtons.ui
- local bool_map = {[true] = 'ON', [false] = 'OFF'}
- local state_map = {ON = true, OFF = false}
- local val_map = {[true] = 1, [false] = 0}
- local commandlist, joystick_cmds, joycmdlist2, joycmdlist3, joycmdlist, radarcmdlist, radarcmdlist2 = dofile('vars.lua')
- function ui:BuildButtonsTab()
- local buttons_tab
- local buttonlist
- local deletebutton, editbutton, addbutton
- buttonlist = iup.stationsublist{}
- deletebutton = iup.stationbutton{title = 'Delete', active = 'NO'}
- editbutton = iup.stationbutton{title = 'Edit', active = 'NO'}
- addbutton = iup.stationbutton{title = 'Add', active = 'YES'}
- buttons_tab = iup.vbox{
- iup.vbox{iup.hbox{iup.fill{}},iup.fill{}},
- --buttonlist,
- --iup.hbox{addbutton, editbutton, deletebutton, gap = 15},
- tabtitle = 'Buttons',
- }
- -- ----------------------------------------------------------------
- return buttons_tab
- end
- function ui:BuildAccelTab()
- local accel_tab
- local xaxiscmd, yaxiscmd, custom_accel, set_tilt
- xaxiscmd = iup.stationsublist(joycmdlist);
- yaxiscmd = iup.stationsublist(joycmdlist);
- custom_accel = iup.stationtoggle{title = 'Use Custom Accelerometer Bindings'}
- set_tilt = iup.stationbutton{title = 'Set'}
- accel_tab = iup.vbox{
- -- iup.label{title = 'Tilt Configuration'},
- -- custom_accel,
- -- iup.hbox{iup.label{title = 'Left/Right'}, xaxiscmd},
- -- iup.hbox{iup.label{title = 'Fore/Back'}, yaxiscmd},
- -- set_tilt,
- -- gap = 10,
- tabtitle = 'Accelerometer',
- }
- -- ----------------------------------------------------------------
- return accel_tab
- end
- function ui:BuildSupportTab()
- local support_tab
- local vo_forum_button
- local vo_ticket_button
- local voupr_button
- local voupr_db_button
- local db_thread_button
- local db_ticket_button
- local support_button_size
- voupr_button = iup.stationbutton{title = "Vendetta Online Unofficial Plugin Repository"}
- -- Get the size of the largest button for uniformity
- iup.Map(voupr_button)
- support_button_size = voupr_button.size
- vo_forum_button = iup.stationbutton{title = "Vendetta Online Forums", size = support_button_size}
- vo_ticket_button = iup.stationbutton{title = "Vendetta Online Support Ticket", size = support_button_size}
- voupr_db_button = iup.stationbutton{title = "VOUPR: DroidButtons", size = support_button_size}
- db_thread_button = iup.stationbutton{title = "DroidButtons Discussion Thread", size = support_button_size}
- db_ticket_button = iup.stationbutton{title = "DroidButtons Issue Tracker", size = support_button_size}
- support_tab = iup.vbox{
- -- vo_forum_button,
- -- vo_ticket_button,
- -- voupr_button,
- -- voupr_db_button,
- -- db_thread_button,
- -- db_ticket_button,
- -- gap = 10,
- tabtitle = 'Support',
- }
- -- ----------------------------------------------------------------
- function vo_forum_button:action() Game.OpenWebBrowser("http://www.vendetta-online.com/x/msgboard/") end
- function vo_ticket_button:action() Game.OpenWebBrowser("http://www.vendetta-online.com/x/support") end
- function voupr_button:action() Game.OpenWebBrowser("http://www.voupr.com") end
- function voupr_db_button:action() Game.OpenWebBrowser("http://www.voupr.com/plugin.php?name=droidbuttons") end
- function db_thread_button:action() Game.OpenWebBrowser("http://www.vendetta-online.com/x/msgboard/16/27594") end
- function db_ticket_button:action() Game.OpenWebBrowser("https://bitbucket.org/draugath/droidbuttons/issues?status=new&status=open") end
- return support_tab
- end
- function ui:BuildMainDialog()
- local dlg, content
- local tabs
- local closebutton
- local optionsbutton
- tabs = iup.pda_root_tabs{
- self:BuildButtonsTab(),
- --self:BuildAccelTab(),
- --self:BuildSupportTab(),
- }
- optionsbutton = iup.stationbutton{title = "Options"}
- closebutton = iup.stationbutton{title = "Close"}
- content = iup.pdarootframe{
- iup.pdarootframebg{
- iup.vbox{
- tabs,
- iup.hbox{iup.fill{}, optionsbutton, closebutton, gap = 15},
- gap = 10,
- },
- },
- }
- dlg = iup.dialog{
- content,
- defaultesc = closebutton,
- bgcolor = "0 0 0 *",
- fullscreen="YES",
- title = 'DroidButtons v'..DroidButtons.version..': Button Management',
- border = "NO",
- resize = "NO",
- menubox = "YES",
- topmost = "YES",
- }
- iup.Map(dlg)
- -- ----------------------------------------------------------------
- function closebutton:action()
- HideDialog(iup.GetDialog(self))
- end
- return dlg
- end
- ui.dialog = ui:BuildMainDialog()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement