Skip to content
Merged
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/ding-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Report a problem (made in game by Ding!)
description: Paste the text Ding! wrote for you in game, with the step, your position and your quests.
title: "Ding! report: "
body:
- type: markdown
attributes:
value: |
In game, open **Report a problem with the guide** in Ding!: the orange flag in the guide window's title bar ("Problem with this step?"), its key (Settings > Keybinds), or `/ding bug`. Pick what went wrong, add a few words if you can, then **Create the text** and copy it with Ctrl+C.
The text's first line can be the title above. Without a keyboard, Ding! keeps your last 20 reports in `WTF\Account\<account>\SavedVariables\Ding.lua` (written when you log out or reload): you can attach that file instead.
- type: textarea
id: report
attributes:
label: Paste the text Ding made here
description: The whole text, from "Ding! report:" to the date. It never holds your character's name, realm or account.
validations:
required: true
- type: textarea
id: what
attributes:
label: What happened?
description: Anything the text does not say (optional).
validations:
required: false
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## v1.8.0

Nothing else to install: QuestieDB is no longer needed, and TomTom stays optional.

- **Problem with this step?** An orange flag in the guide window's title bar, right beside the
NPC directory's pin (with a gamepad: up from the first line in focus mode), its own key binding
(Settings > Keybinds, a button or two like the others) and `/ding bug`. A window shows in plain
words what the report will contain: the guide, the step and its place in the guide's file,
where you stand, your character's level, race, class and side, the step's quests and the ones
of your log the next steps need, with their counters, what the arrow points at, the settings
that change your route, Ding's and the game's versions. Never your character's name, your
realm or your account.
- Pick what went wrong among four ready answers (handy with a gamepad) and add your own words if
you can type, then **Create the text**: 1. the address of the GitHub page to open, 2. the text
to paste into it, each selected by its button for Ctrl+C (an addon cannot copy for you). Ding
keeps your last 20 reports in its saved variables
(`WTF\Account\<account>\SavedVariables\Ding.lua`), so a player without a keyboard can send
that file instead; "Restore all defaults" keeps them.

## v1.7.1

Nothing else to install: QuestieDB is no longer needed, and TomTom stays optional.
Expand Down
3 changes: 3 additions & 0 deletions Ding/Bindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<Binding name="DING_CYCLE" category="ADDONS">
Ding.Panel:CycleTarget()
</Binding>
<Binding name="DING_REPORT" category="ADDONS">
Ding.ReportWindow:Toggle()
</Binding>
<Binding name="CLICK DingItemButton:LeftButton" category="ADDONS"/>
<Binding name="CLICK DingItemButton:Target" category="ADDONS"/>
</Bindings>
4 changes: 4 additions & 0 deletions Ding/Core/Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ SlashCmdList.DING = function(input)
else
Ding:Print(L.TRIP_NONE)
end
elseif cmd == "bug" or cmd == "report" then
-- Report a problem: what the guide shows and where the character stands, as a text for
-- GitHub (UI/Report.lua).
Ding.ReportWindow:Open()
elseif cmd == "find" then
-- The NPC directory's search: a service, a weapon, a profession or a name.
Ding.Finder:Find(rest)
Expand Down
8 changes: 8 additions & 0 deletions Ding/Core/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ function D:QuestName(questID)
return get("Quest", "name", questID) or string.format(L.UNKNOWN_QUEST, questID)
end

-- Its name in English whatever the client's language (the bug reports, read by the guide's
-- authors: Core/Report.lua).
function D:QuestEnglishName(questID)
local name = raw("Quest", "name", questID)
if type(name) == "string" and name ~= "" then return name end
return self:QuestName(questID)
end

function D:QuestRequiredLevel(questID)
return get("Quest", "requiredLevel", questID) or 0
end
Expand Down
3 changes: 3 additions & 0 deletions Ding/Core/Ding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ local DEFAULTS = {
-- [action] = "PADLSHOULDER+PADDUP": gamepad chords Ding watches itself (UI/Gamepad.lua);
-- kept by "Restore all defaults", like the game's key bindings.
chords = {},
-- The last reports of "Report a problem" (Core/Report.lua), oldest first: { at, title, text }.
-- Not a setting: "Restore all defaults" keeps them.
reports = {},
}
Ding.DEFAULTS = DEFAULTS
local SETTINGS = { "panel", "arrow", "item", "minimap", "ui" }
Expand Down
5 changes: 3 additions & 2 deletions Ding/Core/GuideText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ end
-- values under that key (the steps' keys); opts.compact: one line; opts.layout: [key] =
-- "lines" (a list, one value per line, each on one line: the steps) or "blocks" (a list, one
-- value per line, each laid out like the whole: the guides of a pack). The whole is one
-- entry per line; any other table is on one line.
-- entry per line (opts.inline: on one line, spaced like a step); any other table is on one
-- line.
local function ranks(list)
local rank = {}
for i, k in ipairs(list or {}) do rank[k] = i end
Expand Down Expand Up @@ -332,5 +333,5 @@ function T.Write(value, opts)
return "{\n" .. inner .. table.concat(parts, ",\n" .. inner) .. ",\n" .. indent .. "}"
end

return write(value, "", "block", rootRank)
return write(value, "", not opts.inline and "block" or nil, rootRank)
end
36 changes: 23 additions & 13 deletions Ding/Core/Import.lua
Original file line number Diff line number Diff line change
Expand Up @@ -632,29 +632,39 @@ end
---------------------------------------------------------------------------
local ID_KINDS = { quests = true, items = true, npcs = true, objects = true }

-- A step as written in a guide; `without`: keys left out.
local function exportStep(step, without)
local s = {}
for key, v in pairs(step) do
local kind = not (without and without[key]) and STEP_KEYS[key] or nil
-- One id alone, as guides are written (the registry made it a list).
if ID_KINDS[kind] and type(v) == "table" and #v == 1 and type(v[1]) == "number" then
s[key] = v[1]
elseif kind then
s[key] = copy(v)
end
end
return s
end

local function exportGuide(guide, pack, inPack)
local out = {}
for _, key in ipairs({ "id", "title", "faction", "races", "classes", "minLevel", "maxLevel", "next" }) do
out[key] = copy(guide[key])
end
if not inPack and pack and pack.category and pack.category ~= "leveling" then out.category = pack.category end
out.steps = {}
for i, step in ipairs(guide.steps) do
local s = {}
for key, v in pairs(step) do
local kind = STEP_KEYS[key]
-- One id alone, as guides are written (the registry made it a list).
if ID_KINDS[kind] and type(v) == "table" and #v == 1 and type(v[1]) == "number" then
s[key] = v[1]
elseif kind then
s[key] = copy(v)
end
end
out.steps[i] = s
end
for i, step in ipairs(guide.steps) do out.steps[i] = exportStep(step) end
return out
end

-- A step's keys on one line, as a guide writes them, without its texts (text, note, why):
-- "{ turnin = 783, accept = 7, go = { 1429, 48.2, 41.6 } }" (the bug reports: Core/Report.lua).
local PROSE = { text = true, note = true, why = true }
function I:StepText(step)
return Text.Write(exportStep(step, PROSE), { inline = true, order = STEP_ORDER })
end

-- A pack (by its id) or a guide (by its id; the active one by default) as text, in full or
-- on one line (compact). A pack of one guide of its own id (a guide imported alone) is
-- written as that guide. nil when there is no such guide.
Expand Down
1 change: 1 addition & 0 deletions Ding/Core/Locales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ BINDING_NAME_DING_SKIP = L.BIND_SKIP
BINDING_NAME_DING_UNSKIP = L.BIND_UNSKIP
BINDING_NAME_DING_FINDER = L.BIND_FINDER
BINDING_NAME_DING_CYCLE = L.BIND_CYCLE
BINDING_NAME_DING_REPORT = L.BIND_REPORT
_G["BINDING_NAME_CLICK DingItemButton:LeftButton"] = L.BIND_ITEM
_G["BINDING_NAME_CLICK DingItemButton:Target"] = L.BIND_TARGET
Loading
Loading