Skip to content

Commit

Permalink
Lua: Ensure Custom badges inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
manups4e committed Oct 26, 2024
1 parent b341800 commit 2964e33
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 5 deletions.
14 changes: 13 additions & 1 deletion ScaleformUI_Lua/src/Menus/UIMenu/Items/UIMenuCheckboxItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,21 @@ function UIMenuCheckboxItem:LeftBadge(Badge)
end
end

function UIMenuCheckboxItem:CustomLeftBadge(txd,txn)
if txd ~= nil and txd ~= "" and txn ~= nil and txn ~= "" then
self.Base:CustomLeftBadge(txd,txn, self)
else
return self.Base:LeftBadge()
end
end

---RightBadge
function UIMenuCheckboxItem:RightBadge()
error("This item does not support badges")
error("This item does not support right badges")
end

function UIMenuCheckboxItem:CustomRightBadge()
error("This item does not support right badges")
end

---RightLabel
Expand Down
14 changes: 13 additions & 1 deletion ScaleformUI_Lua/src/Menus/UIMenu/Items/UIMenuDynamicListItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,21 @@ function UIMenuDynamicListItem:LeftBadge(Badge)
end
end

function UIMenuDynamicListItem:CustomLeftBadge(txd,txn)
if txd ~= nil and txd ~= "" and txn ~= nil and txn ~= "" then
self.Base:CustomLeftBadge(txd,txn, self)
else
return self.Base:LeftBadge()
end
end

---RightBadge
function UIMenuDynamicListItem:RightBadge()
error("This item does not support badges")
error("This item does not support right badges")
end

function UIMenuDynamicListItem:CustomRightBadge()
error("This item does not support right badges")
end

---RightLabel
Expand Down
16 changes: 15 additions & 1 deletion ScaleformUI_Lua/src/Menus/UIMenu/Items/UIMenuListItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,23 @@ function UIMenuListItem:LeftBadge(Badge)
end
end

--- CustomLeftBadge
function UIMenuListItem:CustomLeftBadge(txd,txn)
if txd ~= nil and txd ~= "" and txn ~= nil and txn ~= "" then
self.Base:CustomLeftBadge(txd,txn, self)
else
return self.Base:LeftBadge()
end
end


---RightBadge
function UIMenuListItem:RightBadge()
error("This item does not support badges")
error("This item does not support right badges")
end

function UIMenuListItem:CustomRightBadge()
error("This item does not support right badges")
end

---RightLabel
Expand Down
14 changes: 13 additions & 1 deletion ScaleformUI_Lua/src/Menus/UIMenu/Items/UIMenuProgressItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,21 @@ function UIMenuProgressItem:LeftBadge(Badge)
end
end

function UIMenuProgressItem:CustomLeftBadge(txd,txn)
if txd ~= nil and txd ~= "" and txn ~= nil and txn ~= "" then
self.Base:CustomLeftBadge(txd,txn, self)
else
return self.Base:LeftBadge()
end
end

---RightBadge
function UIMenuProgressItem:RightBadge()
error("This item does not support badges")
error("This item does not support right badges")
end

function UIMenuProgressItem:CustomRightBadge()
error("This item does not support right badges")
end

---RightLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ function UIMenuSeparatorItem:RightBadge()
error("This item does not support badges")
end

function UIMenuSeparatorItem:CustomLeftBadge()
error("This item does not support badges")
end

---RightBadge
function UIMenuSeparatorItem:CustomRightBadge()
error("This item does not support badges")
end

---RightLabel
function UIMenuSeparatorItem:RightLabel()
error("This item does not support a right label")
Expand Down
14 changes: 13 additions & 1 deletion ScaleformUI_Lua/src/Menus/UIMenu/Items/UIMenuSliderItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,20 @@ function UIMenuSliderItem:LeftBadge(Badge)
end
end

function UIMenuSliderItem:CustomLeftBadge(txd,txn)
if txd ~= nil and txd ~= "" and txn ~= nil and txn ~= "" then
self.Base:CustomLeftBadge(txd,txn, self)
else
return self.Base:LeftBadge()
end
end

function UIMenuSliderItem:RightBadge()
error("This item does not support badges")
error("This item does not support right badges")
end

function UIMenuSliderItem:CustomRightBadge()
error("This item does not support right badges")
end

function UIMenuSliderItem:RightLabel()
Expand Down
8 changes: 8 additions & 0 deletions ScaleformUI_Lua/src/Menus/UIMenu/Items/UIMenuStatsItem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ function UIMenuStatsItem:RightBadge()
error("This item does not support badges")
end

function UIMenuStatsItem:CustomLeftBadge()
error("This item does not support badges")
end

function UIMenuStatsItem:CustomRightBadge()
error("This item does not support badges")
end

---RightLabel
function UIMenuStatsItem:RightLabel()
error("This item does not support a right label")
Expand Down

0 comments on commit 2964e33

Please sign in to comment.