public CharInfo(GameObject objecte, string aname, Stats stats) { name = aname; stats = new Stats(); inv = new Inventory(40); rawinv = new RawInv(50); rawinv.add(0, 3); rawinv.add("Iron Ore", 12); rawinv.add(4, 1); rawinv.add("Sulfur", 3); tinstance = objecte; oxg = 0; maxoxg = 7.5f; isdrainingox = 0; photonid = 0; askill = new skillinfo(); }
void DrawRawInv(RawInv araw, socketIG thesock, Rect darect) { GUIStyle MenuStyle = new GUIStyle(prettyskinloseend.label); GUI.Label( darect, "", MenuStyle); RawInv theinv = araw; Rect lineend = guitools.GRectRelative(0, 0.85f, 1, 0.15f, darect); guitools.SetStyle(MenuStyle, guitools.RGB(150, 150, 150, 255), Color.black, (int)Math.Round(10f)); GUI.Label(guitools.GRectRelative(0, 0, 1, 0.1f, darect,0.9f), "Raw Ressource", MenuStyle); guitools.SetStyle(MenuStyle, guitools.RGB(150, 150, 150, 255), Color.black, (int)Math.Round(10f)); GUI.Label(guitools.GRectRelative(0, 0.9f, 1, 0.1f, darect, 0.9f), "MASS: " + theinv.readkg + "kg OF " + theinv.maxmass + "kg", MenuStyle); if (theinv.inv.Count < 10) { for (int k = 0; k < 10; k++) { Rect workingrect = guitools.GRectRelative(0, 0.1f, 1, 0.8f, darect); int mink = k % 10; Rect slotrect = guitools.GRectRelative(0, mink / 10f, 1, 1 / 10f, workingrect, 0.9f); guitools.SetStyle(MenuStyle, guitools.RGB(230, 230, 230, 255), Color.black, (int)Math.Round(7f)); GUI.Label(slotrect, "", MenuStyle); if (k < theinv.inv.Count) { guitools.SetStyle(MenuStyle, guitools.RGB(200, 200, 200, 255), Color.black, (int)Math.Round(5f)); GUI.Label(slotrect, "", MenuStyle); guitools.TextureStyle(MenuStyle, Tvoid); MenuStyle.alignment = TextAnchor.MiddleLeft; GUI.Label(guitools.GRectRelative(0, 0, 2 / 3f, 1, slotrect), theinv.inv[k].raw.name + ": ", MenuStyle); MenuStyle.alignment = TextAnchor.MiddleRight; GUI.Label(guitools.GRectRelative(0, 0, 2 / 3f, 1, slotrect), theinv.inv[k].readkg + "kg", MenuStyle); MenuStyle.alignment = TextAnchor.MiddleCenter; guitools.TextureStyle(MenuStyle, TArrowRight); guitools.SetStyle(MenuStyle, guitools.RGB(100, 100, 100, 255), Color.black, (int)Math.Round(7f)); GUI.Label(guitools.GRectRelative(0.2f, 0, 0.6f, 1, guitools.GRectRelative(2 / 3f, 0, 1 / 6f, 1, slotrect, 0.9f)), "", MenuStyle); MenuStyle = new GUIStyle(prettyskin.label); guitools.SetStyle(MenuStyle, guitools.RGB(175, 175, 175, 100), Color.black, (int)Math.Round(7f)); if (GUI.Button(guitools.GRectRelative(2 / 3f, 0, 1 / 6f, 1, slotrect), "", MenuStyle)) { float rest = worldgen.maininfo.rawinv.add(theinv.inv[k].id, theinv.inv[k].kg); foreach (RawInv.rawlibitem item in theinv.inv) { if (item.id == theinv.inv[k].id) { item.kg = rest; } } reset: if (theinv.inv.Count > 0) { for (int k2 = 0; k2 < theinv.inv.Count; k2++) { if (theinv.inv[k2].kg <= 0) { theinv.inv.RemoveAt(k2); goto reset; } } } } MenuStyle.alignment = TextAnchor.MiddleCenter; guitools.TextureStyle(MenuStyle, Twhite); } } } }
public drops() { aninv = new RawInv(100); }
public rawinvs(float max) { aninv = new RawInv(max); }