Esempio n. 1
0
        // Function from file: html_interface.dm
        public virtual dynamic createWindow(dynamic hclient = null)
        {
            ByTable _params = null;

            Interface13.WindowClone(hclient.client, "window", new Txt("browser_").Ref(this).ToString());
            _params = new ByTable()
                      .Set("size", "" + this.width + "x" + this.height)
                      .Set("statusbar", "false")
                      .Set("on-close", new Txt("byond://?src=").Ref(this).str("&html_interface_action=onclose").ToString())
            ;

            if (Lang13.Bool(hclient.client.hi_last_pos))
            {
                _params["pos"] = "" + hclient.client.hi_last_pos;
            }
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).ToString(), String13.MakeUrlParams(_params));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".browser").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                   .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                   .Set("type", "browser")
                                                                                                                                   .Set("pos", "0,0")
                                                                                                                                   .Set("size", "" + this.width + "x" + this.height)
                                                                                                                                   .Set("anchor1", "0,0")
                                                                                                                                   .Set("anchor2", "100,100")
                                                                                                                                   .Set("use-title", "true")
                                                                                                                                   .Set("auto-format", "false")
                                                                                                                                   ));
            return(null);
        }
Esempio n. 2
0
        // Function from file: tgui.dm
        public void open(  )
        {
            string window_size = null;
            bool   debugable   = false;


            if (!Lang13.Bool(this.user.client))
            {
                return;
            }
            this.update_status(false);

            if (this.status < 1)
            {
                return;
            }

            if (!(this.initial_data != null))
            {
                this.set_initial_data(this.src_object.ui_data(this.user));
            }
            window_size = "";

            if (Lang13.Bool(this.width) && Lang13.Bool(this.height))
            {
                window_size = "size=" + this.width + "x" + this.height + ";";
            }
            debugable = GlobalFuncs.check_rights_for(this.user.client, 32);
            Interface13.Browse(this.user, this.get_html(debugable), "window=" + this.window_id + ";" + window_size + String13.MakeUrlParams(this.window_options));
            Interface13.WindowSet(this.user, this.window_id, new Txt("on-close=\"uiclose ").Ref(this).str("\"").ToString());
            GlobalVars.SStgui.on_open(this);
            return;
        }
Esempio n. 3
0
        // Function from file: nanotrasen.dm
        public void specificRenderTitle(dynamic hclient = null, int?ignore_cache = null)
        {
            ignore_cache = ignore_cache ?? GlobalVars.FALSE;

            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitle").ToString(), String13.MakeUrlParams(new ByTable().Set("text", "" + this.title)));
            return;
        }
Esempio n. 4
0
        // Function from file: html_interface.dm
        public void hide(dynamic hclient = null)
        {
            hclient = this.getClient(hclient);

            if (hclient is HtmlInterfaceClient)
            {
                if (this.clients != null)
                {
                    this.clients.Remove(hclient.client);

                    if (!(this.clients.len != 0))
                    {
                        this.clients = null;
                    }
                }
                hclient.client.hi_last_pos = Interface13.WindowGet(hclient.client, new Txt("browser_").Ref(this).ToString(), "pos");
                Interface13.WindowShow(hclient.client, new Txt("browser_").Ref(this).ToString(), GlobalVars.FALSE);
                Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).ToString(), "parent=none");

                if (Lang13.HasCall(this.v_ref, "hiOnHide"))
                {
                    Lang13.Call(Lang13.BindFunc(this.v_ref, "hiOnHide"), hclient);
                }
            }
            return;
        }
Esempio n. 5
0
        // Function from file: browser.dm
        public override dynamic open(bool?use_onclose = null)
        {
            dynamic _default = null;

            string focusedwindow = null;
            double i             = 0;

            this.opentime = Game13.time;

            if (this.stealfocus == true)
            {
                _default = base.open(true);
            }
            else
            {
                focusedwindow = Interface13.WindowGet(this.user, null, "focus");
                _default      = base.open(true);

                foreach (dynamic _a in Lang13.IterateRange(1, 10))
                {
                    i = _a;


                    if (Lang13.Bool(this.user) && Interface13.WindowExists(this.user, this.window_id))
                    {
                        if (Lang13.Bool(focusedwindow))
                        {
                            Interface13.WindowSet(this.user, focusedwindow, "focus=true");
                        }
                        else
                        {
                            Interface13.WindowSet(this.user, "mapwindow", "focus=true");
                        }
                        break;
                    }
                }
            }

            if (Lang13.Bool(this.timeout))
            {
                Task13.Schedule(this.timeout ?? 0, (Task13.Closure)(() => {
                    this.close();
                    return;
                }));
            }
            return(_default);
        }
Esempio n. 6
0
        // Function from file: tgstation.dme
        public void setEyeColor(string color = null, dynamic hclient = null)
        {
            string resource = null;

            hclient = this.getClient(hclient);

            if (hclient is HtmlInterfaceClient)
            {
                switch ((string)(color))
                {
                case "green":
                    resource = "uiEyeGreen.png";
                    break;

                case "orange":
                    resource = "uiEyeOrange.png";
                    break;

                case "red":
                    resource = "uiEyeRed.png";
                    break;

                default:
                    Task13.Crash("Invalid color: " + color);
                    break;
                }

                if (((HtmlInterfaceClient)hclient).getExtraVar("eye_color") != color)
                {
                    ((HtmlInterfaceClient)hclient).putExtraVar("eye_color", color);
                    Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleEye").ToString(), String13.MakeUrlParams(new ByTable().Set("image", "" + resource)));
                }
            }
            else
            {
                GlobalFuncs.warning("" + "Invalid object passed to /datum/html_interface/nanotrasen/proc/setEyeColor" + " in " + "tgstation.dme" + " at line " + 1078 + " src: " + this + " usr: "******".");
            }
            return;
        }
Esempio n. 7
0
        // Function from file: nanotrasen.dm
        public override dynamic createWindow(dynamic hclient = null)
        {
            dynamic _default = null;

            _default = base.createWindow((object)(hclient));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).ToString(), String13.MakeUrlParams(new ByTable().Set("titlebar", "false")));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".browser").ToString(), String13.MakeUrlParams(new ByTable().Set("pos", "0,35").Set("size", "" + this.width + "x" + ((this.height ?? 0) - 35))));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".topbg").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                 .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                 .Set("type", "label")
                                                                                                                                 .Set("pos", "0,0")
                                                                                                                                 .Set("size", "" + this.width + "x35")
                                                                                                                                 .Set("anchor1", "0,0")
                                                                                                                                 .Set("anchor2", "100,0")
                                                                                                                                 .Set("image", "" + "uiBgtop.png")
                                                                                                                                 .Set("image-mode", "tile")
                                                                                                                                 .Set("is-disabled", "true")
                                                                                                                                 ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleFluff").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                        .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                        .Set("type", "label")
                                                                                                                                        .Set("pos", "" + ((this.width ?? 0) - 42 - 4 - 24 - 4 - 24 - 4) + ",5")
                                                                                                                                        .Set("size", "42x24")
                                                                                                                                        .Set("anchor1", "100,0")
                                                                                                                                        .Set("anchor2", "100,0")
                                                                                                                                        .Set("image", "" + "uiTitleFluff.png")
                                                                                                                                        .Set("image-mode", "tile")
                                                                                                                                        .Set("is-disabled", "true")
                                                                                                                                        ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleEye").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                      .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                      .Set("type", "label")
                                                                                                                                      .Set("pos", "8,5")
                                                                                                                                      .Set("size", "42x24")
                                                                                                                                      .Set("anchor1", "0,0")
                                                                                                                                      .Set("anchor2", "0,0")
                                                                                                                                      .Set("image", "" + "uiEyeGreen.png")
                                                                                                                                      .Set("image-mode", "tile")
                                                                                                                                      .Set("is-disabled", "true")
                                                                                                                                      ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitle").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                   .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                   .Set("type", "label")
                                                                                                                                   .Set("is-transparent", "true")
                                                                                                                                   .Set("pos", "64,0")
                                                                                                                                   .Set("size", "580x35")
                                                                                                                                   .Set("anchor1", "0,0")
                                                                                                                                   .Set("anchor2", "100,0")
                                                                                                                                   .Set("is-disabled", "true")
                                                                                                                                   .Set("text", "" + this.title)
                                                                                                                                   .Set("align", "left")
                                                                                                                                   .Set("font-family", "verdana,Geneva,sans-serif")
                                                                                                                                   .Set("font-size", "12")
                                                                                                                                   .Set("text-color", "#E9C183")
                                                                                                                                   ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleMinimize").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                           .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                           .Set("type", "button")
                                                                                                                                           .Set("is-flat", "true")
                                                                                                                                           .Set("background-color", "#383838")
                                                                                                                                           .Set("text-color", "#FFFFFF")
                                                                                                                                           .Set("is-transparent", "true")
                                                                                                                                           .Set("pos", "" + ((this.width ?? 0) - 24 - 4 - 24 - 4) + ",5")
                                                                                                                                           .Set("size", "24x24")
                                                                                                                                           .Set("anchor1", "100,0")
                                                                                                                                           .Set("anchor2", "100,0")
                                                                                                                                           .Set("text", "-")
                                                                                                                                           .Set("font-family", "verdana,Geneva,sans-serif")
                                                                                                                                           .Set("font-size", "12")
                                                                                                                                           .Set("command", new Txt(".winset \"browser_").Ref(this).str(".can-resize=false;browser_").Ref(this).str(".is-minimized=true;browser_").Ref(this).str(".on-size=\".swinset \\\"browser_").Ref(this).str(".can-resize=true;browser_").Ref(this).str(".on-size=\\\"\"\"").ToString())
                                                                                                                                           ));
            Interface13.WindowSet(hclient.client, new Txt("browser_").Ref(this).str(".uiTitleClose").ToString(), String13.MakeUrlParams(new ByTable()
                                                                                                                                        .Set("parent", new Txt("browser_").Ref(this).ToString())
                                                                                                                                        .Set("type", "button")
                                                                                                                                        .Set("is-flat", "true")
                                                                                                                                        .Set("background-color", "#383838")
                                                                                                                                        .Set("text-color", "#FFFFFF")
                                                                                                                                        .Set("command", new Txt("byond://?src=").Ref(this).str(";html_interface_action=onclose").ToString())
                                                                                                                                        .Set("is-transparent", "true")
                                                                                                                                        .Set("pos", "" + ((this.width ?? 0) - 24 - 4) + ",5")
                                                                                                                                        .Set("size", "24x24")
                                                                                                                                        .Set("anchor1", "100,0")
                                                                                                                                        .Set("anchor2", "100,0")
                                                                                                                                        .Set("text", "X")
                                                                                                                                        .Set("font-family", "verdana,Geneva,sans-serif")
                                                                                                                                        .Set("font-size", "12")
                                                                                                                                        ));
            return(_default);
        }