-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (63 loc) · 4.66 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html><html lang="en"><head><title>Quest- and Conversation-viewer for Pillars of Eterninty</title><script src="../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script><link rel="import" href="constants.html"><link rel="import" href="constants-npc-guids.html"><link rel="import" href="constants-conditionals.html"><link rel="import" href="constants-scriptfunctions.html"><link rel="import" href="root-data-elements.html"><link rel="import" href="flowChartLink-element.html"><link rel="import" href="stringtable-viewer.html"><style>
body {
margin-bottom: 240px;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 0;
}
.quest {
background-color: #edefff;
}
.conversation {
background-color: #d1fcf0;
}
.stringtable {
background-color: #e2eb98;
}
</style><script>
"use strict";
function print_content() {
// mach das erst auf button click, also sehr spät, das davor dauert …
var nodes = document.getElementsByTagName("questdata-element");
if(nodes.length > 0) {
console.log(nodes[0].toXML());
}
nodes = document.getElementsByTagName("conversationdata-element");
if(nodes.length > 0) {
console.log(nodes[0].toXML());
}
}
function read_quest() {
var questData = new QuestData();
questData.fromXML(document.getElementById("questXML").value);
document.getElementsByTagName("body")[0].appendChild(questData);
}
function read_conversation() {
var conversationData = new ConversationData();
conversationData.fromXML(document.getElementById("conversationXML").value);
document.getElementsByTagName("body")[0].appendChild(conversationData);
}
function read_stringtable_for_Conversation() {
// connect somehow, prototypisch
var nodes = document.getElementsByTagName("conversationdata-element");
if(nodes.length > 0) {
nodes[nodes.length - 1].stringsFromXML(document.getElementById("stringTable").value);
}
}
function read_stringtable_for_Quest() {
var nodes = document.getElementsByTagName("questdata-element");
if(nodes.length > 0) {
nodes[nodes.length - 1].stringsFromXML(document.getElementById("stringTable").value);
}
}
function write_stringtable() {
var nodes = document.getElementsByTagName("questdata-element");
if(nodes.length > 0) {
console.log(nodes[0].stringsToXML());
}
nodes = document.getElementsByTagName("conversationdata-element");
if(nodes.length > 0) {
console.log(nodes[0].stringsToXML());
}
}
</script></head><body><h2>Instructions</h2>Copy the content of a .quest file in the light violet box. And the content of a conversation file in the turquoise box. Hit the respective buttons. Limitations: write buttons write only the first read quest/ conversation.<br>Stringtables for Conversations can span multiple files. Read them all one after another.<br>On selecting a Node (Box) all ingoing links get blue, and all outgoing links get green.<br>If a speaker name is "-" then this npc has got no name.<br>Its not up to date with the Expansions.<h3>Conditions</h3>Conditions can now be edited. The question mark icon and each parameter name has a short description text on hover.<h3>New Nodes</h3>Completly from scratch: Hit the “Read Quest” and “Read Conversation” button with an empty textbox. Behind the crude labeled Buttons is the Function to create new Nodes. They will order themself yust downward. To reorder them it is currently necessary to export and reread the quest / conversation.<h3>Nice examples</h3>[game-path]/data/quests/05_defiance_bay_heritage_hill/05_qst_rise_and_fall.quest<br>[game-path]/data/conversations/07_gilded_vale/07_bs_rh_ext_guard_01.conversation<br><h5>Tested and Works on: FF, Chrome and IE.</h5><div style="display:flex;"><div style="display:flex;flex-direction: column;width: 260px;"><button class="quest" onclick="read_quest()">Read Quest</button> <button class="quest stringtable" onclick="read_stringtable_for_Quest()">Read Stringtable for last read quest</button> <button class="conversation" onclick="read_conversation()">Read Conversation</button> <button class="stringtable" onclick="read_stringtable_for_Conversation()">Read Stringtable for last read conversation</button> <button onclick="print_content()">write modified XML to console</button> <button onclick="write_stringtable()">write modified Stringtable XML to console</button></div><div><textarea id="questXML" class="quest" cols="60" rows="10" placeholder=".quest"></textarea> <textarea id="stringTable" class="stringtable" cols="60" rows="10" placeholder=".stringtable"></textarea> <textarea id="conversationXML" class="conversation" cols="60" rows="10" placeholder=".conversation"></textarea></div></div><stringtable-viewer></stringtable-viewer></body></html>