Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support mapper x/y coordinates #20

Merged
merged 17 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Version numbering approximates the [Semantic Versioning](http://semver.org) appr

- **Project State**: Prcedural Realms Script is under active development. The application can be used, but may be unstable. We are in need of beta testing prior to moving forward with the v1.0.0 release.

- **Current Release**: v0.5.1
- **Current Release**: v0.11.0

**[^Top](#table-of-contents)**

Expand Down
36 changes: 7 additions & 29 deletions prs-mapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ local terrain_types = {
["Farmland"] = {id = 29, r = 255, g = 255, b = 0},
["Deep Water"] = {id = 30, r = 0, g = 0, b = 128},
["Gate"] = {id = 31, r = 255, g = 255, b = 0},
["Nexus"] = {id = 32, r = 128, g = 128, b = 128},
["Wall"] = {id = 33, r = 64, g = 64, b = 64},
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New terrain types for Nexus and Wall


-- list of possible movement directions and appropriate coordinate changes
Expand Down Expand Up @@ -72,40 +74,14 @@ end

local function make_room()
local info = map.room_info
local coords = {0,0,0}
local coords = {info.x,-info.y,0}
addRoom(info.vnum)
setRoomName(info.vnum, info.name)
setRoomName(info.vnum, info.name)
local areas = getAreaTable()
local areaID = areas[info.area]
if not areaID then
areaID = addAreaName(info.area)
else
coords = {getRoomCoordinates(map.prev_info.vnum)}
local shift = {0,0,0}
for k,v in pairs(info.exits) do
if v == map.prev_info.vnum and move_vectors[k] then
shift = move_vectors[k]
break
end
end
for n = 1,3 do
coords[n] = coords[n] - shift[n]
end
-- map stretching
local overlap = getRoomsByPosition(areaID,coords[1],coords[2],coords[3])
if not table.is_empty(overlap) then
local rooms = getAreaRooms(areaID)
local rcoords
for _,id in ipairs(rooms) do
rcoords = {getRoomCoordinates(id)}
for n = 1,3 do
if shift[n] ~= 0 and (rcoords[n] - coords[n]) * shift[n] <= 0 then
rcoords[n] = rcoords[n] - shift[n]
end
end
setRoomCoordinates(id,rcoords[1],rcoords[2],rcoords[3])
end
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove map stretching conflict -- also unneeded in grid format of PR -- with new lookahead mini-mapping thingy... not sure what to call it

setGridMode(areaID, true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turn on gridmode as default for all areas

end
setRoomArea(info.vnum, areaID)
setRoomCoordinates(info.vnum, coords[1], coords[2], coords[3])
Expand Down Expand Up @@ -287,6 +263,8 @@ function map.eventHandler(event,...)
map.room_info = {
vnum = tonumber(gmcp.room.info.num),
area = gmcp.room.info.zone,
x = tonumber(gmcp.room.info.x),
y = tonumber(gmcp.room.info.y),
name = gmcp.room.info.name,
terrain = gmcp.room.info.terrain,
exits = gmcp.room.info.exits
Expand Down
Binary file modified prs-screenshot-01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified prs-screenshot-02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 6 additions & 8 deletions prs-stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function PRSstats.stats()
HPbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Energy Points Gauge
ENbar = SUG:new({
name = "EN",
Expand Down Expand Up @@ -59,7 +59,7 @@ function PRSstats.stats()
ENbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Stamina Points Gauge
STbar = SUG:new({
name = "ST",
Expand All @@ -86,7 +86,7 @@ function PRSstats.stats()
STbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Food Points Gauge
HPbar = SUG:new({
name = "FP",
Expand Down Expand Up @@ -125,8 +125,7 @@ function PRSstats.stats()
updateTime = 250,
textTemplate = "&nbsp;&nbsp;Rage: |c",
currentVariable = "gmcp.Char.Vitals.rage",
maxrage = 100,
maxVariable = "maxrage",
maxVariable = "gmcp.Char.Vitals.maxrage",
}, PRSstats.UW)
RPbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
border-top: 1px black solid;
Expand All @@ -143,7 +142,7 @@ function PRSstats.stats()
RPbar.text:setStyleSheet([[
font-weight: bold;
]])

-- Combo Points Gauge
CPbar = SUG:new({
name = "CP",
Expand All @@ -153,8 +152,7 @@ function PRSstats.stats()
updateTime = 250,
textTemplate = "&nbsp;&nbsp;Combo: |c",
currentVariable = "gmcp.Char.Vitals.combo",
maxcombo = 100,
maxVariable = "maxcombo",
maxVariable = "gmcp.Char.Vitals.maxcombo",
}, PRSstats.UW)
CPbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
border-top: 1px black solid;
Expand Down