Skip to content

Commit 23d6709

Browse files
committed
fix: improve dlc instructions
fixes alesan99#648
1 parent e0288b6 commit 23d6709

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

languages/english.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@
8484
"new mappack description": "create a mappack from scratch withthis!",
8585
"by": " by",
8686
"^_DLC":"",
87-
"dlc instructions": "download mappacks!\n\npick a mappack to\nopen the link\n\nafter you download\nthe mappack, put\nthe .zip inside\nyour dlc folder\n\n\n\n*there's enemies/ \n characters too!",
87+
"dlc instructions": "click/tap or\npress enter to\nopen the asset\nin your browser!",
8888
"dlc dl instructions": "click/tap or\npress enter to\ndownload assets!",
8989
"dlc enemy instructions": "open level editor\nto add enemies\nto your own maps",
90-
"dlc character instructions": "un-zip characters\ninto this folder:",
90+
"dlc asset instructions": "after you download\nthe asset, put\nthe .zip inside\nthe dlc folder",
9191
"open dlc folder": "open dlc folder",
9292
"characters folder": "characters folder",
9393
"opening link...": "opening link...",

menu.lua

+18-13
Original file line numberDiff line numberDiff line change
@@ -803,15 +803,25 @@ function menu_draw()
803803
love.graphics.setColor(0, 0, 0, 200)
804804
love.graphics.rectangle("fill", 241*scale, 16*scale, 150*scale, 180*scale)
805805
love.graphics.setColor(255, 255, 255, 255)
806+
local asset = onlineassetlist[onlinemappackselection]
807+
806808
local message
807-
if onlineassetlist[onlinemappackselection] and onlineassetlist[onlinemappackselection].downloadable then
809+
if asset and asset.downloadable then
808810
message = TEXT["dlc dl instructions"]
809811
else
810812
message = TEXT["dlc instructions"]
813+
814+
local y = (19 + 10 * (1 + #(message:split("\n"))))*scale
815+
if asset and asset.type == "enemy" then
816+
properprintF(TEXT["dlc enemy instructions"], 244*scale, y)
817+
elseif asset and (asset.type == "mappack" or asset.type == "character") then
818+
properprintF(TEXT["dlc asset instructions"], 244*scale, y)
819+
end
811820
end
812821
properprintF(message, 244*scale, 19*scale)
813-
--properprintF("bonus content\nlike enemies\nand characters\nare here too!", 244*scale, 140*scale)
822+
814823
love.graphics.setColor(255, 255, 255, 255)
824+
-- TODO: these aren't initialized
815825
if outdated then
816826
love.graphics.setColor(255, 0, 0, 255)
817827
properprintF("version outdated!\nyou have an old\nversion of mari0!\nmappacks could not\nbe downloaded.\ngo to\nstabyourself.net\nto download latest", 244*scale, 130*scale)
@@ -821,19 +831,14 @@ function menu_draw()
821831
properprintF("download error!\nsomething went\nwrong while\ndownloading\nyour mappack.\ntry again.\nsorry.", 244*scale, 130*scale)
822832
love.graphics.setColor(255, 255, 255, 255)
823833
end
824-
if onlineassetlist[onlinemappackselection] and onlineassetlist[onlinemappackselection].type == "enemy" then
825-
love.graphics.setColor(255, 150, 150, 255)
826-
properprintF(TEXT["dlc enemy instructions"], 244*scale, 160*scale)
827-
love.graphics.setColor(255, 255, 255, 255)
828-
end
829-
if onlineassetlist[onlinemappackselection] and onlineassetlist[onlinemappackselection].type == "character" then
830-
--love.graphics.setColor(255, 150, 150, 255)
831-
--properprintF(TEXT["dlc character instructions"], 244*scale, 170*scale)
834+
835+
if asset and asset.type == "character" then
832836
love.graphics.setColor(255, 255, 255, 255)
833837
opendlcbutton.text = TEXT["characters folder"]
834838
else
835839
opendlcbutton.text = TEXT["open dlc folder"]
836840
end
841+
837842
opendlcbutton:draw()
838843
end
839844

@@ -871,11 +876,11 @@ function menu_draw()
871876
local qi = 2
872877
if (not onlinedlc) then
873878
qi = 3
874-
elseif asset.type[i] == "enemy" then
879+
elseif asset.type == "enemy" then
875880
qi = 5
876-
elseif asset.type[i] == "character" then
881+
elseif asset.type == "character" then
877882
qi = 6
878-
elseif asset.type[i] == "video" then
883+
elseif asset.type == "video" then
879884
qi = 7
880885
end
881886
love.graphics.setColor(0, 0, 0, 150)

online.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local url = "https://raw.githubusercontent.com/qixils/mari0pository/v1/data.json"
1+
local asseturl = "https://raw.githubusercontent.com/qixils/mari0pository/v1/data.json"
22
local mounted = {}
33

44
--- Mounts a file to a folder.
@@ -72,7 +72,7 @@ function downloadassetdata()
7272
onlinemappacklisterror = true
7373
return {}
7474
end
75-
local code, body = https.request(url)
75+
local code, body = https.request(asseturl)
7676
if code ~= 200 then
7777
notice.new(body, notice.red, 4)
7878
onlinemappacklisterror = true

variables.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ defaultworlds = 8
919919
defaultlevels = 4
920920
defaultsublevels = 5
921921

922-
onlinedlc = true --dlc went down :(. local dlc only now
922+
onlinedlc = true
923923

924924
maxsublevelstable = {}
925925
for k = 0, maxsublevels do

0 commit comments

Comments
 (0)