diff --git a/ootrando_overworldmap_hamsda.zip b/ootrando_overworldmap_hamsda.zip index a14468f4..18792756 100644 Binary files a/ootrando_overworldmap_hamsda.zip and b/ootrando_overworldmap_hamsda.zip differ diff --git a/ootrando_overworldmap_hamsda/README.md b/ootrando_overworldmap_hamsda/README.md index bf48bd67..aeaa24e5 100644 --- a/ootrando_overworldmap_hamsda/README.md +++ b/ootrando_overworldmap_hamsda/README.md @@ -33,6 +33,7 @@ If you have a dungeon marked as unknown in non-keysanity, some of the checks in Some of this functionality might not be immediately obvious: - Right clicking ![Fairy Ocarina](images/fairyocarina.png "Fairy Ocarina")/![Ocarina of Time](images/ocarina.png "Ocarina of Time") will overlay it with ![Scarecrow](images/overlay_scarecrow.png "Scarecrow") indicating that you have confirmed the scarecrow song or started with free scarecrow. Locations that make use of the scarecrow will not show up unless this is turned on. The location of the scarecrow in Lake Hylia will automatically mark this when cleared first as child and then as adult. +- Right clicking any of the song icons, e.g. ![Zelda's Lullaby](images/song_zelda.png "Zelda's Lullaby"), will overlay them with a smaller version, e.g. ![Song of Time overlay](images/overlay_song_time.png "Song of Time overlay"), that can be cycled through. This overlay has no logical bearing, but can be used to indicate which song has been found where in non songsanity. - ![Triforce Piece](images/triforce_piece.png "Triforce Piece") is used as a counter for Triforce pieces in the Triforce Hunt mode. ## Settings (for map variants) diff --git a/ootrando_overworldmap_hamsda/changelog.md b/ootrando_overworldmap_hamsda/changelog.md index bf8a411e..dc153ed7 100644 --- a/ootrando_overworldmap_hamsda/changelog.md +++ b/ootrando_overworldmap_hamsda/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 3.4.4.0 + +- added KZ skip to ER +- improved song icon right click functionality + ## 3.4.3.0 - improved same-scene interior connections diff --git a/ootrando_overworldmap_hamsda/images/bolero.png b/ootrando_overworldmap_hamsda/images/bolero.png deleted file mode 100644 index 20d642b8..00000000 Binary files a/ootrando_overworldmap_hamsda/images/bolero.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/epona_colored.png b/ootrando_overworldmap_hamsda/images/epona_colored.png deleted file mode 100644 index f8cdf1f9..00000000 Binary files a/ootrando_overworldmap_hamsda/images/epona_colored.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/minuet.png b/ootrando_overworldmap_hamsda/images/minuet.png deleted file mode 100644 index 8e59df6a..00000000 Binary files a/ootrando_overworldmap_hamsda/images/minuet.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/nocturne.png b/ootrando_overworldmap_hamsda/images/nocturne.png deleted file mode 100644 index a391b22c..00000000 Binary files a/ootrando_overworldmap_hamsda/images/nocturne.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_bolero.png b/ootrando_overworldmap_hamsda/images/overlay_song_bolero.png new file mode 100644 index 00000000..c7ba5778 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_bolero.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_epona.png b/ootrando_overworldmap_hamsda/images/overlay_song_epona.png new file mode 100644 index 00000000..daab2757 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_epona.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_minuet.png b/ootrando_overworldmap_hamsda/images/overlay_song_minuet.png new file mode 100644 index 00000000..b627fd91 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_minuet.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_nocturne.png b/ootrando_overworldmap_hamsda/images/overlay_song_nocturne.png new file mode 100644 index 00000000..be0eaef9 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_nocturne.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_prelude.png b/ootrando_overworldmap_hamsda/images/overlay_song_prelude.png new file mode 100644 index 00000000..cecd4b38 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_prelude.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_requiem.png b/ootrando_overworldmap_hamsda/images/overlay_song_requiem.png new file mode 100644 index 00000000..78e55daa Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_requiem.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_saria.png b/ootrando_overworldmap_hamsda/images/overlay_song_saria.png new file mode 100644 index 00000000..9f1b2496 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_saria.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_serenade.png b/ootrando_overworldmap_hamsda/images/overlay_song_serenade.png new file mode 100644 index 00000000..4fc8fd86 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_serenade.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_storms.png b/ootrando_overworldmap_hamsda/images/overlay_song_storms.png new file mode 100644 index 00000000..15a96ff1 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_storms.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_sun.png b/ootrando_overworldmap_hamsda/images/overlay_song_sun.png new file mode 100644 index 00000000..5d87bba4 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_sun.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_time.png b/ootrando_overworldmap_hamsda/images/overlay_song_time.png new file mode 100644 index 00000000..bc9e23fb Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_time.png differ diff --git a/ootrando_overworldmap_hamsda/images/overlay_song_zelda.png b/ootrando_overworldmap_hamsda/images/overlay_song_zelda.png new file mode 100644 index 00000000..c4f15980 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/overlay_song_zelda.png differ diff --git a/ootrando_overworldmap_hamsda/images/prelude.png b/ootrando_overworldmap_hamsda/images/prelude.png deleted file mode 100644 index 47c5c6c6..00000000 Binary files a/ootrando_overworldmap_hamsda/images/prelude.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/requiem.png b/ootrando_overworldmap_hamsda/images/requiem.png deleted file mode 100644 index f30e6c45..00000000 Binary files a/ootrando_overworldmap_hamsda/images/requiem.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/saria_colored.png b/ootrando_overworldmap_hamsda/images/saria_colored.png deleted file mode 100644 index 46124f26..00000000 Binary files a/ootrando_overworldmap_hamsda/images/saria_colored.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/serenade.png b/ootrando_overworldmap_hamsda/images/serenade.png deleted file mode 100644 index a50f1754..00000000 Binary files a/ootrando_overworldmap_hamsda/images/serenade.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/song_bolero.png b/ootrando_overworldmap_hamsda/images/song_bolero.png new file mode 100644 index 00000000..0cfba73a Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_bolero.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_epona.png b/ootrando_overworldmap_hamsda/images/song_epona.png new file mode 100644 index 00000000..349ac2a1 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_epona.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_minuet.png b/ootrando_overworldmap_hamsda/images/song_minuet.png new file mode 100644 index 00000000..982940b5 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_minuet.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_nocturne.png b/ootrando_overworldmap_hamsda/images/song_nocturne.png new file mode 100644 index 00000000..9dc03d40 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_nocturne.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_prelude.png b/ootrando_overworldmap_hamsda/images/song_prelude.png new file mode 100644 index 00000000..1f048ce4 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_prelude.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_requiem.png b/ootrando_overworldmap_hamsda/images/song_requiem.png new file mode 100644 index 00000000..1c8c4bcc Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_requiem.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_saria.png b/ootrando_overworldmap_hamsda/images/song_saria.png new file mode 100644 index 00000000..dbbf3697 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_saria.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_serenade.png b/ootrando_overworldmap_hamsda/images/song_serenade.png new file mode 100644 index 00000000..96279be7 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_serenade.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_storms.png b/ootrando_overworldmap_hamsda/images/song_storms.png new file mode 100644 index 00000000..43e59760 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_storms.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_sun.png b/ootrando_overworldmap_hamsda/images/song_sun.png new file mode 100644 index 00000000..cbb739b7 Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_sun.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_time.png b/ootrando_overworldmap_hamsda/images/song_time.png new file mode 100644 index 00000000..d75e49ff Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_time.png differ diff --git a/ootrando_overworldmap_hamsda/images/song_zelda.png b/ootrando_overworldmap_hamsda/images/song_zelda.png new file mode 100644 index 00000000..e24a94fc Binary files /dev/null and b/ootrando_overworldmap_hamsda/images/song_zelda.png differ diff --git a/ootrando_overworldmap_hamsda/images/storms_colored.png b/ootrando_overworldmap_hamsda/images/storms_colored.png deleted file mode 100644 index 7e4cec97..00000000 Binary files a/ootrando_overworldmap_hamsda/images/storms_colored.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/sun_colored.png b/ootrando_overworldmap_hamsda/images/sun_colored.png deleted file mode 100644 index ee6dad35..00000000 Binary files a/ootrando_overworldmap_hamsda/images/sun_colored.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/time_colored.png b/ootrando_overworldmap_hamsda/images/time_colored.png deleted file mode 100644 index 923bfbb0..00000000 Binary files a/ootrando_overworldmap_hamsda/images/time_colored.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/images/zelda_colored.png b/ootrando_overworldmap_hamsda/images/zelda_colored.png deleted file mode 100644 index 060b09f5..00000000 Binary files a/ootrando_overworldmap_hamsda/images/zelda_colored.png and /dev/null differ diff --git a/ootrando_overworldmap_hamsda/items/quest.json b/ootrando_overworldmap_hamsda/items/quest.json index e62e5527..abd1be3e 100644 --- a/ootrando_overworldmap_hamsda/items/quest.json +++ b/ootrando_overworldmap_hamsda/items/quest.json @@ -88,174 +88,6 @@ "img": "images/rupee.png", "codes": "rupee" }, - { - "name": "Zelda's Lullaby", - "type": "toggle", - "loop": true, - "img": "images/zelda_colored.png", - "codes": "lullaby,zl" - }, - { - "name": "Zelda's Lullaby w/ check", - "type": "toggle_badged", - "base_item": "lullaby", - "img": "images/check.png", - "codes": "lullabycheck,zlcheck" - }, - { - "name": "Saria's Song", - "type": "toggle", - "loop": true, - "img": "images/saria_colored.png", - "codes": "saria" - }, - { - "name": "Saria's Song w/ check", - "type": "toggle_badged", - "base_item": "saria", - "img": "images/check.png", - "codes": "sariacheck" - }, - { - "name": "Epona's Song", - "type": "toggle", - "loop": true, - "img": "images/epona_colored.png", - "codes": "epona" - }, - { - "name": "Epona's Song w/ check", - "type": "toggle_badged", - "base_item": "epona", - "img": "images/check.png", - "codes": "eponacheck" - }, - { - "name": "Sun's Song", - "type": "toggle", - "loop": true, - "img": "images/sun_colored.png", - "codes": "sun" - }, - { - "name": "Sun's Song w/ check", - "type": "toggle_badged", - "base_item": "sun", - "img": "images/check.png", - "codes": "suncheck" - }, - { - "name": "Song of Time", - "type": "toggle", - "loop": true, - "img": "images/time_colored.png", - "codes": "time,sot" - }, - { - "name": "Song of Time w/ check", - "type": "toggle_badged", - "base_item": "time", - "img": "images/check.png", - "codes": "timecheck,sotcheck" - }, - { - "name": "Song of Storms", - "type": "toggle", - "loop": true, - "img": "images/storms_colored.png", - "codes": "storm,sos" - }, - { - "name": "Song of Storms w/ check", - "type": "toggle_badged", - "base_item": "storm", - "img": "images/check.png", - "codes": "stormcheck,soscheck" - }, - { - "name": "Minuet of Forest", - "type": "toggle", - "loop": true, - "img": "images/minuet.png", - "codes": "minuet,mof" - }, - { - "name": "Minuet of Forest w/ check", - "type": "toggle_badged", - "base_item": "minuet", - "img": "images/check.png", - "codes": "minuetcheck,mofcheck" - }, - { - "name": "Bolero of Fire", - "type": "toggle", - "loop": true, - "img": "images/bolero.png", - "codes": "bolero,bof" - }, - { - "name": "Bolero of Fire w/ check", - "type": "toggle_badged", - "base_item": "bolero", - "img": "images/check.png", - "codes": "bolerocheck,bofcheck" - }, - { - "name": "Serenade of Water", - "type": "toggle", - "loop": true, - "img": "images/serenade.png", - "codes": "serenade,sow" - }, - { - "name": "Serenade of Water w/ check", - "type": "toggle_badged", - "base_item": "serenade", - "img": "images/check.png", - "codes": "serenadecheck,sowcheck" - }, - { - "name": "Requiem of Spirit", - "type": "toggle", - "loop": true, - "img": "images/requiem.png", - "codes": "requiem,ros" - }, - { - "name": "Requiem of Spirit w/ check", - "type": "toggle_badged", - "base_item": "requiem", - "img": "images/check.png", - "codes": "requiemcheck,roscheck" - }, - { - "name": "Nocturne of Shadow", - "type": "toggle", - "loop": true, - "img": "images/nocturne.png", - "codes": "nocturne,nos" - }, - { - "name": "Nocturne of Shadow w/ check", - "type": "toggle_badged", - "base_item": "nocturne", - "img": "images/check.png", - "codes": "nocturnecheck,noscheck" - }, - { - "name": "Prelude of Light", - "type": "toggle", - "loop": true, - "img": "images/prelude.png", - "codes": "prelude,pol" - }, - { - "name": "Prelude of Light w/ check", - "type": "toggle_badged", - "base_item": "prelude", - "img": "images/check.png", - "codes": "preludecheck,polcheck" - }, { "name": "Forest Medallion", "type": "toggle", diff --git a/ootrando_overworldmap_hamsda/layouts/item_grids.json b/ootrando_overworldmap_hamsda/layouts/item_grids.json index 2497ac02..1c5fb5a2 100644 --- a/ootrando_overworldmap_hamsda/layouts/item_grids.json +++ b/ootrando_overworldmap_hamsda/layouts/item_grids.json @@ -65,20 +65,20 @@ "skulltula" ], [ - "lullabycheck", - "eponacheck", - "sariacheck", - "suncheck", - "timecheck", - "stormcheck" - ], - [ - "minuetcheck", - "bolerocheck", - "serenadecheck", - "requiemcheck", - "nocturnecheck", - "preludecheck" + "lullaby", + "epona", + "saria", + "sun", + "time", + "storm" + ], + [ + "minuet", + "bolero", + "serenade", + "requiem", + "nocturne", + "prelude" ] ] }, @@ -142,23 +142,23 @@ "hoverboots" ], [ - "lullabycheck", - "eponacheck", - "sariacheck", - "suncheck", - "timecheck", - "stormcheck", + "lullaby", + "epona", + "saria", + "sun", + "time", + "storm", "wallet1", "magic", "skulltula" ], [ - "minuetcheck", - "bolerocheck", - "serenadecheck", - "requiemcheck", - "nocturnecheck", - "preludecheck", + "minuet", + "bolero", + "serenade", + "requiem", + "nocturne", + "prelude", "card", "agony", "triforce" @@ -206,20 +206,20 @@ "bottleminimal" ], [ - "lullabycheck", - "eponacheck", - "sariacheck", - "suncheck", - "timecheck", - "stormcheck" + "lullaby", + "epona", + "saria", + "sun", + "time", + "storm" ], [ - "minuetcheck", - "bolerocheck", - "serenadecheck", - "requiemcheck", - "nocturnecheck", - "preludecheck" + "minuet", + "bolero", + "serenade", + "requiem", + "nocturne", + "prelude" ] ] }, diff --git a/ootrando_overworldmap_hamsda/manifest.json b/ootrando_overworldmap_hamsda/manifest.json index 4022b309..4124a625 100644 --- a/ootrando_overworldmap_hamsda/manifest.json +++ b/ootrando_overworldmap_hamsda/manifest.json @@ -1,7 +1,7 @@ { "name": "OoT Randomizer - Map and Item Tracker", "game_name": "Ocarina of Time Randomizer", - "package_version": "3.4.3.0", + "package_version": "3.4.4.0", "package_uid": "ootrando_overworldmap_hamsda", "author": "Hamsda", "variants": { diff --git a/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua b/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua new file mode 100644 index 00000000..924ee53a --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua @@ -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 diff --git a/ootrando_overworldmap_hamsda/scripts/init.lua b/ootrando_overworldmap_hamsda/scripts/init.lua index b6a4ef65..1e3d0fb7 100644 --- a/ootrando_overworldmap_hamsda/scripts/init.lua +++ b/ootrando_overworldmap_hamsda/scripts/init.lua @@ -59,6 +59,9 @@ has_map = variant ~= "var_minimalist" and (not variant:find("itemsonly")) is_keys = variant:find("keysanity") is_er = variant:find("entrance") +ScriptHost:LoadScript("scripts/sdk/class.lua") +ScriptHost:LoadScript("scripts/sdk/custom_item.lua") + if has_map then if is_er then Tracker:AddItems("items/capture_entrance.json") @@ -77,6 +80,21 @@ Tracker:AddItems("items/equipment.json") Tracker:AddItems("items/items.json") Tracker:AddItems("items/dungeons.json") +ScriptHost:LoadScript("scripts/custom_prog_badge.lua") +local song_badges = {"images/overlay_song_zelda.png", "images/overlay_song_epona.png", "images/overlay_song_saria.png", "images/overlay_song_sun.png", "images/overlay_song_time.png", "images/overlay_song_storms.png", "images/overlay_song_minuet.png", "images/overlay_song_bolero.png", "images/overlay_song_serenade.png", "images/overlay_song_requiem.png", "images/overlay_song_nocturne.png", "images/overlay_song_prelude.png"} +ProgBadgeItem("Zelda's Lullaby", "lullaby", "images/song_zelda.png", song_badges) +ProgBadgeItem("Epona's Song", "epona", "images/song_epona.png", song_badges) +ProgBadgeItem("Saria's Song", "saria", "images/song_saria.png", song_badges) +ProgBadgeItem("Sun's Song", "sun", "images/song_sun.png", song_badges) +ProgBadgeItem("Song of Time", "time", "images/song_time.png", song_badges) +ProgBadgeItem("Song of Storms", "storm", "images/song_storms.png", song_badges) +ProgBadgeItem("Minuet of Forest", "minuet", "images/song_minuet.png", song_badges) +ProgBadgeItem("Bolero of Fire", "bolero", "images/song_bolero.png", song_badges) +ProgBadgeItem("Serenade of Water", "serenade", "images/song_serenade.png", song_badges) +ProgBadgeItem("Requiem of Spirit", "requiem", "images/song_requiem.png", song_badges) +ProgBadgeItem("Nocturne of Shadow", "nocturne", "images/song_nocturne.png", song_badges) +ProgBadgeItem("Prelude of Light", "prelude", "images/song_prelude.png", song_badges) + if is_er then ScriptHost:LoadScript("scripts/regions.lua") ScriptHost:LoadScript("scripts/logic_entrance.lua") @@ -98,15 +116,15 @@ if has_map then Tracker:AddLocations("locations/dungeons.json") Tracker:AddLayouts("layouts/options.json") end -end -ScriptHost:LoadScript("scripts/update_shared.lua") -if is_er then - ScriptHost:LoadScript("scripts/update_entrance.lua") -else - ScriptHost:LoadScript("scripts/update.lua") + ScriptHost:LoadScript("scripts/update_shared.lua") + if is_er then + ScriptHost:LoadScript("scripts/update_entrance.lua") + else + ScriptHost:LoadScript("scripts/update.lua") + end + tracker_on_accessibility_updated() end -tracker_on_accessibility_updated() if is_keys then Tracker:AddLayouts("layouts/dungeon_grids_keysanity.json") @@ -114,14 +132,16 @@ else Tracker:AddLayouts("layouts/dungeon_grids.json") end Tracker:AddLayouts("layouts/item_grids.json") -if is_er then - Tracker:AddLayouts("layouts/counters_entrance.json") - Tracker:AddLayouts("layouts/layouts_entrance.json") - Tracker:AddLayouts("layouts/capture_entrance.json") -else - Tracker:AddLayouts("layouts/counters.json") - Tracker:AddLayouts("layouts/layouts.json") - Tracker:AddLayouts("layouts/capture_spawns.json") +if has_map then + if is_er then + Tracker:AddLayouts("layouts/counters_entrance.json") + Tracker:AddLayouts("layouts/layouts_entrance.json") + Tracker:AddLayouts("layouts/capture_entrance.json") + else + Tracker:AddLayouts("layouts/counters.json") + Tracker:AddLayouts("layouts/layouts.json") + Tracker:AddLayouts("layouts/capture_spawns.json") + end end Tracker:AddLayouts("layouts/capture.json") Tracker:AddLayouts("layouts/tracker.json") diff --git a/ootrando_overworldmap_hamsda/scripts/regions.lua b/ootrando_overworldmap_hamsda/scripts/regions.lua index 48ea6f5a..19fa89b3 100644 --- a/ootrando_overworldmap_hamsda/scripts/regions.lua +++ b/ootrando_overworldmap_hamsda/scripts/regions.lua @@ -5268,7 +5268,7 @@ data_per_region = { if has("setting_fountain_open") or has("setting_fountain_adult") then return AccessibilityLevel.Normal end - return deliver_letter() + return or_accessibility(deliver_letter(), AccessibilityLevel.SequenceBreak) end }, ["ZD Shop"] = { diff --git a/ootrando_overworldmap_hamsda/scripts/sdk/class.lua b/ootrando_overworldmap_hamsda/scripts/sdk/class.lua new file mode 100644 index 00000000..1b1c9929 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/sdk/class.lua @@ -0,0 +1,113 @@ +-- This file is sourced from https://github.com/jonstoler/class.lua, and is licensed freely for any purpose, given thanks. Thank you. +-- License from https://github.com/jonstoler/class.lua/blob/master/LICENSE.md as of retrieving this source on 4/8/2019 + +-- By attaching this document to the given files (the “work”), you, the licensee, are hereby granted free usage in both personal and +-- commerical environments, without any obligation of attribution or payment (monetary or otherwise). The licensee is free to use, copy, +-- modify, publish, distribute, sublicence, and/or merchandise the work, subject to the licensee inflecting a positive message unto someone. +-- This includes (but is not limited to): smiling, being nice, saying “thank you”, assisting other persons, or any similar actions percolating the given concept. + +-- The above copyright notice serves as a permissions notice also, and may optionally be included in copies or portions of the work. + +-- The work is provided “as is”, without warranty or support, express or implied. The author(s) are not liable for any damages, misuse, or other claim, whether from or as a consequence of usage of the given work. + +Class = {} + +-- default (empty) constructor +function Class:init(...) end + +-- create a subclass +function Class:extend(obj) + local obj = obj or {} + + local function copyTable(table, destination) + local table = table or {} + local result = destination or {} + + for k, v in pairs(table) do + if not result[k] then + if type(v) == "table" and k ~= "__index" and k ~= "__newindex" then + result[k] = copyTable(v) + else + result[k] = v + end + end + end + + return result + end + + copyTable(self, obj) + + obj._ = obj._ or {} + + local mt = {} + + -- create new objects directly, like o = Object() + mt.__call = function(self, ...) + return self:new(...) + end + + -- allow for getters and setters + mt.__index = function(table, key) + local val = rawget(table._, key) + if val and type(val) == "table" and (val.get ~= nil or val.value ~= nil) then + if val.get then + if type(val.get) == "function" then + return val.get(table, val.value) + else + return val.get + end + elseif val.value then + return val.value + end + else + return val + end + end + + mt.__newindex = function(table, key, value) + local val = rawget(table._, key) + if val and type(val) == "table" and ((val.set ~= nil and val._ == nil) or val.value ~= nil) then + local v = value + if val.set then + if type(val.set) == "function" then + v = val.set(table, value, val.value) + else + v = val.set + end + end + val.value = v + if val and val.afterSet then val.afterSet(table, v) end + else + table._[key] = value + end + end + + setmetatable(obj, mt) + + return obj +end + +-- set properties outside the constructor or other functions +function Class:set(prop, value) + if not value and type(prop) == "table" then + for k, v in pairs(prop) do + rawset(self._, k, v) + end + else + rawset(self._, prop, value) + end +end + +-- create an instance of an object with constructor parameters +function Class:new(...) + local obj = self:extend({}) + if obj.init then obj:init(...) end + return obj +end + + +function class(attr) + attr = attr or {} + return Class:extend(attr) +end \ No newline at end of file diff --git a/ootrando_overworldmap_hamsda/scripts/sdk/custom_item.lua b/ootrando_overworldmap_hamsda/scripts/sdk/custom_item.lua new file mode 100644 index 00000000..2eb02d9b --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/sdk/custom_item.lua @@ -0,0 +1,102 @@ +CustomItem = class() + +function CustomItem:init() +end + +function CustomItem:createItem(name) + local function invokeLeftClick(item) + item.ItemState:onLeftClick() + end + local function invokeRightClick(item) + item.ItemState:onRightClick() + end + local function invokeCanProvideCode(item, code) + return item.ItemState:canProvideCode(code) + end + local function invokeProvidesCode(item, code) + return item.ItemState:providesCode(code) + end + local function invokeAdvanceToCode(item, code) + return item.ItemState:advanceToCode(code) + end + local function invokeSave(item) + return item.ItemState:save() + end + local function invokeLoad(item, data) + return item.ItemState:load(data) + end + local function invokePropertyChanged(item, key, value) + return item.ItemState:propertyChanged(key, value) + end + + self.ItemInstance = ScriptHost:CreateLuaItem() + self.ItemInstance.Name = name + self.ItemInstance.ItemState = self + self.ItemInstance.OnLeftClickFunc = invokeLeftClick + self.ItemInstance.OnRightClickFunc = invokeRightClick + self.ItemInstance.CanProvideCodeFunc = invokeCanProvideCode + self.ItemInstance.ProvidesCodeFunc = invokeProvidesCode + self.ItemInstance.AdvanceToCodeFunc = invokeAdvanceToCode + self.ItemInstance.SaveFunc = invokeSave + self.ItemInstance.LoadFunc = invokeLoad + self.ItemInstance.PropertyChangedFunc = invokePropertyChanged +end + +-- Called when your item is left-clicked +function CustomItem:onLeftClick() +end + +-- Called when your item is right-clicked +function CustomItem:onRightClick() +end + +-- Called to determine if your item can ever provide a given code +-- This is used (for example) when placing items on item grids. +-- +-- Returns true or false +function CustomItem:canProvideCode(code) + return false +end + +-- Called to determine if your item currently provides a given code, +-- and if so, the count provided. +-- +-- Returns an integer count >= 0 +function CustomItem:providesCode(code) + return 0 +end + +-- Called to request that your item advance to the given code. +function CustomItem:advanceToCode(code) +end + +-- Called when the user is saving progress. +-- +-- Return a table of key-value pairs, for simple value types (bool, integer, string, etc.) +function CustomItem:save() + return { } +end + +-- Called when the user is loading progress. Data is a table containing your saved data. +-- +-- Return true for success, false for failure (will fail the load) +function CustomItem:load(data) + return true +end + +-- Call to set a transaction-backed property. Properties set this way will support undo. +-- +-- Returns true if the value was actually modified. DO NOT OVERRIDE +function CustomItem:setProperty(key, value) + return self.ItemInstance:Set(key, value) +end + +-- Call to read a transaction-backed property. DO NOT OVERRIDE +function CustomItem:getProperty(key) + return self.ItemInstance:Get(key) +end + +-- Called when a transaction-backed property's value has changed. This will also happen +-- as part of setting a transaction-backed property. +function CustomItem:propertyChanged(key, value) +end \ No newline at end of file diff --git a/repository.json b/repository.json index 3e2a44c0..f73e0f46 100644 --- a/repository.json +++ b/repository.json @@ -10,7 +10,7 @@ "pins", "chathud" ], - "version": "3.4.3.0", + "version": "3.4.4.0", "uid": "ootrando_overworldmap_hamsda", "link": "https://hamsda.github.io/EmoTrackerPacks/ootrando_overworldmap_hamsda.zip", "documentation_url": "https://github.com/Hamsda/EmoTrackerPacks/blob/master/ootrando_overworldmap_hamsda/README.md",