-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from Hamsda:ootr
update to version 3.4.4.0
- Loading branch information
Showing
48 changed files
with
375 additions
and
224 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
ProgBadgeItem = CustomItem:extend() | ||
|
||
function ProgBadgeItem:init(name, code, imagePath, badges) | ||
self:createItem(name) | ||
self.code = code | ||
self.badges = badges | ||
self:setProperty("active", false) | ||
self:setProperty("badgeNum", 0) | ||
self.imageBase = ImageReference:FromPackRelativePath(imagePath) | ||
self.ItemInstance.PotentialIcon = self.imageBase | ||
self:updateIcon() | ||
end | ||
|
||
function ProgBadgeItem:updateIcon() | ||
local img_mod = "" | ||
if self:getProperty("badgeNum") and self:getProperty("badgeNum") > 0 then | ||
img_mod = "overlay|"..self.badges[self:getProperty("badgeNum")] | ||
end | ||
if not self:getProperty("active") then | ||
img_mod = img_mod..",@disabled" | ||
end | ||
self.ItemInstance.Icon = ImageReference:FromImageReference(self.imageBase, img_mod) | ||
end | ||
|
||
function ProgBadgeItem:onLeftClick() | ||
self:setProperty("active", not self:getProperty("active")) | ||
end | ||
|
||
function ProgBadgeItem:onRightClick() | ||
if self:getProperty("badgeNum") then | ||
if self:getProperty("badgeNum") == #self.badges then | ||
self:setProperty("badgeNum", 0) | ||
else | ||
self:setProperty("badgeNum", self:getProperty("badgeNum") + 1) | ||
end | ||
end | ||
end | ||
|
||
function ProgBadgeItem:canProvideCode(code) | ||
if self.code and self.code == code then | ||
return true | ||
end | ||
return false | ||
end | ||
|
||
function ProgBadgeItem:providesCode(code) | ||
if self:getProperty("active") and self:canProvideCode(code) then | ||
return 1 | ||
end | ||
return 0 | ||
end | ||
|
||
function ProgBadgeItem:advanceToCode(code) | ||
if code == nil or self:canProvideCode(code) then | ||
self:setProperty("active", true) | ||
end | ||
end | ||
|
||
function ProgBadgeItem:save() | ||
local saveData = {} | ||
saveData["active"] = self:getProperty("active") | ||
saveData["badgeNum"] = self:getProperty("badgeNum") | ||
return saveData | ||
end | ||
|
||
function ProgBadgeItem:load(data) | ||
if data["active"] ~= nil then | ||
self:setProperty("active", data["active"]) | ||
end | ||
if data["badgeNum"] ~= nil then | ||
self:setProperty("badgeNum", data["badgeNum"]) | ||
end | ||
return true | ||
end | ||
|
||
function ProgBadgeItem:propertyChanged(key, value) | ||
self:updateIcon() | ||
end |
Oops, something went wrong.