Skip to content

Commit

Permalink
Make the Wand2 template the default
Browse files Browse the repository at this point in the history
  • Loading branch information
dextercd committed Jul 26, 2024
1 parent 615fba6 commit ee18bb0
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions component-explorer/wiki_wands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ local function needs_wand()
imgui.PopStyleColor()
end

local function legacy_template()
imgui.PushStyleColor(imgui.Col.Text, unpack(style.colour_warn))
imgui.Text("Consider using the Wand2 template instead of this legacy template.")
imgui.PopStyleColor()
end

local wand2_wand_card = false

local function wiki_wands_contents()
Expand All @@ -272,11 +278,13 @@ local function wiki_wands_contents()
return
end

if imgui.BeginTabItem("Wand") then
if imgui.BeginTabItem("Wand2") then
if not wand then
needs_wand()
else
local wand_text = wiki_wand_util.wand_to_wiki_text(wand, false)
local _
_, wand2_wand_card = imgui.Checkbox("Wand Card", wand2_wand_card)
local wand_text = wiki_wand_util.wand_to_wiki_text(wand, wand2_wand_card, true)
if imgui.Button("Copy") then
imgui.SetClipboardText(wand_text)
end
Expand All @@ -286,11 +294,12 @@ local function wiki_wands_contents()
imgui.EndTabItem()
end

if imgui.BeginTabItem("Wand Card") then
if imgui.BeginTabItem("Wand (old)") then
legacy_template()
if not wand then
needs_wand()
else
local wand_text = wiki_wand_util.wand_to_wiki_text(wand, true)
local wand_text = wiki_wand_util.wand_to_wiki_text(wand, false)
if imgui.Button("Copy") then
imgui.SetClipboardText(wand_text)
end
Expand All @@ -300,13 +309,12 @@ local function wiki_wands_contents()
imgui.EndTabItem()
end

if imgui.BeginTabItem("Wand2") then
if imgui.BeginTabItem("Wand Card (old)") then
legacy_template()
if not wand then
needs_wand()
else
local _
_, wand2_wand_card = imgui.Checkbox("Wand Card", wand2_wand_card)
local wand_text = wiki_wand_util.wand_to_wiki_text(wand, wand2_wand_card, true)
local wand_text = wiki_wand_util.wand_to_wiki_text(wand, true)
if imgui.Button("Copy") then
imgui.SetClipboardText(wand_text)
end
Expand All @@ -326,9 +334,6 @@ local function wiki_wands_contents()
"The Noita wiki (noita.wiki.gg) could use more inspiring wand builds and demo GIF's!\n",
"Noita includes a built-in GIF recorder and this mod should make it easier to use the wand templates on the wiki.",
"\n\n",
"In most cases the spells are the most important thing and the exact wand stats aren't that important, ",
"so you should prefer the 'Wand' template over the 'Wand Card' template usually.",
"\n\n",
"If you need help editing the wiki, you can visit the #noita-wiki channel in the Noita Discord server.",
"\n\n",
"To easily copy wands off of the Noita wiki, you can add the following line to your personal common.js file:",
Expand Down

0 comments on commit ee18bb0

Please sign in to comment.