Parcourir la source

Settings of various things!

Reddo il y a 5 ans
Parent
commit
814f3f7863

+ 116 - 0
content/CharacterCreation/ContentTypes.ts

@@ -0,0 +1,116 @@
+module CharacterCreation.ContentTypes {
+    let ccDiv = document.createElement("div");
+    ccDiv.id = "characterCreation";
+    let rightSide = document.createElement("div");
+    rightSide.id = "ccRight";
+    let leftSide = document.createElement("div");
+    leftSide.id = "ccLeft";
+    ccDiv.appendChild(leftSide);
+    ccDiv.appendChild(rightSide);
+
+    let resolver;
+
+    async function printTable () {
+        while (leftSide.firstChild) leftSide.removeChild(leftSide.firstChild);
+
+        await (new Say(new SayBold("Fetishes:")).getHTMLContent().then(eles => {
+            eles.forEach(ele => {
+                leftSide.appendChild(ele);
+            })
+        }));
+
+        let perks = ContentHandler.getContentTypes().sort((a : ContentType, b : ContentType) => {
+            let na = a.getName().toUpperCase();
+            let nb = b.getName().toUpperCase();
+            if (na < nb) return -1;
+            if (na > nb) return 1;
+            return 0;
+        });
+
+        for (let i = 0; i < perks.length; i++) {
+            let perk = perks[i];
+            let say = new Say(perk.getName());
+            if (perk.isAllowed()) {
+                if (!perk.isChangeable()) {
+                    say.add (" (Mandatory)");
+                } else {
+                    say.add(" - Into it");
+                }
+            } else if (!perk.isChangeable()) {
+                say.add(" (Forbidden)");
+            }
+            await (say).getHTML("p", ["choice"]).then(elementArray => {
+                Controls.Links.makeCustomLink(elementArray[0], {
+                    mouseover: () => {
+                        printPerk(perk);
+                    },
+                    mouseout: () => {
+                        emptyPerk();
+                    },
+                    click: () => {
+                        perk.toggle();
+                        reset();
+                    }
+                });
+                Controls.KeyHandler.applyCode(elementArray[0], Controls.KeyHandler.getSecondKeyCode());
+                leftSide.appendChild(elementArray[0]);
+            });
+        }
+    }
+
+    function printConfirm () {
+        (new Say("Confirm")).getHTML("p", ["choice"]).then(elementArray => {
+            elementArray[0].addEventListener("click", () => {
+                resolver();
+            });
+            Controls.KeyHandler.applyCode(elementArray[0], Controls.KeyHandler.getSecondKeyCode());
+            Elements.CurrentTurnHandler.print(elementArray[0]);
+        });
+    }
+
+    function emptyPerk () {
+        while (rightSide.firstChild) rightSide.removeChild(rightSide.firstChild);
+        printRightSideInfo();
+    }
+
+    function printRightSideInfo() {
+        let p = document.createElement("p");
+        p.classList.add("content");
+        p.appendChild(document.createTextNode("The fetishes the player character has will tailor the world the Obelisk will create for them."));
+
+        rightSide.appendChild(p);
+    }
+
+    function printPerk (perk : ContentType) {
+        let say = new Say(perk.getDescription());
+        say.getHTMLContent().then((eles => {
+            emptyPerk();
+            for (let i = 0; i < eles.length; i++) {
+                rightSide.appendChild(eles[i]);
+            }
+        }));
+    }
+
+    function reset () {
+        Elements.CurrentTurnHandler.clear();
+        Elements.CurrentTurnHandler.print(ccDiv);
+        printTable();
+        Elements.CurrentTurnHandler.print(document.createElement("br"));
+        Elements.CurrentTurnHandler.print(document.createElement("br"));
+        printConfirm();
+    }
+
+    export async function selectContentTypes () {
+        Elements.startMenu();
+
+        let promise = new Promise(resolve => {
+            resolver = resolve;
+        });
+
+        reset();
+
+        await promise;
+
+        Elements.endMenu();
+    }
+}

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
content/PlayBegins/Dialogue/IntroMenu.dl


+ 62 - 18
content/PlayBegins/Dialogue/IntroMenu.dl.ts

@@ -1,4 +1,4 @@
-// File created automatically by custom Dialogger on 5/20/2018, 4:53:22 PM
+// File created automatically by custom Dialogger on 4/7/2019, 4:57:41 PM
 // Do not tamper with this file.
 // It will be replaced automatically by Dialogger and all changes will be lost.
 // Instead change IntroMenu.dl.
@@ -10,6 +10,7 @@ module DialogueTrees {
         let text : DialogueText;
         let branch : DialogueBranch;
         let set : DialogueSet;
+        let nodetree : DialogueNodeTree;
         
         
         node = new DialogueNode("b018bb28-4efc-493b-ac37-31634c4e6406");
@@ -73,12 +74,16 @@ module DialogueTrees {
         
         
         set = new DialogueSet("f82fc177-b4bd-4f06-b7ab-216259e056a5");
-        set.setFunction(() => {Elements.endMenu();});
+        set.setFunction(() => {
+        Elements.endMenu();
+        });
         tree.addNode(set);
         
         
         set = new DialogueSet("9eeb2100-917d-41fd-b756-6d3b80e92463");
-        set.setFunction(() => {Elements.clearMainScreen();});
+        set.setFunction(() => {
+        Elements.startMenu(); Elements.clearMainScreen();
+        });
         set.setNext("bc32e411-3c54-4747-ad79-506fc5a9d6c9");
         tree.addNode(set);
         
@@ -89,7 +94,9 @@ module DialogueTrees {
         
         
         set = new DialogueSet("f448e718-9d24-4191-9913-ccc36d97c4c0");
-        set.setFunction(() => {Elements.startMenu(); tree.setRepeatChoices(false);});
+        set.setFunction(() => {
+        tree.setRepeatChoices(false);
+        });
         set.setNext("9f11871f-eebd-4b9a-b3db-ed9be8cf78e7");
         tree.addNode(set);
         
@@ -131,37 +138,49 @@ module DialogueTrees {
         
         
         set = new DialogueSet("9594cf06-6062-4952-b378-6aedaafe2951");
-        set.setFunction(() => {SaveHandler.setSlot(0);});
+        set.setFunction(() => {
+        SaveHandler.setSlot(0);
+        });
         set.setNext("a6b6b3d2-25ef-41b1-a5b5-25143f1b41f9");
         tree.addNode(set);
         
         
         set = new DialogueSet("fe95cfb3-b9f5-4b12-83aa-94d26e5bcac0");
-        set.setFunction(() => {SaveHandler.setSlot(1);});
+        set.setFunction(() => {
+        SaveHandler.setSlot(1);
+        });
         set.setNext("a6b6b3d2-25ef-41b1-a5b5-25143f1b41f9");
         tree.addNode(set);
         
         
         set = new DialogueSet("dc884974-7bb2-436f-b3a4-cdf8550bd494");
-        set.setFunction(() => {SaveHandler.setSlot(2);});
+        set.setFunction(() => {
+        SaveHandler.setSlot(2);
+        });
         set.setNext("a6b6b3d2-25ef-41b1-a5b5-25143f1b41f9");
         tree.addNode(set);
         
         
         set = new DialogueSet("62f5ea88-c6f0-4469-87f2-ea3b37638509");
-        set.setFunction(() => {SaveHandler.setSlot(3);});
+        set.setFunction(() => {
+        SaveHandler.setSlot(3);
+        });
         set.setNext("a6b6b3d2-25ef-41b1-a5b5-25143f1b41f9");
         tree.addNode(set);
         
         
         set = new DialogueSet("ee4ecd8b-59e2-43a6-8150-8a835d6eeae1");
-        set.setFunction(() => {SaveHandler.setSlot(4);});
+        set.setFunction(() => {
+        SaveHandler.setSlot(4);
+        });
         set.setNext("a6b6b3d2-25ef-41b1-a5b5-25143f1b41f9");
         tree.addNode(set);
         
         
         set = new DialogueSet("f25f6525-dad6-45d7-a391-246c1b02b569");
-        set.setFunction(() => {return SaveHandler.loadFromFile();});
+        set.setFunction(() => {
+        return SaveHandler.loadFromFile();
+        });
         set.setNext("5d1dfb86-abd9-4ad6-bf07-8ced5476e401");
         tree.addNode(set);
         
@@ -181,7 +200,9 @@ module DialogueTrees {
         
         
         set = new DialogueSet("ee65c84a-021f-44d3-aa34-50235f438c96");
-        set.setFunction(() => {SaveHandler.toggleErasing()});
+        set.setFunction(() => {
+        SaveHandler.toggleErasing()
+        });
         set.setNext("6f15f7d6-4944-4b93-9d47-7046e8ae1f15");
         tree.addNode(set);
         
@@ -192,7 +213,9 @@ module DialogueTrees {
         
         
         set = new DialogueSet("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");
-        set.setFunction(() => {return SaveHandler.loadFromStorage();});
+        set.setFunction(() => {
+        return SaveHandler.loadFromStorage();
+        });
         set.setNext("f82fc177-b4bd-4f06-b7ab-216259e056a5");
         tree.addNode(set);
         
@@ -209,7 +232,7 @@ module DialogueTrees {
         
         node = new DialogueNode("b75c038c-654c-4c62-8f49-2f4518f52cff");
         node.setName("Settings");
-        node.setNext("d33456b8-72b6-4214-90b3-3eba2442b287");
+        node.setNext("2392c787-0c2a-46fb-b06c-928e5f447a9f");
         tree.addNode(node);
         
         
@@ -220,7 +243,9 @@ module DialogueTrees {
         
         
         set = new DialogueSet("bc24b446-d6a2-4284-93fb-67ad3598fcd1");
-        set.setFunction(() => {return Elements.waitForAnyKey();});
+        set.setFunction(() => {
+        return Elements.waitForAnyKey();
+        });
         set.setNext("81f9d62b-907e-48ae-84fe-78c7cecc4fe3");
         tree.addNode(set);
         
@@ -249,7 +274,9 @@ module DialogueTrees {
         
         
         set = new DialogueSet("c27829b7-7199-4b1e-9334-536258546cfc");
-        set.setFunction(() => {return Elements.waitForAnyKey();});
+        set.setFunction(() => {
+        return Elements.waitForAnyKey();
+        });
         set.setNext("42401145-9154-40c3-a9d3-4f83df97b89e");
         tree.addNode(set);
         
@@ -260,7 +287,9 @@ module DialogueTrees {
         
         
         set = new DialogueSet("7c2060aa-66ce-4dbb-88d2-0c8f190e0a6c");
-        set.setFunction(() => {Elements.clearMainScreen();});
+        set.setFunction(() => {
+        Elements.clearMainScreen();
+        });
         set.setNext("59a3cb30-d4ba-4b46-8157-b900fc7022dd");
         tree.addNode(set);
         
@@ -285,16 +314,31 @@ module DialogueTrees {
         
         
         set = new DialogueSet("50876e13-23b9-43c0-b6b1-a89b1683d5e7");
-        set.setFunction(() => {return Elements.waitForAnyKey();});
+        set.setFunction(() => {
+        return Elements.waitForAnyKey();
+        });
         set.setNext("915492f1-8fa7-4ddc-9dc0-6b0340f738c8");
         tree.addNode(set);
         
         
         set = new DialogueSet("d0dcd7c6-26ae-41d0-99a6-e0cae17ae381");
-        set.setFunction(() => {Elements.clearMainScreen();});
+        set.setFunction(() => {
+        Elements.clearMainScreen();
+        });
         set.setNext("b8ee6702-8d38-4bd7-9b24-df8c901a50d4");
         tree.addNode(set);
         
+        
+        nodetree = new DialogueNodeTree("2392c787-0c2a-46fb-b06c-928e5f447a9f");
+        nodetree.setTree(() => { return DialogueTrees.Settings; });
+        nodetree.setNext("3c334c63-9030-4fba-884e-a147f40eb8f5");
+        tree.addNode(nodetree);
+        
+        
+        node = new DialogueNode("3c334c63-9030-4fba-884e-a147f40eb8f5");
+        node.setNext("");
+        tree.addNode(node);
+        
         return tree;
     })();
 }

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
content/PlayBegins/Dialogue/Settings.dl


+ 104 - 0
content/PlayBegins/Dialogue/Settings.dl.ts

@@ -0,0 +1,104 @@
+// File created automatically by custom Dialogger on 4/7/2019, 5:55:54 PM
+// Do not tamper with this file.
+// It will be replaced automatically by Dialogger and all changes will be lost.
+// Instead change Settings.dl.
+module DialogueTrees {
+	export let Settings = (function () {
+        let tree : DialogueTree = new DialogueTree("Settings");
+        let node : DialogueNode;
+        let set : DialogueSet;
+        let text : DialogueText;
+        let choice : DialogueChoice;
+        
+        
+        node = new DialogueNode("b258ed06-020b-4c1f-b2ad-afbe13ac7b38");
+        node.setNext("615b397b-76ca-485c-a637-1d2b539c6b54");
+        tree.addStartNode(node);
+        
+        
+        set = new DialogueSet("eee6d351-4e6f-428d-8dd6-72be79e31e6d");
+        set.setFunction(() => {
+        Elements.startMenu(); tree.setRepeatChoices(false); Elements.clearMainScreen();
+        });
+        set.setNext("5a11c2bc-6184-4926-9d24-454ca883dffc");
+        tree.addNode(set);
+        
+        
+        node = new DialogueNode("615b397b-76ca-485c-a637-1d2b539c6b54");
+        node.setName("SettingOptions");
+        node.setNext("eee6d351-4e6f-428d-8dd6-72be79e31e6d");
+        tree.addNode(node);
+        
+        
+        text = new DialogueText("5a11c2bc-6184-4926-9d24-454ca883dffc");
+        text.setSay(() => { return new Say(Say.CENTERED, new SayImage("introLogo"), Say.LINE_BREAK, new SayItalic("The Obelisk is an adult interactive fiction game set in a post-apocalyptic world ravaged by a magical structure."));});
+        text.setChoices(["4dcaee8f-2df1-4fba-b73e-581c522b6b5a","44119992-4c08-49fc-a4c8-602ee190cb8f","77536f7c-dad5-413c-b65e-567894d6736e","c56b6549-c1c4-4bb2-81bf-9e6816b3326f","d846c98a-1937-4e15-9c58-58b02f7efed5"]);
+        tree.addNode(text);
+        
+        
+        choice = new DialogueChoice("4dcaee8f-2df1-4fba-b73e-581c522b6b5a");
+        choice.setSay(() => { return new Say("Key Mapping");});
+        choice.setNext("ea28fe17-1897-49fd-a65b-e8fd63fef1d3");
+        tree.addNode(choice);
+        
+        
+        choice = new DialogueChoice("44119992-4c08-49fc-a4c8-602ee190cb8f");
+        choice.setSay(() => { return new Say("Font Size");});
+        choice.setNext("25936903-6b5e-4137-82e2-267b50ec1c41");
+        tree.addNode(choice);
+        
+        
+        choice = new DialogueChoice("77536f7c-dad5-413c-b65e-567894d6736e");
+        choice.setSay(() => { return new Say("Color Scheme");});
+        choice.setNext("25936903-6b5e-4137-82e2-267b50ec1c41");
+        tree.addNode(choice);
+        
+        
+        choice = new DialogueChoice("c56b6549-c1c4-4bb2-81bf-9e6816b3326f");
+        choice.setSay(() => { return new Say("Fetishes");});
+        choice.setNext("3dabd8ef-9bcb-4792-bdbd-58ec3d5b0834");
+        tree.addNode(choice);
+        
+        
+        choice = new DialogueChoice("d846c98a-1937-4e15-9c58-58b02f7efed5");
+        choice.setSay(() => { return new Say("Go back");});
+        tree.addNode(choice);
+        
+        
+        text = new DialogueText("25936903-6b5e-4137-82e2-267b50ec1c41");
+        text.setSay(() => { return new Say("Not implemented.");});
+        text.setNext("2797f523-7444-4065-a8e9-55ea803af940");
+        tree.addNode(text);
+        
+        
+        set = new DialogueSet("3dabd8ef-9bcb-4792-bdbd-58ec3d5b0834");
+        set.setFunction(() => {
+        return CharacterCreation.ContentTypes.selectContentTypes();
+        });
+        set.setNext("e87068cb-e3b5-4c49-8bac-8ecdb06ba3a6");
+        tree.addNode(set);
+        
+        
+        node = new DialogueNode("e87068cb-e3b5-4c49-8bac-8ecdb06ba3a6");
+        node.setNext("SettingOptions");
+        tree.addNode(node);
+        
+        
+        set = new DialogueSet("2797f523-7444-4065-a8e9-55ea803af940");
+        set.setFunction(() => {
+        return Elements.waitForAnyKey();
+        });
+        set.setNext("e87068cb-e3b5-4c49-8bac-8ecdb06ba3a6");
+        tree.addNode(set);
+        
+        
+        set = new DialogueSet("ea28fe17-1897-49fd-a65b-e8fd63fef1d3");
+        set.setFunction(() => {
+        return Controls.KeyHandler.KeySetter.setKeys();
+        });
+        set.setNext("e87068cb-e3b5-4c49-8bac-8ecdb06ba3a6");
+        tree.addNode(set);
+        
+        return tree;
+    })();
+}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff