Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
QuickMenu properly uses and returns dialog_data
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWilko committed Mar 30, 2015
1 parent 2911ece commit fbfafa2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mods/base/req/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LNetwork.ExceptPeerString = "{1}/{2}/{3}/{4}"
LNetwork.Split = "[/]"

function LNetwork:IsMultiplayer()
if managers.network == nil then
if not managers.network then
return false
end
return managers.network:session()
Expand Down
10 changes: 5 additions & 5 deletions mods/base/req/quick_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end
function QuickMenu:init( title, text, options, show_immediately )

QuickMenu._menu_id_index = QuickMenu._menu_id_index + 1
self.menu_data = {
self.dialog_data = {
id = QuickMenu._menu_id_key .. tostring( QuickMenu._menu_id_index ),
title = title,
text = text,
Expand Down Expand Up @@ -45,10 +45,10 @@ function QuickMenu:init( title, text, options, show_immediately )
button.cancel_button = option.is_cancel_button or false

if option.is_focused_button then
self.menu_data.focus_button = #self.menu_data.button_list + 1
self.dialog_data.focus_button = #self.dialog_data.button_list + 1
end

table.insert( self.menu_data.button_list, button )
table.insert( self.dialog_data.button_list, button )

end

Expand All @@ -74,7 +74,7 @@ function QuickMenu:Show()

if not self.visible then
self.visible = true
managers.system_menu:show( self.menu_data )
managers.system_menu:show( self.dialog_data )
end

end
Expand All @@ -86,7 +86,7 @@ end
function QuickMenu:Hide()

if self.visible then
managers.system_menu:close( self.menu_data.id )
managers.system_menu:close( self.dialog_data.id )
self.visible = false
end

Expand Down

0 comments on commit fbfafa2

Please sign in to comment.