• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Generator Suggestion.

Status
Not open for further replies.

PrestonParsons

BETA Tester
Hello,

I wanted to suggest you that Generator option.

When you click Class. its show all option you choose. for etc. i pick Armor
then you click on subclass, Its appear everything. Its should come up with Armor, which like pant, Wrist, Shoulder, head, Chest etc.

I just giving you ideas :)
 

Tommy

Founder
I guess to make it easier for people so they don't have to go to here or other sources to find out the subclass w/said class you chose.
 

Tok124

Respected Member
I recommend to add a javascript to change the options in subclass depending on options from class. I use it for my own SQL Generator. But i'm not allowed to link that for a preview so i will make a pen on codepen to show preview. But i will link js here anyway

Code:
			var subclasses = {};
	subclasses['4'] = ['Misc','Cloth', 'Leather', 'Mail', 'Plate'];
	subclasses['2'] = ['1H Axe', '2H Axe', 'Bow', 'Gun', '1H Mace', '2H Mace', 'Polearm', '1H Sword', '2H Sword', 'Obsolete', 'Staff', 'Exotic', 'Exotic', 'Fist Weapon', 'Miscellaneous', 'Dagger', 'Thrown', 'Spear', 'Crossbow', 'Wand', 'Fishing Pole']

function subclasslist() {
	var classList = document.getElementById("class");
	var modelList = document.getElementById("subclass");
	var selclass = classList.options[classList.selectedIndex].value;
		while (modelList.options.length) {
			modelList.remove(0);
		}
	var classe = subclasses[selclass];
		if (classe) {
			var i;
			for (i = 0; i < classe.length; i++) {
				var car = new Option(classe[i], classe[i]);
				modelList.options.add(car);
			}
		}
}

Live Preview:
http://codepen.io/tok124/pen/aOpWYW
 
Last edited:

PrestonParsons

BETA Tester
I recommend to add a javascript to change the options in subclass depending on options from class. I use it for my own SQL Generator. But i'm not allowed to link that for a preview so i will make a pen on codepen to show preview. But i will link js here anyway

Code:
			var subclasses = {};
	subclasses['4'] = ['Misc','Cloth', 'Leather', 'Mail', 'Plate'];
	subclasses['2'] = ['1H Axe', '2H Axe', 'Bow', 'Gun', '1H Mace', '2H Mace', 'Polearm', '1H Sword', '2H Sword', 'Obsolete', 'Staff', 'Exotic', 'Exotic', 'Fist Weapon', 'Miscellaneous', 'Dagger', 'Thrown', 'Spear', 'Crossbow', 'Wand', 'Fishing Pole']

function subclasslist() {
	var classList = document.getElementById("class");
	var modelList = document.getElementById("subclass");
	var selclass = classList.options[classList.selectedIndex].value;
		while (modelList.options.length) {
			modelList.remove(0);
		}
	var classe = subclasses[selclass];
		if (classe) {
			var i;
			for (i = 0; i < classe.length; i++) {
				var car = new Option(classe[i], classe[i]);
				modelList.options.add(car);
			}
		}
}

Live Preview:
http://codepen.io/tok124/pen/aOpWYW

that's way look better :D
 

Hyperion

Founder
That's just as easy to do through PHP and HTML. I try not to use any javascript, ajax or jquery in general unless I have to..

It's something we can look in to, since the Generator is in mid upgrade.
 

Tok124

Respected Member
That's just as easy to do through PHP and HTML. I try not to use any javascript, ajax or jquery in general unless I have to..

It's something we can look in to, since the Generator is in mid upgrade.
lol, Thats the best part of website. Ajax is amazing... Is there any reason for why you dont wanna use it? :p
 

Tommy

Founder
Code could be cleaned up since it is ugly as fudge, but it is nice nonetheless. It's very simple to do, yes -- I have it written out already.
 
Status
Not open for further replies.
Top