webui-account-cheats-payload-input-by-value
This commit is contained in:
		
							parent
							
								
									32c95b6715
								
							
						
					
					
						commit
						e3cd4f4c4a
					
				@ -1986,7 +1986,11 @@ function updateInventory() {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for (const elm of accountCheats) {
 | 
					            for (const elm of accountCheats) {
 | 
				
			||||||
                elm.checked = !!data[elm.id];
 | 
					                if (elm.type === "checkbox") {
 | 
				
			||||||
 | 
					                    elm.checked = !!data[elm.id];
 | 
				
			||||||
 | 
					                } else if (elm.type === "number") {
 | 
				
			||||||
 | 
					                    elm.value = data[elm.id] !== undefined ? data[elm.id] : elm.getAttribute("data-default") || "";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@ -3214,9 +3218,10 @@ function doIntrinsicsUnlockAll() {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
document.querySelectorAll("#account-cheats input[type=checkbox]").forEach(elm => {
 | 
					document.querySelectorAll("#account-cheats input[type=checkbox], #account-cheats input[type=number]").forEach(elm => {
 | 
				
			||||||
    elm.onchange = function () {
 | 
					    elm.onchange = function () {
 | 
				
			||||||
        revalidateAuthz().then(() => {
 | 
					        revalidateAuthz().then(() => {
 | 
				
			||||||
 | 
					            const value = elm.type === "checkbox" ? elm.checked : elm.value;
 | 
				
			||||||
            $.post({
 | 
					            $.post({
 | 
				
			||||||
                url: "/custom/setAccountCheat?" + window.authz,
 | 
					                url: "/custom/setAccountCheat?" + window.authz,
 | 
				
			||||||
                contentType: "application/json",
 | 
					                contentType: "application/json",
 | 
				
			||||||
@ -3237,7 +3242,7 @@ document.querySelectorAll("#guild-cheats input[type=checkbox]").forEach(elm => {
 | 
				
			|||||||
                contentType: "application/json",
 | 
					                contentType: "application/json",
 | 
				
			||||||
                data: JSON.stringify({
 | 
					                data: JSON.stringify({
 | 
				
			||||||
                    key: elm.id,
 | 
					                    key: elm.id,
 | 
				
			||||||
                    value: elm.checked
 | 
					                    value: value
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user