Update cubesstuff.js

This commit is contained in:
Cube14yt 2025-08-24 19:59:51 +08:00 committed by GitHub
parent 485065c3ce
commit 2c7e43ed50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 3 deletions

View File

@ -567,10 +567,17 @@ keybinds["KeyT"] = function () {
tpsPrompt()
}
function addRow() {
function addRowWhenReady() {
const table = document.getElementById("controlsTable");
const rowCount = table.rows.length;
if (!table) {
// Table not ready yet, try again in 100ms
setTimeout(addRowWhenReady, 100);
return;
}
// Table exists, add the row
const rowCount = table.rows.length;
const newRow = table.insertRow(rowCount - 1);
const cell1 = newRow.insertCell(0);
@ -578,9 +585,13 @@ function addRow() {
cell1.textContent = "Change TPS";
cell2.innerHTML = "<kbd>T</kbd>";
console.log("Row added successfully!");
}
addRow()
// Start the process
addRowWhenReady();
elements.randomizer = {
buttonColor: ["#ff0000", "#ff8800", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"],
@ -1843,3 +1854,4 @@ elements.adjustable_cooler = {
};