Skip to content

Commit

Permalink
Merge pull request #34 from onlypuppy7/dev-seq
Browse files Browse the repository at this point in the history
Lorem Ipsum, dolor sit amet, consetetur sadipscing elitr, sed diam no…
  • Loading branch information
TheRealSeq authored Nov 19, 2024
2 parents 0ef7bc4 + 5f63baf commit c7e06fe
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions server-client/src/client-static/editor/js/mapEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const preferences = {
}

initPref("loremipsim", "loremIpsum", true, "ds");
initPref("playtestHotkey", "Playtest Hotkey", true, "the \"p\" hotkey for playtesting");
initPref("pointerLockOnClose", "Pointerlock on object menu close", true, "lock the pointer when the object menu is closed");
initPref("doubleSlotForOM", "double-select slot for object menu", true, "opens the object menu when pressing hotkey for selected slot again");


function initPref(internalName, displayName, val, description){
preferences[internalName] = {
Expand All @@ -29,6 +33,10 @@ function initPref(internalName, displayName, val, description){
}
}

function pref(interNalName){
return preferences[interNalName].val;
}

//wow, this is NOT the best way to do this. Eh it's 1am ITS FINE //ye keeping this
document.addEventListener("DOMContentLoaded", ()=>{
//wowoowow DYNAMIC preference menu!!!111111
Expand Down Expand Up @@ -89264,7 +89272,7 @@ var extern = (() => {
el.style.display = "none";
tooltipEl.style.display = "none";
//Seq added
canvas.requestPointerLock();
if(pref("pointerLockOnClose")) canvas.requestPointerLock();
} else {
el.style.display = "block";
document.exitPointerLock();
Expand Down Expand Up @@ -89360,7 +89368,7 @@ var extern = (() => {
if (idx == -1)
idx = 9;
//Seq added
if(idx == paletteIdx)
if(idx == paletteIdx && pref("doubleSlotForOM"))
toggleObjectMenu();
selectPaletteSlot(idx);
if (e.shiftKey)
Expand Down Expand Up @@ -89427,7 +89435,7 @@ var extern = (() => {
break;
//Seq added
case "p":
testMap();
if(pref("playtestHotkey")) testMap();
break;
}
}
Expand Down

0 comments on commit c7e06fe

Please sign in to comment.