This repository has been archived by the owner on Aug 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de23706
Showing
10 changed files
with
276 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.eslintrc.json | ||
manifest-generator.bat | ||
manifest-generator.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# atlas | ||
|
||
Alternative Village Atlas based on teleport scrolls. | ||
|
||
The teleport scrolls should be in your inventory. A scroll is consumed when teleporting. | ||
|
||
## Commands | ||
|
||
Toolbox(/8) | Command description | ||
--- | --- | ||
**atlas** | Open the Village Atlas GUI (also you can use **Ctrl+Shift+J**). | ||
|
||
![](https://i.imgur.com/nGOWDyh.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* eslint-disable comma-dangle */ | ||
|
||
module.exports = [ | ||
{ "id": 63001, "left": 525, "top": 417, "itemId": 143 }, // Велика | ||
{ "id": 67001, "left": 581, "top": 445, "itemId": 136 }, // Пополион | ||
{ "id": 68001, "left": 559, "top": 476, "itemId": 137 }, // Пора-Элину | ||
{ "id": 65001, "left": 483, "top": 469, "itemId": 138 }, // Чебика | ||
{ "id": 66001, "left": 459, "top": 500, "itemId": 139 }, // Тулуфан | ||
{ "id": 59001, "left": 533, "top": 302, "itemId": 135 }, // Кресцентия | ||
{ "id": 60001, "left": 475, "top": 330, "itemId": 134 }, // Деревня лесорубов | ||
{ "id": 61001, "left": 612, "top": 286, "itemId": 141 }, // Кастаника | ||
{ "id": 62001, "left": 566, "top": 352, "itemId": 140 }, // Гавань Головорезов | ||
{ "id": 58001, "left": 560, "top": 240, "itemId": 142 }, // Балдерон | ||
{ "id": 13001, "left": 394, "top": 314, "itemId": 133 }, // Остров Зари | ||
|
||
{ "id": 69001, "left": 131, "top": 321, "itemId": 146 }, // Тралион | ||
{ "id": 70001, "left": 214, "top": 335, "itemId": 145 }, // Трия | ||
{ "id": 73001, "left": 98, "top": 401, "itemId": 147 }, // Акарум | ||
{ "id": 83001, "left": 82, "top": 436, "itemId": 148 }, // Блеклый камень | ||
{ "id": 72001, "left": 172, "top": 392, "itemId": 151 }, // Аллемантея | ||
{ "id": 71001, "left": 288, "top": 392, "itemId": 420 }, // Бастион | ||
{ "id": 75001, "left": 276, "top": 444, "itemId": 144 }, // Фронтера | ||
{ "id": 74001, "left": 195, "top": 466, "itemId": 149 }, // Эленея | ||
|
||
{ "id": 81001, "left": 163, "top": 273, "itemId": 153 }, // Скитера-Фэй | ||
{ "id": 80001, "left": 195, "top": 242, "itemId": 152 }, // Дрэгонфолл | ||
{ "id": 84001, "left": 176, "top": 202, "itemId": 159 }, // Кайатор | ||
{ "id": 79001, "left": 259, "top": 196, "itemId": 158 }, // Хабере | ||
{ "id": 77001, "left": 56, "top": 177, "itemId": 154 }, // Аванпост следопытов | ||
{ "id": 78001, "left": 113, "top": 137, "itemId": 155 }, // Зульфикарская крепость | ||
{ "id": 76001, "left": 224, "top": 110, "itemId": 156 }, // Канстрия | ||
|
||
{ "id": 183002, "left": 486, "top": 135, "itemId": 81131 }, // Верхний Дозор | ||
{ "id": 599001, "left": 366, "top": 248, "itemId": 81260 }, // Тиарания | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const UI = require("../ui"); | ||
const bodyParser = require("../ui/node_modules/body-parser"); | ||
const globalShortcut = global.TeraProxy.GUIMode ? require("electron").globalShortcut : null; | ||
|
||
module.exports = function Atlas(mod) { | ||
const ui = UI(mod); | ||
const citiesConfig = require("./cities"); | ||
const citiesNames = new Map(); | ||
let player = null; | ||
|
||
mod.game.initialize("inventory"); | ||
mod.game.on("enter_character_lobby", async () => applyCitiesNames()); | ||
|
||
mod.command.add("atlas", () => ui.open()); | ||
|
||
mod.hook("S_SPAWN_ME", 3, event => { player = event; }); | ||
mod.hook("C_PLAYER_LOCATION", 5, event => { player = event; }); | ||
|
||
ui.use((request, response, next) => { | ||
response.header("Access-Control-Allow-Origin", "*"); | ||
response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | ||
next(); | ||
}); | ||
|
||
ui.use(bodyParser.json({ "limit": "50mb" })); | ||
ui.use(bodyParser.urlencoded({ "extended": true })); | ||
ui.use(UI.static(`${__dirname}/ui`)); | ||
|
||
ui.post("/getTitle", (request, response) => { | ||
applyCitiesNames(); | ||
response.json({ "title": `${citiesNames.get(1) || "World"} [Ctrl + Shift + J]` }); | ||
}); | ||
|
||
ui.post("/getCities", (request, response) => { | ||
const cities = []; | ||
|
||
citiesConfig.forEach(city => { | ||
const entry = { "name": "", "available": 0, ...city }; | ||
const items = mod.game.inventory.findAll(city.itemId); | ||
|
||
if (items.length !== 0) { | ||
entry.available = items[0].amount; | ||
} | ||
|
||
if (citiesNames.has(city.id)) { | ||
entry.name = citiesNames.get(city.id); | ||
cities.push(entry); | ||
} | ||
}); | ||
|
||
response.json({ cities }); | ||
}); | ||
|
||
ui.post("/useItem", (request, response) => { | ||
if (!player || !request.body || !request.body.itemId) return; | ||
|
||
mod.send("C_USE_ITEM", 3, { | ||
"gameId": mod.game.me.gameId, | ||
"id": request.body.itemId, | ||
"amount": 1, | ||
"loc": player.loc, | ||
"w": player.w, | ||
"unk4": true | ||
}); | ||
|
||
response.json({}); | ||
}); | ||
|
||
async function applyCitiesNames() { | ||
if (citiesNames.size !== 0) return; | ||
|
||
const citiesIds = []; | ||
citiesConfig.forEach(city => citiesIds.push(city.id)); | ||
|
||
(await mod.queryData("/StrSheet_Region/String@id=?", [[1, ...citiesIds]], true)) | ||
.forEach(res => citiesNames.set(res.attributes.id, res.attributes.string)); | ||
} | ||
|
||
globalShortcut.register("Ctrl+Shift+J", () => ui.open()); | ||
|
||
this.destructor = () => { | ||
globalShortcut.unregister("Ctrl+Shift+J"); | ||
mod.command.remove("atlas"); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"files": { | ||
"README.md": "6a06002bdee61134f3f09ebf92c47ed4cb21d1f188e949e6b1ca7268ec857397", | ||
"cities.js": "2b64ff57044777c91a03b0d9ea427008b6a72ec73b335d6d1b0ad210e8e9b914", | ||
"index.js": "e9ef40e27f0ccd086c4e4797a4eb2e38109a3dc9075fa5d5ed1ff13a6638186f", | ||
"module.json": "6beb2cb3a7460c14efc5d5504818c7c1a7a36783d4cb58b88725f5c09cba32d7", | ||
"ui/css/base.css": "8b4f64c051674f7f26ddd61b2730b53dce30c6dbc3c58edf42742172f8f82b8b", | ||
"ui/img/map.png": "0b8e1189ddb563b244630e6802735a0a8d0f8d0759208099f8e59cd3f61aff87", | ||
"ui/index.html": "3d45c91e51d32da5f4d20db43e6d2f6a306abba1226ab8ca1f17a38442c54c45", | ||
"ui/js/jquery-3.2.1.min.js": "87083882cc6015984eb0411a99d3981817f5dc5c90ba24f0940420c5548d82de" | ||
}, | ||
"defs": { | ||
"C_PLAYER_LOCATION": 5, | ||
"C_USE_ITEM": 3, | ||
"S_SPAWN_ME": 3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "atlas", | ||
"author": "HSDN", | ||
"description": "Alternative Village Atlas based on Teleport Scrolls.", | ||
"options": { | ||
"niceName": "Atlas", | ||
"reloadable": true | ||
}, | ||
"servers": ["https://raw.githubusercontent.com/hsdn/atlas/master/"], | ||
"supportUrl": "https://github.com/hsdn/atlas/issues", | ||
"dependencies": { | ||
"ui": "https://raw.githubusercontent.com/HakuryuuDom/ui/master/module.json" | ||
}, | ||
"disableAutoUpdate": false, | ||
"version": "10/27/2021" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
html { | ||
background-color: #1e1e1e; | ||
overflow-x: hidden; | ||
} | ||
|
||
body { | ||
background: url("../img/map.png") no-repeat; | ||
border-radius: 0; | ||
color: #ddd; | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 16px; | ||
margin: 0; | ||
} | ||
|
||
a { | ||
color: #f8e53b; | ||
text-decoration: none; | ||
} | ||
|
||
a.red { | ||
color: #f8888c; | ||
} | ||
|
||
a:hover { | ||
color: #fff; | ||
} | ||
|
||
.link { | ||
font-size: 14px; | ||
position: absolute; | ||
text-shadow: | ||
-0 -1px 0 #000, | ||
0 -1px 0 #000, | ||
-0 1px 0 #000, | ||
0 1px 0 #000, | ||
-1px -0 0 #000, | ||
1px -0 0 #000, | ||
-1px 0 0 #000, | ||
1px 0 0 #000, | ||
-1px -1px 0 #000, | ||
1px -1px 0 #000, | ||
-1px 1px 0 #000, | ||
1px 1px 0 #000, | ||
-1px -1px 0 #000, | ||
1px -1px 0 #000, | ||
-1px 1px 0 #000, | ||
1px 1px 0 #000; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="./css/base.css"> | ||
<script src="/_TERAToolbox/browserInit.js"></script> | ||
<script src="./js/jquery-3.2.1.min.js"></script> | ||
<script> | ||
function uiRequest(event, data, callback) { | ||
$.post({ | ||
traditional: true, | ||
url: "/" + event, | ||
contentType: "application/json", | ||
data: JSON.stringify(data), | ||
dataType: "json", | ||
success: callback | ||
}); | ||
} | ||
|
||
window.addEventListener('error', function (e) { | ||
alert('[UI] Error: ' + e.message) | ||
}); | ||
|
||
window.onload = function () { | ||
uiRequest("getTitle", {}, function (response) { | ||
_tera_client_proxy_.resize_to(800, 600); | ||
_tera_client_proxy_.set_title(response.title); | ||
}); | ||
|
||
uiRequest("getCities", {}, function (response) { | ||
for (city of response.cities) { | ||
var name = city.name; | ||
var cssStyle = "left: " + (city.left + 10) + "px; top: " + city.top + "px"; | ||
var cssClass = "link"; | ||
|
||
if (city.available > 0) { | ||
if (city.available > 0 && city.available <= 5) { | ||
cssClass += " red"; | ||
name += " (" + city.available + ")"; | ||
} | ||
$("<a/>", { "text": name, "data-itemid": city.itemId, "class": cssClass, "style": cssStyle }).appendTo('#map'); | ||
} else { | ||
$("<span/>", { "text": name, "class": cssClass, "style": cssStyle }).appendTo('#map'); | ||
} | ||
} | ||
|
||
$(".link").click(function () { | ||
uiRequest("useItem", { "itemId": $(this).data("itemid") }, function () { | ||
_tera_client_proxy_.close(); | ||
}); | ||
}); | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body id="map"></body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.