@@ -733,9 +733,9 @@ end</script>
733
733
<Script isActive =" yes" isFolder =" no" >
734
734
<name >discMapper</name >
735
735
<packageName ></packageName >
736
- <script >-- discMapper
736
+ <script >-- discMapper
737
737
738
- local version = "0.4.1 -beta"
738
+ local version = "0.5.0 -beta"
739
739
740
740
-- look into options for non-standard door usage for speedwalk
741
741
-- come up with aliases to set translations and custom exits, add appropriate help info
@@ -1373,17 +1373,21 @@ local move_queue, lines = {}, {}
1373
1373
local find_portal, vision_fail, room_detected, random_move, force_portal, find_prompt, downloading, walking, help_shown
1374
1374
local mt = getmetatable(map) or {}
1375
1375
1376
- function uninstallGMS(_, name)
1377
- if name ~= "discMapper" then return end
1376
+ function initialize(_, name)
1377
+ if name ~= "discMapper" then
1378
+ return
1379
+ end
1380
+ map.echo("Initializing discMapper v"..version..".")
1378
1381
uninstallPackage("generic_mapper")
1379
- map.echo("Uninstalled generic_mapper package")
1382
+ map.echo("Uninstalled generic_mapper package.")
1383
+ setCustomRoomColors()
1380
1384
enableGMCP()
1381
- send("look", true )
1385
+ send("look", false )
1382
1386
end
1383
1387
1384
1388
function enableGMCP()
1385
1389
sendGMCP("core.supports.set \[\"char.login\", \"char.info\", \"room.info\", \"room.map\", \"room.writtenmap\", \"Char.Vitals\",\"Window.Frame.map\"\]")
1386
- map.echo("GMCP Core Supports activated ")
1390
+ map.echo("Activated GMCP Core Supports. ")
1387
1391
end
1388
1392
1389
1393
local function config()
@@ -1680,24 +1684,6 @@ local function set_room(roomID)
1680
1684
raiseEvent("onMoveMap", map.currentRoom)
1681
1685
end
1682
1686
1683
- function mapMenu()
1684
- -- addMapEvent("Show Room Info", "showRoomID") -- place holder
1685
- addMapMenu("Style Room")
1686
- addMapEvent("Street", "styleRooms", "Style Room", "Street")
1687
- addMapEvent("Shop", "styleRooms", "Style Room", "Shop")
1688
- addMapEvent("General Store", "styleRooms", "Style Room", "General Store")
1689
- addMapEvent("Services", "styleRooms", "Style Room", "Services")
1690
- addMapEvent("Bank", "styleRooms", "Style Room", "Bank")
1691
- addMapEvent("House", "styleRooms", "Style Room", "House")
1692
- addMapEvent("Temple", "styleRooms", "Style Room", "Temple")
1693
- addMapEvent("Custom", "styleRooms", "Style Room", "Custom")
1694
- addMapEvent("Player House", "styleRooms", "Style Room", "Player House")
1695
- addMapEvent("Player Shop", "styleRooms", "Style Room", "Player Shop")
1696
- addMapEvent("Food", "styleRooms", "Style Room", "Food")
1697
- addMapEvent("T-Shop", "styleRooms", "Style Room", "T-Shop")
1698
- addMapEvent("Park", "styleRooms", "Style Room", "Park")
1699
- end
1700
-
1701
1687
-- Room styling is based on the 2014-09-19 version of Fenton's Discworld Mapper
1702
1688
-- for faster styling of selected rooms. styleRooms is passed the name of the
1703
1689
-- mapEvent that called it, as well as the room IDs of the selected rooms. If
@@ -1706,6 +1692,34 @@ end
1706
1692
-- chosen contains spaces or symbols, you'll need to surround it with brackets
1707
1693
-- and single quotes.
1708
1694
1695
+ function mapMenu()
1696
+ -- addMapEvent("Show Room Info", "showRoomID") -- place holder
1697
+ addMapMenu("Style Room")
1698
+ addMapEvent("Craft", "styleRooms", "Style Room", "Craft")
1699
+ addMapEvent("Custom", "styleRooms", "Style Room", "Custom")
1700
+ addMapEvent("Drink", "styleRooms", "Style Room", "Drink")
1701
+ addMapEvent("Eat", "styleRooms", "Style Room", "Eat")
1702
+ addMapEvent("Garden", "styleRooms", "Style Room", "Garden")
1703
+ addMapEvent("Guild", "styleRooms", "Style Room", "Guild")
1704
+ addMapMenu("Houses", "Style Room")
1705
+ addMapEvent("House", "styleRooms", "Houses", "House")
1706
+ addMapEvent("Club House", "styleRooms", "Houses", "Club House")
1707
+ addMapEvent("Player House", "styleRooms", "Houses", "Player House")
1708
+ addMapEvent("Park", "styleRooms", "Style Room", "Park")
1709
+ addMapMenu("Services", "Style Room")
1710
+ addMapEvent("Service", "styleRooms", "Services", "Service")
1711
+ addMapEvent("Bank", "styleRooms", "Services", "Bank")
1712
+ addMapMenu("Shops", "Style Room")
1713
+ addMapEvent("Shop", "styleRooms", "Shops", "Shop")
1714
+ addMapEvent("General Store", "styleRooms", "Shops", "General Store")
1715
+ addMapEvent("Player Shop", "styleRooms", "Shops", "Player Shop")
1716
+ addMapEvent("T-Shop", "styleRooms", "Shops", "T-Shop")
1717
+ addMapEvent("Street", "styleRooms", "Style Room", "Street")
1718
+ addMapEvent("Temple", "styleRooms", "Style Room", "Temple")
1719
+ addMapEvent("Water", "styleRooms", "Style Room", "Water")
1720
+ map.echo("Installed additional mapper context menus.")
1721
+ end
1722
+
1709
1723
function styleRooms (...)
1710
1724
for i, v in ipairs(arg) do --loop through all of the arguments passed to the function
1711
1725
if i > 2 then --skip the first two, as those are not room ID's
@@ -1719,50 +1733,59 @@ end
1719
1733
-- reserved defaults
1720
1734
function setCustomRoomColors()
1721
1735
map.echo("Custom room colors initialized")
1722
- setCustomEnvColor(289, 0,132,132,255) -- ['General Store']
1723
- setCustomEnvColor(290, 255,123,33,255) -- Services & Bank
1724
- setCustomEnvColor(291, 132,66,0,255) -- House
1725
- setCustomEnvColor(292, 132,132,198,255) -- Custom
1726
- setCustomEnvColor(293, 0,255,255,255) -- Temple
1727
- setCustomEnvColor(294, 255,0,0,255) -- Food
1728
- setCustomEnvColor(295, 64,64,64,255) -- Street
1736
+ setCustomEnvColor(289, 132,132,255,255) -- Custom
1737
+ setCustomEnvColor(290, 132,66,0,255) -- Houses
1738
+ setCustomEnvColor(291, 255,132,66,255) -- Services
1739
+ setCustomEnvColor(292, 64,64,64,255) -- Streets
1729
1740
end
1730
1741
1731
1742
-- Table of colors assigned by room type. The numbers refer to color table in
1732
1743
-- the "color" menu when you right-click on the map.
1733
1744
styleEnv =
1734
1745
{
1735
- ['General Store'] = 289,
1736
- Shop = 266,
1737
- Services = 290,
1738
- Bank = 290,
1739
- House = 291,
1740
- Custom = 292,
1741
- Temple = 293,
1742
- Street = 295,
1743
- ['Player House'] = 269,
1744
- ['Player Shop'] = 269,
1745
- Food = 294,
1746
- ['T-Shop'] = 264,
1746
+ Craft = 267,
1747
+ Custom = 289,
1748
+ Drink = 265,
1749
+ Eat = 265,
1750
+ Garden = 258,
1751
+ Guild = 263,
1752
+ House = 290,
1753
+ ['Club House'] = 290,
1754
+ ['Player House'] = 290,
1747
1755
Park = 258,
1756
+ Service = 291,
1757
+ Bank = 291,
1758
+ Shop = 266,
1759
+ ['General Store'] = 262,
1760
+ ['Player Shop'] = 269,
1761
+ ['T-Shop'] = 271,
1762
+ Street = 292,
1763
+ Temple = 270,
1764
+ Water = 268,
1748
1765
}
1749
1766
1750
1767
-- a table of characters assigned to rooms.
1751
1768
styleChar =
1752
1769
{
1753
- ['General Store'] = "",
1754
- Shop = "",
1755
- Services = "",
1756
- Bank = "$",
1757
- House = "",
1770
+ Craft = "",
1758
1771
Custom = "",
1759
- Temple = "",
1760
- Street = "",
1761
- ['Player House'] = "",
1762
- ['Player Shop'] = "",
1763
- Food = "",
1764
- ['T-Shop'] = "T",
1772
+ Drink = "",
1773
+ Eat = "",
1774
+ Garden = "",
1775
+ Guild = "",
1776
+ House = "",
1777
+ ['Club House'] = "C",
1778
+ ['Player House'] = "P",
1765
1779
Park = "",
1780
+ Service = "",
1781
+ Bank = "$",
1782
+ Shop = "",
1783
+ ['General Store'] = "",
1784
+ ['Player Shop'] = "P",
1785
+ ['T-Shop'] = "T",
1786
+ Street = "",
1787
+ Temple = "",
1788
+ Water = "",
1766
1789
}
1767
1790
1768
1791
local function add_door(roomID, dir, status)
@@ -1953,6 +1976,7 @@ local function create_room(name, exits, dir, coords)
1953
1976
addRoom(newID)
1954
1977
setRoomArea(newID, map.currentArea)
1955
1978
setRoomName(newID, name)
1979
+ setRoomEnv(newID, styleEnv["Street"]) -- most new rooms are streets, so style them as such
1956
1980
for k,v in ipairs(exits) do
1957
1981
if stubmap[v] then
1958
1982
if stubmap[v] < = 12 then
@@ -3207,9 +3231,8 @@ function map.eventHandler(event, ...)
3207
3231
elseif event == "mapOpenEvent" then
3208
3232
mapMenu()
3209
3233
if not help_shown and not map.save.prompt_pattern[map.character or ""] then
3210
- setCustomRoomColors()
3211
3234
map.find_prompt()
3212
- send("look", true )
3235
+ send("look", false )
3213
3236
tempTimer(3, function() map.show_help("quick_start"); help_shown = true end)
3214
3237
end
3215
3238
elseif event == "mapStop" then
@@ -3222,7 +3245,7 @@ end
3222
3245
registerAnonymousEventHandler("sysDownloadDone", "map.eventHandler")
3223
3246
registerAnonymousEventHandler("sysLoadEvent", "map.eventHandler")
3224
3247
registerAnonymousEventHandler("sysConnectionEvent", "map.eventHandler")
3225
- registerAnonymousEventHandler("sysInstallPackage", "uninstallGMS ")
3248
+ registerAnonymousEventHandler("sysInstallPackage", "initialize ")
3226
3249
registerAnonymousEventHandler("sysInstall", "map.eventHandler")
3227
3250
registerAnonymousEventHandler("sysDataSendRequest", "map.eventHandler")
3228
3251
registerAnonymousEventHandler("onMoveFail", "map.eventHandler")
0 commit comments