I uploaded it to github but realized you need some other classes with it (like requirements/includes). The crafting class looks like it uses the Stabilizer class and Inventory class (possibly). The idea was for each class to be standalone so the main functions you'd utilize probably are. Also, the METHOD links below tell you what each function does for it's class..
https://github.com/Elmling/Lob2
Here are the
methods for the
crafting class
Here are the
methods for the
menu classExamples below
../Menus/menu_yesNo.txt:
1.if(isObject($menu::YesNo))
$menu::YesNo.delete();
$menu::YesNo = $class::menuSystem.newMenuObject("YesNo","Menu YesNo");
$menu::YesNo.addMenuItem("Yes","%a=1");
$menu::YesNo.addMenuItem("No","%a=1");
2. (little more functionality)In .
./Menus/menu_crafting_wood.txt:if(isObject($menu::Crafting))
$menu::Crafting.delete();
$menu::Crafting = $class::menuSystem.newMenuObject("Crafting","What would you like to do to the Wood?");
$menu::Crafting.setname("CraftingMenu");
$menu::Crafting.class = "CraftingMenu";
$menu::Crafting.addMenuItem("Craft Bow Handle","$menu::crafting.setTempBody(\"Enter an Amount or type ALL\");$menu::crafting.showInputMenu(#CLIENT);");//"$menu::Crafting.showInputMenu(#CLIENT);");
$menu::Crafting.addMenuItem("Craft Handle (for weapons/tools)","$menu::crafting.setTempBody(\"Enter an Amount or type ALL\");$menu::crafting.showInputMenu(#CLIENT);");//"$class::Crafting.ageSelected(#CLIENT.ndSelection);");
$menu::Crafting.addMenuItem("Craft Arrow Shafts","");//"$class::Crafting.useColors(#CLIENT.ndSelection);");
package class_menu_crafting_wood
{
function menuObject::onInputValueRecieved(%this,%client,%value)
{
if(%this.name $= "crafting")
{
%selected = %this.selected[%client];
if(%selected $= "craft arrow Shafts")
{
%type = "Arrow Shafts";
}
else
if(%selected $= "craft handle (for weapons/tools)")
{
%type = "Handle";
}
else
if(%selected $= "Craft Bow handle")
{
%type = "Bow Handle";
}
%inventoryItemSelected = getWord(%client.lastInventoryItemSelected,0);
%recipe = $class::crafting.getRecipe(%inventoryItemSelected @ " " @ %type);
if(!isObject(%recipe))
{
talk("The wood classes are: Pine, Oak, Willow, Maple");
return parent::onInputValueRecieved(%this,%client,%value);
}
%client.craftingStart(%recipe,%value);
}
return parent::onInputValueRecieved(%this,%client,%value);
}
};
activatePackage(class_menu_crafting_wood);