Post by rektangle on Feb 5, 2021 20:37:41 GMT -8
So, a year back I was working on a plugin for a custom combat system. It was working pretty neatly, I might say, though perhaps it was a bit too ambitious and I was never able to get it fully where I wanted.
I am looking to revive my old forum where I used this, but while it used to work, it... does nothing now. I know a few of its quirks but this was not one of them.
Basically, the plugin creates a button, which, when pressed, would give a prompt with some fields the user could fill out. After that, it would be saved in a key, and you could use another button to go to a new page to interact with the thing that was created by you filling the prompt. It was basically for a very simple battle system, where you could create encounters with some rules.
The issue is, when pressed, the button does not prompt anything. No error code is given, and I cannot find the faulty line. Oddly enough, the other code, the one to create a new page and all that seems to work.
I've been tinkering around a bit, but so far, no luck.
I should add, self-taught to code by basically ramming my head into documentation, so I will admit to be very green and am very likely to have caused this myself sometime last year while still developing. I've seldomly touched coding in the last year, so, I actually think I forgot a lot :')
Anyway, here's my test forum where the buttons can be found.
And here's the code that (I think, to be fair I didn't comment many of the lines) makes the button "work"
"battleindex" is a variable that I use to quickly access the key, battleData is an object with the values I need.
I am looking to revive my old forum where I used this, but while it used to work, it... does nothing now. I know a few of its quirks but this was not one of them.
Basically, the plugin creates a button, which, when pressed, would give a prompt with some fields the user could fill out. After that, it would be saved in a key, and you could use another button to go to a new page to interact with the thing that was created by you filling the prompt. It was basically for a very simple battle system, where you could create encounters with some rules.
The issue is, when pressed, the button does not prompt anything. No error code is given, and I cannot find the faulty line. Oddly enough, the other code, the one to create a new page and all that seems to work.
I've been tinkering around a bit, but so far, no luck.
I should add, self-taught to code by basically ramming my head into documentation, so I will admit to be very green and am very likely to have caused this myself sometime last year while still developing. I've seldomly touched coding in the last year, so, I actually think I forgot a lot :')
Anyway, here's my test forum where the buttons can be found.
And here's the code that (I think, to be fair I didn't comment many of the lines) makes the button "work"
createBattle: function(){
var self = this;
var button = $("<button>Create Battle</button>").click(function(){
var thread = parseInt(pb.data("route").params.thread_id, 10);
battleData.BattlID = thread;
battleindex.set({value: battleData});
self.askforReg();
});
var container = $("<div/>").append(button).css({
"text-align": "center",
"margin-bottom": "5px"
});
$("#content").prepend(container);
},
"battleindex" is a variable that I use to quickly access the key, battleData is an object with the values I need.