Skip to content

Commit d4f1481

Browse files
iLPdeveterchun
andauthored
release v1.3.0 (#71)
* feat: ✨ announce PR on discord * feat(mapper): 💄 add Obsidian Floor terrain type * feat(mapper): 💄 add Obelisk Exit terrain type * feat(mapper): 💄 add Permafrost terrain type * feat(mapper): 💄 add Gold Mine Tailings terrain type * docs(version): 📝 update local version * build: update to MDK v2.8.3 (#64) * docs(readme): add usage section * docs(readme): add Usage to TOC * build: update MDK dependencies * fix:(mapper): add hint for room stub connection (#59) I was experiencing errors in the automatic direction connection that seem to be fixed by specifying the room id we already looked up. * build: update MDK to 2.9.0 (#67) * docs(readme): add Usage (#68) * docs(readme): add usage section * docs(readme): add Usage to TOC * docs(readme): add Usage (#69) * docs(readme): add usage section * docs(readme): add Usage to TOC --------- Co-authored-by: eterchun <[email protected]>
1 parent 47f0770 commit d4f1481

File tree

6 files changed

+363
-303
lines changed

6 files changed

+363
-303
lines changed

MDK/demontools.lua

Lines changed: 46 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -93,32 +93,11 @@ local htmlHeaderPattern = [=[ <!DOCTYPE HTML PUBLIC "%-//W3C//DTD HTML 4.01 Tra
9393
<body><span>
9494
]=]
9595

96-
-- internal function, recursively digs for a value within subtables if possible
97-
local function digForValue(dataFrom, tableTo)
98-
if dataFrom == nil or table.size(tableTo) == 0 then
99-
return dataFrom
100-
else
101-
local newData = dataFrom[tableTo[1]]
102-
table.remove(tableTo, 1)
103-
return digForValue(newData, tableTo)
104-
end
105-
end
106-
10796
-- Internal function, used to turn a string variable name into a value
10897
local function getValueAt(accessString)
109-
if accessString == "" then
110-
return nil
111-
end
112-
local tempTable = accessString:split("%.")
113-
local accessTable = {}
114-
for i, v in ipairs(tempTable) do
115-
if tonumber(v) then
116-
accessTable[i] = tonumber(v)
117-
else
118-
accessTable[i] = v
119-
end
120-
end
121-
return digForValue(_G, accessTable)
98+
local ok, err = pcall(loadstring("return " .. tostring(accessString)))
99+
if ok then return err end
100+
return nil, err
122101
end
123102

124103
-- internal sorting function, sorts first by hue, then luminosity, then value
@@ -832,7 +811,7 @@ function string.tocolor(self)
832811
local strTable = {}
833812
local part1 = {}
834813
local part2 = {}
835-
self:gsub(".", function(c)
814+
_ = self:gsub(".", function(c)
836815
table.insert(strTable, c)
837816
end)
838817
for index, value in ipairs(strTable) do
@@ -1104,29 +1083,29 @@ end
11041083
-- </thead>
11051084
-- <tbody>
11061085
-- <tr>
1107-
-- <td class="tg-odd">format</td>
1108-
-- <td class="tg-odd">What format to return the text as? 'h' for html, 'c' for cecho, 'a' for ansi, 'd' for decho, and 'x' for hecho</td>
1109-
-- <td class="tg-odd">"d"</td>
1086+
-- <td class="tg-1">format</td>
1087+
-- <td class="tg-1">What format to return the text as? 'h' for html, 'c' for cecho, 'a' for ansi, 'd' for decho, and 'x' for hecho</td>
1088+
-- <td class="tg-1">"d"</td>
11101089
-- </tr>
11111090
-- <tr>
1112-
-- <td class="tg-even">win</td>
1113-
-- <td class="tg-even">what console/window to dump the buffer of?</td>
1114-
-- <td class="tg-even">"main"</td>
1091+
-- <td class="tg-2">win</td>
1092+
-- <td class="tg-2">what console/window to dump the buffer of?</td>
1093+
-- <td class="tg-2">"main"</td>
11151094
-- </tr>
11161095
-- <tr>
1117-
-- <td class="tg-odd">start_line</td>
1118-
-- <td class="tg-odd">What line to start dumping the buffer from?</td>
1119-
-- <td class="tg-odd">0</td>
1096+
-- <td class="tg-1">start_line</td>
1097+
-- <td class="tg-1">What line to start dumping the buffer from?</td>
1098+
-- <td class="tg-1">0</td>
11201099
-- </tr>
11211100
-- <tr>
1122-
-- <td class="tg-even">end_line</td>
1123-
-- <td class="tg-even">What line to stop dumping the buffer on?</td>
1124-
-- <td class="tg-even">Last line of the console</td>
1101+
-- <td class="tg-2">end_line</td>
1102+
-- <td class="tg-2">What line to stop dumping the buffer on?</td>
1103+
-- <td class="tg-2">Last line of the console</td>
11251104
-- </tr>
11261105
-- <tr>
1127-
-- <td class="tg-odd">includeHtmlWrapper</td>
1128-
-- <td class="tg-odd">If the format is html, should it include the front and back portions required to make it a functioning html page?</td>
1129-
-- <td class="tg-odd">true</td>
1106+
-- <td class="tg-1">includeHtmlWrapper</td>
1107+
-- <td class="tg-1">If the format is html, should it include the front and back portions required to make it a functioning html page?</td>
1108+
-- <td class="tg-1">true</td>
11301109
-- </tr>
11311110
-- </tbody>
11321111
-- </table>
@@ -1146,49 +1125,49 @@ end
11461125
-- </thead>
11471126
-- <tbody>
11481127
-- <tr>
1149-
-- <td class="tg-odd">cols</td>
1150-
-- <td class="tg-odd">Number of columsn wide to display the colors in</td>
1151-
-- <td class="tg-odd">4</td>
1128+
-- <td class="tg-1">cols</td>
1129+
-- <td class="tg-1">Number of columsn wide to display the colors in</td>
1130+
-- <td class="tg-1">4</td>
11521131
-- </tr>
11531132
-- <tr>
1154-
-- <td class="tg-even">search</td>
1155-
-- <td class="tg-even">If not the empty string, will check colors against string.find using this property.<br>IE if set to "blue" only colors which include the word 'blue' would be listed</td>
1156-
-- <td class="tg-even">""</td>
1133+
-- <td class="tg-2">search</td>
1134+
-- <td class="tg-2">If not the empty string, will check colors against string.find using this property.<br>IE if set to "blue" only colors which include the word 'blue' would be listed</td>
1135+
-- <td class="tg-2">""</td>
11571136
-- </tr>
11581137
-- <tr>
1159-
-- <td class="tg-odd">sort</td>
1160-
-- <td class="tg-odd">If true, sorts alphabetically. Otherwise sorts based on the color value</td>
1161-
-- <td class="tg-odd">false</td>
1138+
-- <td class="tg-1">sort</td>
1139+
-- <td class="tg-1">If true, sorts alphabetically. Otherwise sorts based on the color value</td>
1140+
-- <td class="tg-1">false</td>
11621141
-- </tr>
11631142
-- <tr>
1164-
-- <td class="tg-even">echoOnly</td>
1165-
-- <td class="tg-even">If true, colors will not be clickable links</td>
1166-
-- <td class="tg-even">false</td>
1143+
-- <td class="tg-2">echoOnly</td>
1144+
-- <td class="tg-2">If true, colors will not be clickable links</td>
1145+
-- <td class="tg-2">false</td>
11671146
-- </tr>
11681147
-- <tr>
1169-
-- <td class="tg-odd">window</td>
1170-
-- <td class="tg-odd">What window/console to echo the colors out to.</td>
1171-
-- <td class="tg-odd">"main"</td>
1148+
-- <td class="tg-1">window</td>
1149+
-- <td class="tg-1">What window/console to echo the colors out to.</td>
1150+
-- <td class="tg-1">"main"</td>
11721151
-- </tr>
11731152
-- <tr>
1174-
-- <td class="tg-even">removeDupes</td>
1175-
-- <td class="tg-even">If true, will remove snake_case entries and 'gray' in favor of 'grey'</td>
1176-
-- <td class="tg-even">true</td>
1153+
-- <td class="tg-2">removeDupes</td>
1154+
-- <td class="tg-2">If true, will remove snake_case entries and 'gray' in favor of 'grey'</td>
1155+
-- <td class="tg-2">true</td>
11771156
-- </tr>
11781157
-- <tr>
1179-
-- <td class="tg-odd">columnSort</td>
1180-
-- <td class="tg-odd">If true, will print top-to-bottom, then left-to-right. false is like showColors</td>
1181-
-- <td class="tg-odd">true</td>
1158+
-- <td class="tg-1">columnSort</td>
1159+
-- <td class="tg-1">If true, will print top-to-bottom, then left-to-right. false is like showColors</td>
1160+
-- <td class="tg-1">true</td>
11821161
-- </tr>
11831162
-- <tr>
1184-
-- <td class="tg-even">justText</td>
1185-
-- <td class="tg-even">If true, will echo the text in the color and leave the background black.<br>If false, the background will be the colour(like showColors).</td>
1186-
-- <td class="tg-even">false</td>
1163+
-- <td class="tg-2">justText</td>
1164+
-- <td class="tg-2">If true, will echo the text in the color and leave the background black.<br>If false, the background will be the colour(like showColors).</td>
1165+
-- <td class="tg-2">false</td>
11871166
-- </tr>
11881167
-- <tr>
1189-
-- <td class="tg-odd">color_table</td>
1190-
-- <td class="tg-odd">Table of colors to display. If you provide your own table, it must be in the same format as Mudlet's own color_table</td>
1191-
-- <td class="tg-odd">color_table</td>
1168+
-- <td class="tg-1">color_table</td>
1169+
-- <td class="tg-1">Table of colors to display. If you provide your own table, it must be in the same format as Mudlet's own color_table</td>
1170+
-- <td class="tg-1">color_table</td>
11921171
-- </tr>
11931172
-- </tbody>
11941173
-- </table>

0 commit comments

Comments
 (0)