Пример #1
0
    void DrawLight01Menu(Rect arect, socketIG thesock, sprop.elec elec, sprop.vals valis)
    {
        GUIStyle MenuStyle = new GUIStyle(prettyskin.label);

        guitools.SetStyle(MenuStyle, guitools.RGB(255, 255, 255, 255), Color.black, (int)Math.Round(18f));

        GUI.Label(arect, "", MenuStyle);

        if (GUI.Button(guitools.GRectRelative(0, 0.9f, 1, 0.1f, arect), "OK", MenuStyle))
        {
            isinteracting = false;
            NetworkerPhoton.RPCSetInteract(thesock.location, false, fserial.saveasstring(thesock.asock.props));
            Cursor.visible = false;
            cam.controlmouse = true;
            cam.controlkeys = true;
            Cursor.lockState = CursorLockMode.Locked;
        }

        Rect OffOnn = guitools.GRectRelative(0, 0.1f, 1, 0.1f, arect);

        if (valis.vbool)
        {
            GUI.Label(guitools.GRectRelative(0, 0, 1, 0.1f, arect), "STATUS : ONLINE", MenuStyle);
            valis.vbool = GUI.Toggle(guitools.GRectRelative(0.8f, (guitools.GRectRelative(0, 0, 1, 1, OffOnn))), valis.vbool, "TURN OFF", MenuStyle);
        }
        else
        {
            GUI.Label(guitools.GRectRelative(0, 0, 1, 0.1f, arect), "STATUS : OFFLINE", MenuStyle);
            valis.vbool = GUI.Toggle(guitools.GRectRelative(0.8f, (guitools.GRectRelative(0, 0, 1, 1, OffOnn))), valis.vbool, "TURN ON", MenuStyle);
        }

        guitools.SetStyle(MenuStyle, guitools.RGB(255, 255, 255, 255), Color.black, (int)Math.Round(12f));
        Rect Colore = guitools.GRectRelative(0, 0.2f, 1, 0.1f, arect);
        GUI.Label(Colore, "COLOR: ", MenuStyle);
        Colore = guitools.GRectRelative(0, 0.3f, 0.2f, 0.1f, arect);
        GUI.Label(Colore, "R:" + Mathf.RoundToInt(valis.vVector3.x), MenuStyle);
        Colore = guitools.GRectRelative(0, 0.4f, 0.2f, 0.1f, arect);
        GUI.Label(Colore, "G:" + Mathf.RoundToInt(valis.vVector3.y), MenuStyle);
        Colore = guitools.GRectRelative(0, 0.5f, 0.2f, 0.1f, arect);
        GUI.Label(Colore, "B:" + Mathf.RoundToInt(valis.vVector3.z), MenuStyle);

        guitools.SetStyle(MenuStyle, guitools.RGB(valis.vVector3.x, valis.vVector3.y, valis.vVector3.z, 255), Color.black, (int)Math.Round(18f));
        Rect Colores = guitools.GRectRelative(0.8f, 0.3f, 0.2f, 0.3f, arect);
        GUI.Label(Colores, "", MenuStyle);


        float A = 0;
        float B = 0;
        float C = 0;
        guitools.SetStyle(MenuStyle, guitools.RGB(200, 200, 200, 255), Color.black, (int)Math.Round(18f));
        GUIStyle MenuStyle2 = new GUIStyle(prettyskin.label);
        guitools.SetStyle(MenuStyle2, guitools.RGB(150, 150, 150, 255), Color.black, (int)Math.Round(18f));
        Colore = guitools.GRectRelative(0.2f, 0.3f, 0.6f, 0.1f, arect);
        A = GUI.HorizontalSlider(guitools.GRectRelative(0.8f, Colore), valis.vVector3.x, 0, 255, MenuStyle, MenuStyle2);
        Colore = guitools.GRectRelative(0.2f, 0.4f, 0.6f, 0.1f, arect);
        B = GUI.HorizontalSlider(guitools.GRectRelative(0.8f, Colore), valis.vVector3.y, 0, 255, MenuStyle, MenuStyle2);
        Colore = guitools.GRectRelative(0.2f, 0.5f, 0.6f, 0.1f, arect);
        C = GUI.HorizontalSlider(guitools.GRectRelative(0.8f, Colore), valis.vVector3.z, 0, 255, MenuStyle, MenuStyle2);

        Transform child = thesock.instance.transform.Find("light");
        child.GetComponent<Light>().color = guitools.RGB(valis.vVector3.x, valis.vVector3.y, valis.vVector3.z, 255);

        child.GetComponent<Light>().enabled = valis.vbool;
        if (!valis.vbool)
        {
            thesock.instance.GetComponent<MeshRenderer>().materials[0].SetColor("_EmissionColor", guitools.RGB(0, 0, 0, 255));
        }


        valis.vVector3 = new Vector3(A, B, C);

    }
Пример #2
0
    void DrawAirGen01Menu(Rect arect, socketIG thesock, sprop.elec elec, sprop.vals valis)
    {
        GUIStyle MenuStyle = new GUIStyle(prettyskin.label);

        guitools.SetStyle(MenuStyle, guitools.RGB(255, 255, 255, 255), Color.black, (int)Math.Round(18f));

        GUI.Label(arect, "", MenuStyle);

        if (GUI.Button(guitools.GRectRelative(0, 0.9f, 1, 0.1f, arect), "OK", MenuStyle))
        {
            isinteracting = false;
            NetworkerPhoton.RPCSetInteract(thesock.location, false, fserial.saveasstring(thesock.asock.props));
            Cursor.visible = false;
            Cursor.lockState = CursorLockMode.Locked;
            cam.controlmouse = true;
            cam.controlkeys = true;
        }

        Rect OffOnn = guitools.GRectRelative(0, 0.1f, 1, 0.1f, arect);

        if (valis.vbool)
        {
            GUI.Label(guitools.GRectRelative(0, 0, 1, 0.1f, arect), "STATUS : ONLINE", MenuStyle);
            valis.vbool = GUI.Toggle(guitools.GRectRelative(0.8f, (guitools.GRectRelative(0, 0, 1, 1, OffOnn))), valis.vbool, "TURN OFF", MenuStyle);
        }
        else
        {
            GUI.Label(guitools.GRectRelative(0, 0, 1, 0.1f, arect), "STATUS : OFFLINE", MenuStyle);
            valis.vbool = GUI.Toggle(guitools.GRectRelative(0.8f, (guitools.GRectRelative(0, 0, 1, 1, OffOnn))), valis.vbool, "TURN ON", MenuStyle);
        }

        Rect PowerEmmission = guitools.GRectRelative(0, 0.2f, 1, 0.1f, arect);
        GUI.Label(PowerEmmission, "sAIR PRODUCTION: " + Mathf.RoundToInt(valis.vfloat * 100) + "%", MenuStyle);
        PowerEmmission = guitools.GRectRelative(0, 0.3f, 1, 0.1f, arect);
        guitools.SetStyle(MenuStyle, guitools.RGB(200, 200, 200, 255), Color.black, (int)Math.Round(18f));
        GUIStyle MenuStyle2 = new GUIStyle(prettyskin.label);
        guitools.SetStyle(MenuStyle2, guitools.RGB(150, 150, 150, 255), Color.black, (int)Math.Round(18f));
        valis.vfloat = GUI.HorizontalSlider(guitools.GRectRelative(0.8f, PowerEmmission), valis.vfloat, 0, 1, MenuStyle, MenuStyle2);

    }
Пример #3
0
    void DrawElecMenu(Rect arect, socketIG thesock, sprop.elec elec)
    {
        GUIStyle MenuStyle = new GUIStyle(prettyskin.label);

        guitools.SetStyle(MenuStyle, guitools.RGB(255, 255, 255, 255), Color.black, (int)Math.Round(18f));
        GUI.Label(arect, "", MenuStyle);

        List<string> alist = new List<string>();
        alist.Add("Max Power: " + elec.maxpower+ " EU/s");
        alist.Add("Max Power Output: " + elec.energyoutput + " EU/s");
        alist.Add("Power Intake: " + elec.intake + " EU/s");
        alist.Add("Power Usage: " + elec.energyuse + " EU/s");
        alist.Add("Buffer: " + Math.Round(thesock.asock.getelec.buffer) + " EU");
        alist.Add("Max Buffer: " + elec.maxbuffer + " EU");
        alist.Add("Efficiency: " + elec.loss*100 + "%");

        guitools.TextureStyle(MenuStyle, Tsquareh);

        for (int k = -2; k < alist.Count; k++)
        {
            if (k != -2)
            {
                if (k == -1)
                {
                    Rect newrect = guitools.GRectRelative(0, 0, 1, 2 / (alist.Count + 2f), arect);
                    guitools.SetStyle(MenuStyle, guitools.RGB(0, 0, 0, 255), Color.black, (int)Math.Round(10f));
                    GUI.Label(guitools.GRectRelative(0, 0, 1, 1, newrect), "Electric Panel", MenuStyle);
                }
                else
                {
                    guitools.SetStyle(MenuStyle, guitools.RGB(0, 0, 0, 255), Color.black, (int)Math.Round(7f));
                    Rect newrect = guitools.GRectRelative(0, (2 + k) * 1 / (alist.Count + 2f), 1, 1 / (alist.Count + 2f), arect);
                    GUI.Label(guitools.GRectRelative(0, 0, 0.2f, 1, newrect), k + ".", MenuStyle);
                    MenuStyle.alignment = TextAnchor.MiddleLeft;
                    GUI.Label(guitools.GRectRelative(0.2f, 0, 0.8f, 1, newrect), alist[k], MenuStyle);
                    MenuStyle.alignment = TextAnchor.MiddleCenter;
                }
            }
        }
    }
Пример #4
0
    void DrawMechMenu(Rect arect, socketIG thesock, sprop.mech mech)
    {
        GUIStyle MenuStyle = new GUIStyle(prettyskin.label);

        guitools.SetStyle(MenuStyle, guitools.RGB(255, 255, 255, 255), Color.black, (int)Math.Round(18f));
        GUI.Label(arect, "", MenuStyle);

        List<string> alist = new List<string>();
        alist.Add("ONLINE: " + mech.powered );
        alist.Add("Power Intake: " + mech.load + " MU");
        alist.Add("Power Output: " + mech.production + " MU");
        alist.Add("Max Power Output: " + mech.maxprod + " MU");
        alist.Add("Conversion Rate: " + mech.convratio * 100 + "%");

        guitools.TextureStyle(MenuStyle, Tsquareh);

        for (int k = -2; k < alist.Count; k++)
        {
            if (k != -2)
            {
                if (k == -1)
                {
                    Rect newrect = guitools.GRectRelative(0, 0, 1, 2 / (alist.Count + 2f), arect);
                    guitools.SetStyle(MenuStyle, guitools.RGB(0, 0, 0, 255), Color.black, (int)Math.Round(10f));
                    GUI.Label(guitools.GRectRelative(0, 0, 1, 1, newrect), "Mechanical Panel", MenuStyle);
                }
                else
                {
                    guitools.SetStyle(MenuStyle, guitools.RGB(0, 0, 0, 255), Color.black, (int)Math.Round(7f));
                    Rect newrect = guitools.GRectRelative(0, (2 + k) * 1 / (alist.Count + 2f), 1, 1 / (alist.Count + 2f), arect);
                    GUI.Label(guitools.GRectRelative(0, 0, 0.2f, 1, newrect), k + ".", MenuStyle);
                    MenuStyle.alignment = TextAnchor.MiddleLeft;
                    GUI.Label(guitools.GRectRelative(0.2f, 0, 0.8f, 1, newrect), alist[k], MenuStyle);
                    MenuStyle.alignment = TextAnchor.MiddleCenter;
                }
            }
        }
    }
Пример #5
0
    public static sprop copysprop(sprop aprop)
    {

        if (aprop is wire)
        {
            sprop.wire returner2 = new sprop.wire();
            returner2.name = aprop.name;
            return returner2;
        }
        if (aprop is interact)
        {
            sprop.interact gelec = aprop as interact;
            sprop.interact returner2 = new sprop.interact();
            returner2.name = gelec.name;
            returner2.abool = gelec.abool;
            return returner2;
        }
        if (aprop is oxgen)
        {
            sprop.oxgen gelec = aprop as oxgen;
            sprop.oxgen returner2 = new sprop.oxgen();
            returner2.name = aprop.name;
            returner2.range = gelec.range;
            return returner2;
        }
        if (aprop is elec)
        {
            sprop.elec gelec = aprop as elec;
            sprop.elec returner2 = new sprop.elec(0);
            returner2.name = aprop.name;
            returner2.maxpower = gelec.maxpower;
            returner2.energyoutput = gelec.energyoutput;
            returner2.energyuse = gelec.energyuse;
            returner2.maxbuffer = gelec.maxbuffer;
            returner2.buffer = gelec.buffer;
            returner2.intake = gelec.intake;
            returner2.loss = gelec.loss;
            for (int k = 0; k < 6; k++)
            {
                returner2.connected[k] = gelec.connected[k];
            }
            foreach (int anint in gelec.connecteddef)
            {
                returner2.connecteddef.Add(anint);
            }
            return returner2;
        }
        if (aprop is mech)
        {
            sprop.mech gelec = aprop as mech;
            sprop.mech returner2 = new sprop.mech(gelec.load, gelec.production,gelec.maxprod,gelec.convratio);
            returner2.name = aprop.name;
            for (int k = 0; k < 6; k++)
            {
                returner2.connected[k] = gelec.connected[k];
            }
            foreach (int anint in gelec.connecteddef)
            {
                returner2.connecteddef.Add(anint);
            }
            return returner2;
        }
        if (aprop is gun)
        {
            sprop.gun gelec = aprop as gun;
            sprop.gun returner2 = new sprop.gun();
            returner2.name = aprop.name;
            returner2.range = gelec.range;
            returner2.stamp = gelec.stamp;
            returner2.reset = gelec.reset;
            return returner2;
        }
        if (aprop is vals)
        {
            vals gvals = aprop as vals;
            vals returner2 = new vals();
            returner2.name = aprop.name;
            returner2.vstring = gvals.vstring;
            returner2.vfloat = gvals.vfloat;
            returner2.vint = gvals.vint;
            returner2.vVector3 = gvals.vVector3;
            returner2.vbool = gvals.vbool;
            return returner2;
        }
        if (aprop is invs)
        {
            invs ginvs = aprop as invs;
            invs returner2 = new invs(ginvs.aninv.inv.Length);
            for (int k = 0; k < ginvs.aninv.inv.Length; k++)
            {
                returner2.aninv.inv[k] = new Inventory.InvItem();
            }
            returner2.aninv.protectsuction = ginvs.aninv.protectsuction;
            return returner2;
        }
        if (aprop is rawinvs)
        {
            rawinvs ginvs = aprop as rawinvs;
            rawinvs returner2 = new rawinvs(ginvs.aninv.maxmass);
            returner2.aninv.protectsuction = ginvs.aninv.protectsuction;
            foreach (RawInv.rawlibitem anint in ginvs.aninv.inv)
            {
                returner2.aninv.add(anint.id, anint.kg);
            }

            return returner2;
        }
        if (aprop is drops)
        {
            drops ginvs = aprop as drops;
            drops returner2 = new drops();
            returner2.aninv.protectsuction = ginvs.aninv.protectsuction;
            foreach (RawInv.rawlibitem anint in ginvs.aninv.inv)
            {
                returner2.aninv.add(anint.id, anint.kg);
            }

            return returner2;
        }
        if (aprop is craft)
        {
            craft ginvs = aprop as craft;
            craft returner2 = new craft(ginvs.RecipeList);

            returner2.vint = ginvs.vint;
            returner2.vfloat = ginvs.vfloat;
            returner2.vfloat2 = ginvs.vfloat2;

            foreach (int anint in ginvs.autos)
            {
                returner2.autos.Add(anint);
            }


            foreach (RawInv.rawlibitem anint in ginvs.ResultRaw)
            {
                returner2.ResultRaw.Add(new RawInv.rawlibitem(anint.id, anint.kg));
            }
            foreach (Inventory.InvItem anint in ginvs.Result)
            {
                returner2.Result.Add(new Inventory.InvItem(anint.socket,anint.num));
            }

            return returner2;
        }
        
        
        sprop returner = new sprop();

        returner.name = aprop.name;

        return returner;
    }