void add_items() {
page.append("<fieldset><legend>Add Actions for these Items</legend>"); // write_box()
int AddQ;
foreach key in OCDefault
if(!(OCD contains key) && item_amount(key) > 0) AddQ += 1; #{AddQ += 1; print(key);}
int curr_items = curr_items();
if(curr_items > 0 && AddQ > 0) {
page.append("<p>");
if(write_button("defaultdata", "Add default")) {
foreach key in OCDefault
if(!(OCD contains key) && item_amount(key) > 0) OCD[key] = OCDefault[key];
save_ocd();
curr_items = curr_items();
}
page.append(" Add default information for "+AddQ+" common item"+(AddQ == 1? " that is": "s that are")+" listed below.</p>");
}
boolean table_started = false;
int CtrAdvisor= 1;
foreach doodad in get_inventory()
// Quest items are the only items that cannot be displayed, so check for is_OCDable()
if(is_OCDable(doodad) && !(OCD contains doodad && OCD[doodad].action != "UNKN")) {
if(!table_started) {
page.append("<table border=0 cellpadding=1><tr><td>");
write_button("mall", "Mall All");
page.append("</td><td>Categorize all mallable items to be sold in the mall</td></tr><tr><td>");
write_button("closet", "Closet All");
page.append("</td><td>Categorize all uncategorized items to be stored in your closet</td></tr><tr><td>");
write_button("keep", "Keep All");
page.append("</td><td>Categorize all uncategorized items to be kept</td></tr></table>");
page.append("<table border=0 cellpadding=1>");
page.append("<tr><th colspan=2>Item</th><th>Have</th>");
if(count(stock) > 0 && vars["BaleOCD_Stock"].to_int() > 0)
page.append("<th>Stock</th>");
page.append("<th>Advisor</th><th>Keep</th><th>Action</th><th>... information</th></tr>");
table_started = true;
}
page.append("<tr valign=center class='item'");
if(count(stock) > 0 && vars["BaleOCD_Stock"].to_int() > 0
&& stock contains doodad && stock[doodad].q >= item_amount(doodad))
page.append(" style='background-color:E3E3E3'");
page.append("><td>"+imagedesc(doodad)+"</a></td>");
int q = 0;
string act = "UNKN";
string info = "";
if(OCD contains doodad) {
q = OCD[doodad].q;
act = OCD[doodad].action;
info = OCD[doodad].info;
}
page.append("<td align=center>"+item_amount(doodad)+"</td><td align=center>");
if(count(stock) > 0 && vars["BaleOCD_Stock"].to_int() > 0) {
if(stock contains doodad) page.append(stock[doodad].q);
else page.append("0");
page.append("</td><td align=center>");
}
if(write_button("Advisor"+CtrAdvisor, "Advisor")){
print (doodad+" sells for "+mall_price(doodad)+" meat in the mall", "blue");
print ("********");
}
ctradvisor +=1;
page.append("</td><td>");
OCD[doodad].q = write_field(q, "q_"+to_int(doodad));
page.append("</td><td>");
OCD[doodad].action = action_drop(act, doodad);
page.append("</td><td>");
OCD[doodad].info = write_field(info, "i_"+to_int(doodad), 14);
page.append("</td></tr>");
}
if(table_started)
page.append("</table>");
else
page.append("<p style='text-align:center; font-size:110%; font-weight:bold; color:#0000BB;'>Your entire inventory has already been categorized.<br />Nothing to see here, please move along.</p>");
page.append("</fieldset>"); // finish_box()
}