Beispiel #1
0
        // Function from file: subsystem.dm
        public int update_user_uis(dynamic user = null, Wires src_object = null, string ui_key = null)
        {
            int  update_count = 0;
            Tgui ui           = null;


            if (user.open_uis == null || !(user.open_uis is ByTable) || this.open_uis.len == 0)
            {
                return(0);
            }
            update_count = 0;

            foreach (dynamic _a in Lang13.Enumerate(user.open_uis, typeof(Tgui)))
            {
                ui = _a;


                if ((src_object == null || !(src_object == null) && ui.src_object == src_object) && (ui_key == null || !(ui_key == null) && ui.ui_key == ui_key))
                {
                    ui.process();
                    update_count++;
                }
            }
            return(update_count);
        }
Beispiel #2
0
        // Function from file: subsystem.dm
        public bool on_transfer(dynamic source = null, dynamic target = null)
        {
            Tgui ui = null;


            if (!Lang13.Bool(source) || source.open_uis == null || !(source.open_uis is ByTable) || this.open_uis.len == 0)
            {
                return(false);
            }

            if (target.open_uis == null || !(target.open_uis is ByTable))
            {
                target.open_uis = new ByTable();
            }

            foreach (dynamic _a in Lang13.Enumerate(source.open_uis, typeof(Tgui)))
            {
                ui = _a;

                ui.user = target;
                target.open_uis.Add(ui);
            }
            source.open_uis.Cut();
            return(true);
        }
Beispiel #3
0
        // Function from file: atmos_alert.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic zone = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "clear":
                zone = _params["zone"];

                if (this.priority_alarms.Contains(zone))
                {
                    Task13.User.WriteMsg("Priority alarm for " + zone + " cleared.");
                    this.priority_alarms.Remove(zone);
                    _default = GlobalVars.TRUE;
                }

                if (this.minor_alarms.Contains(zone))
                {
                    Task13.User.WriteMsg("Minor alarm for " + zone + " cleared.");
                    this.minor_alarms.Remove(zone);
                    _default = GlobalVars.TRUE;
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Beispiel #4
0
        // Function from file: subsystem.dm
        public Tgui get_open_ui(dynamic user = null, Game_Data src_object = null, string ui_key = null)
        {
            string src_object_key = null;
            Tgui   ui             = null;

            src_object_key = new Txt().Ref(src_object).ToString();

            if (this.open_uis[src_object_key] == null || !(this.open_uis[src_object_key] is ByTable))
            {
                return(null);
            }
            else if (this.open_uis[src_object_key][ui_key] == null || !(this.open_uis[src_object_key][ui_key] is ByTable))
            {
                return(null);
            }

            foreach (dynamic _a in Lang13.Enumerate(this.open_uis[src_object_key][ui_key], typeof(Tgui)))
            {
                ui = _a;


                if (ui.user == user)
                {
                    return(ui);
                }
            }
            return(null);
        }
Beispiel #5
0
        // Function from file: subsystem.dm
        public bool on_close(Tgui ui = null)
        {
            string  src_object_key = null;
            dynamic uis            = null;

            src_object_key = new Txt().Ref(ui.src_object).ToString();

            if (this.open_uis[src_object_key] == null || !(this.open_uis[src_object_key] is ByTable))
            {
                return(false);
            }
            else if (this.open_uis[src_object_key][ui.ui_key] == null || !(this.open_uis[src_object_key][ui.ui_key] is ByTable))
            {
                return(false);
            }
            this.processing_uis.Remove(ui);

            if (Lang13.Bool(ui.user))
            {
                ui.user.open_uis.Remove(ui);
            }
            uis = this.open_uis[src_object_key][ui.ui_key];
            uis.Remove(ui);
            return(true);
        }
Beispiel #6
0
        // Function from file: scrubber.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on  = !Lang13.Bool(this.on) ?1:0;
                _default = GlobalVars.TRUE;
                break;

            case "eject":

                if (Lang13.Bool(this.holding))
                {
                    this.holding.loc = GlobalFuncs.get_turf(this);
                    this.holding     = null;
                    _default         = GlobalVars.TRUE;
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Beispiel #7
0
        // Function from file: subsystem.dm
        public int update_uis(Game_Data src_object = null)
        {
            string  src_object_key = null;
            int     update_count   = 0;
            dynamic ui_key         = null;
            Tgui    ui             = null;

            src_object_key = new Txt().Ref(src_object).ToString();

            if (this.open_uis[src_object_key] == null || !(this.open_uis[src_object_key] is ByTable))
            {
                return(0);
            }
            update_count = 0;

            foreach (dynamic _b in Lang13.Enumerate(this.open_uis[src_object_key]))
            {
                ui_key = _b;


                foreach (dynamic _a in Lang13.Enumerate(this.open_uis[src_object_key][ui_key], typeof(Tgui)))
                {
                    ui = _a;


                    if (ui != null && ui.src_object != null && Lang13.Bool(ui.user) && ui.src_object.ui_host() != null)
                    {
                        ui.process();
                        update_count++;
                    }
                }
            }
            return(update_count);
        }
Beispiel #8
0
 // Function from file: external.dm
 public virtual int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
 {
     if (!(ui != null) || ui.status != 2)
     {
         return(1);
     }
     return(null);
 }
Beispiel #9
0
        // Function from file: external.dm
        public virtual int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.default_state;

            return(-1);
        }
        // Function from file: chem_heater.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic target = null;
            double? adjust = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on  = !Lang13.Bool(this.on) ?1:0;
                _default = GlobalVars.TRUE;
                break;

            case "temperature":
                target = _params["target"];
                adjust = String13.ParseNumber(_params["adjust"]);

                if (target == "input")
                {
                    target = Interface13.Input("New target temperature:", this.name, this.target_temperature, null, null, InputType.Num | InputType.Null);

                    if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (Lang13.Bool(adjust))
                {
                    target = (this.target_temperature ?? 0) + (adjust ?? 0);
                }
                else if (String13.ParseNumber(target) != null)
                {
                    target   = String13.ParseNumber(target);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_temperature = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(target), 1000));
                }
                break;

            case "eject":
                this.on = GlobalVars.FALSE;
                this.eject_beaker();
                _default = GlobalVars.TRUE;
                break;
            }
            return(_default);
        }
Beispiel #11
0
        // Function from file: thermomachine.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic target = null;
            double? adjust = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on        = !this.on;
                this.use_power = (this.on ?1:0) + 1;
                this.investigate_log("was turned " + (this.on ? "on" : "off") + " by " + GlobalFuncs.key_name(Task13.User), "atmos");
                _default = GlobalVars.TRUE;
                break;

            case "target":
                target = _params["target"];
                adjust = String13.ParseNumber(_params["adjust"]);

                if (target == "input")
                {
                    target = Interface13.Input("Set new target (" + this.min_temperature + "-" + this.max_temperature + " K):", this.name, this.target_temperature, null, null, InputType.Num | InputType.Null);

                    if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (Lang13.Bool(adjust))
                {
                    target   = this.target_temperature + (adjust ?? 0);
                    _default = GlobalVars.TRUE;
                }
                else if (String13.ParseNumber(target) != null)
                {
                    target   = String13.ParseNumber(target);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.target_temperature = Num13.MaxInt(((int)(this.min_temperature)), Num13.MinInt(Convert.ToInt32(target), Convert.ToInt32(this.max_temperature)));
                    this.investigate_log("was set to " + this.target_temperature + " K by " + GlobalFuncs.key_name(Task13.User), "atmos");
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Beispiel #12
0
        // Function from file: cryo.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":

                if (Lang13.Bool(this.on))
                {
                    this.on = GlobalVars.FALSE;
                }
                else if (!Lang13.Bool(this.state_open))
                {
                    this.on = GlobalVars.TRUE;
                }
                _default = GlobalVars.TRUE;
                break;

            case "door":

                if (Lang13.Bool(this.state_open))
                {
                    this.close_machine();
                }
                else
                {
                    this.open_machine();
                }
                _default = GlobalVars.TRUE;
                break;

            case "autoeject":
                this.autoeject = !this.autoeject;
                _default       = GlobalVars.TRUE;
                break;

            case "ejectbeaker":

                if (Lang13.Bool(this.beaker))
                {
                    this.beaker.loc = this.loc;
                    this.beaker     = null;
                    _default        = GlobalVars.TRUE;
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Beispiel #13
0
        // Function from file: tanks.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic pressure = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "pressure":
                pressure = _params["pressure"];

                if (pressure == "reset")
                {
                    pressure = 16;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "min")
                {
                    pressure = 0;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "max")
                {
                    pressure = 303.9749755859375;
                    _default = GlobalVars.TRUE;
                }
                else if (pressure == "input")
                {
                    pressure = Interface13.Input("New release pressure (" + 0 + "-" + 303.9749755859375 + " kPa):", this.name, this.distribute_pressure, null, null, InputType.Num | InputType.Null);

                    if (!(pressure == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (String13.ParseNumber(pressure) != null)
                {
                    pressure = String13.ParseNumber(pressure);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.distribute_pressure = Num13.MaxInt(0, Num13.MinInt(Num13.Floor(Convert.ToDouble(pressure)), ((int)(303.9749755859375))));
                }
                break;
            }
            return(_default);
        }
        // Function from file: aicard.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            string confirm = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "wipe":
                confirm = Interface13.Alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", this.name, "Yes", "No");

                if (confirm == "Yes" && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                {
                    this.flush = GlobalVars.TRUE;

                    if (this.AI != null && this.AI.loc == this)
                    {
                        ((dynamic)this.AI).suiciding = GlobalVars.TRUE;
                        ((dynamic)this.AI).WriteMsg("Your core files are being wiped!");

                        while (Convert.ToInt32(((dynamic)this.AI).stat) != 2)
                        {
                            ((dynamic)this.AI).adjustOxyLoss(2);
                            ((dynamic)this.AI).updatehealth();
                            Task13.Sleep(10);
                        }
                        this.flush = GlobalVars.FALSE;
                    }
                }
                _default = GlobalVars.TRUE;
                break;

            case "wireless":
                ((dynamic)this.AI).control_disabled = !Lang13.Bool(((dynamic)this.AI).control_disabled);
                ((dynamic)this.AI).WriteMsg("" + this + "'s wireless port has been " + (Lang13.Bool(((dynamic)this.AI).control_disabled) ? "disabled" : "enabled") + "!");
                _default = GlobalVars.TRUE;
                break;

            case "radio":
                ((dynamic)this.AI).radio_enabled = !Lang13.Bool(((dynamic)this.AI).radio_enabled);
                ((dynamic)this.AI).WriteMsg("Your Subspace Transceiver has been " + (Lang13.Bool(((dynamic)this.AI).radio_enabled) ? "enabled" : "disabled") + "!");
                _default = GlobalVars.TRUE;
                break;
            }
            this.update_icon();
            return(_default);
        }
        // Function from file: volume_pump.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic rate = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "power":
                this.on = !Lang13.Bool(this.on) ?1:0;
                this.investigate_log("was turned " + (Lang13.Bool(this.on) ? "on" : "off") + " by " + GlobalFuncs.key_name(Task13.User), "atmos");
                _default = GlobalVars.TRUE;
                break;

            case "rate":
                rate = _params["rate"];

                if (rate == "max")
                {
                    rate     = 200;
                    _default = GlobalVars.TRUE;
                }
                else if (rate == "input")
                {
                    rate = Interface13.Input("New transfer rate (0-" + 200 + " L/s):", this.name, this.transfer_rate, null, null, InputType.Num | InputType.Null);

                    if (!(rate == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                    {
                        _default = GlobalVars.TRUE;
                    }
                }
                else if (String13.ParseNumber(rate) != null)
                {
                    rate     = String13.ParseNumber(rate);
                    _default = GlobalVars.TRUE;
                }

                if (Lang13.Bool(_default))
                {
                    this.transfer_rate = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(rate), 200));
                    this.investigate_log("was set to " + this.transfer_rate + " L/s by " + GlobalFuncs.key_name(Task13.User), "atmos");
                }
                break;
            }
            this.update_icon();
            return(_default);
        }
Beispiel #16
0
        // Function from file: scrubber.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.physical_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "portable_scrubber", this.name, 420, 335, master_ui, state);
                ui.open();
            }
            return(0);
        }
Beispiel #17
0
        // Function from file: radio.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.inventory_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "radio", this.name, 370, this.channels.len * 22 + 220, master_ui, state);
                ui.open();
            }
            return(0);
        }
Beispiel #18
0
        // Function from file: airlock_electronics.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.hands_state;

            GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "airlock_electronics", this.name, 975, 420, master_ui, state);
                ui.open();
            }
            return(0);
        }
Beispiel #19
0
        // Function from file: mulebot.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.default_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "mulebot", this.name, 600, 375, master_ui, state);
                ui.open();
            }
            return(0);
        }
Beispiel #20
0
        // Function from file: wires.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "wires";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.physical_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "wires", "" + this.holder.name + " wires", 350, this.wires.len * 30 + 150, master_ui, state);
                ui.open();
            }
            return(0);
        }
        // Function from file: atmos_control.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            Signal  signal = null;
            dynamic target = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || !(this.radio_connection != null))
            {
                return(_default);
            }
            signal = new Signal();
            signal.transmission_method = 1;
            signal.source = this;
            signal.data   = new ByTable().Set("sigtype", "command");

            switch ((string)(action))
            {
            case "reconnect":
                this.reconnect(Task13.User);
                _default = GlobalVars.TRUE;
                break;

            case "input":
                signal.data.Add(new ByTable().Set("tag", this.input_tag).Set("power_toggle", GlobalVars.TRUE));
                _default = GlobalVars.TRUE;
                break;

            case "output":
                signal.data.Add(new ByTable().Set("tag", this.output_tag).Set("power_toggle", GlobalVars.TRUE));
                _default = GlobalVars.TRUE;
                break;

            case "pressure":
                target = Interface13.Input("New target pressure:", this.name, this.output_info["internal"], null, null, InputType.Num | InputType.Null);

                if (!(target == null) && !Lang13.Bool(base.ui_act(action, _params, ui, state)))
                {
                    target = Num13.MaxInt(0, Num13.MinInt(Convert.ToInt32(target), ((int)(5066.25))));
                    signal.data.Add(new ByTable().Set("tag", this.output_tag).Set("set_internal_pressure", target));
                    _default = GlobalVars.TRUE;
                }
                break;
            }
            this.radio_connection.post_signal(this, signal, GlobalVars.RADIO_ATMOSIA);
            return(_default);
        }
Beispiel #22
0
        // Function from file: Sleeper.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            string chem = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "door":

                if (Lang13.Bool(this.state_open))
                {
                    this.close_machine();
                }
                else
                {
                    this.open_machine();
                }
                _default = GlobalVars.TRUE;
                break;

            case "inject":
                chem = _params["chem"];

                if (!this.is_operational() || !Lang13.Bool(this.occupant))
                {
                    return(_default);
                }

                if (Convert.ToDouble(this.occupant.health) < Convert.ToDouble(this.min_health) && chem != "epinephrine")
                {
                    return(_default);
                }

                if (Lang13.Bool(this.inject_chem(chem)))
                {
                    _default = GlobalVars.TRUE;
                }
                break;
            }
            return(_default);
        }
        // Function from file: uplink.dm
        public override int ui_interact(dynamic user = null, string ui_key = null, Tgui ui = null, bool?force_open = null, Tgui master_ui = null, UiState state = null)
        {
            ui_key     = ui_key ?? "main";
            force_open = force_open ?? false;
            state      = state ?? GlobalVars.inventory_state;

            ui = GlobalVars.SStgui.try_update_ui(user, this, ui_key, ui, force_open);

            if (!(ui != null))
            {
                ui = new Tgui(user, this, ui_key, "uplink", this.name, 450, 750, master_ui, state);
                ui.set_autoupdate(GlobalVars.FALSE);
                ui.set_style("syndicate");
                ui.open();
            }
            return(0);
        }
Beispiel #24
0
        // Function from file: mulebot.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || this.locked && !Task13.User.has_unlimited_silicon_privilege)
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "lock":

                if (Task13.User.has_unlimited_silicon_privilege)
                {
                    this.locked = !this.locked;
                    _default    = GlobalVars.TRUE;
                }
                break;

            case "power":

                if (Lang13.Bool(this.on))
                {
                    this.turn_off();
                }
                else if (Lang13.Bool(this.cell) && !this.open)
                {
                    if (!this.turn_on())
                    {
                        Task13.User.WriteMsg("<span class='warning'>You can't switch on " + this + "!</span>");
                        return(_default);
                    }
                }
                _default = GlobalVars.TRUE;
                break;

            default:
                this.bot_control(action, Task13.User);
                _default = GlobalVars.TRUE;
                break;
            }
            return(_default);
        }
        // Function from file: uplink.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic item          = null;
            ByTable uplink_items  = null;
            ByTable buyable_items = null;
            dynamic category      = null;
            dynamic I             = null;


            if (!Lang13.Bool(this.active))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "buy":
                item          = _params["item"];
                uplink_items  = GlobalFuncs.get_uplink_items(this.gamemode);
                buyable_items = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(uplink_items))
                {
                    category = _a;

                    buyable_items.Add(uplink_items[category]);
                }

                if (buyable_items.Contains(item))
                {
                    I = buyable_items[item];
                    I.buy(Task13.User, this);
                    _default = GlobalVars.TRUE;
                }
                break;

            case "lock":
                this.active = GlobalVars.FALSE;
                GlobalVars.SStgui.close_uis(this);
                break;
            }
            return(_default);
        }
Beispiel #26
0
        // Function from file: tgui.dm
        public void close(  )
        {
            Tgui child = null;

            Interface13.Browse(this.user, null, "window=" + this.window_id);
            GlobalVars.SStgui.on_close(this);

            foreach (dynamic _a in Lang13.Enumerate(this.children, typeof(Tgui)))
            {
                child = _a;

                child.close();
            }
            this.children.Cut();
            this.state     = null;
            this.master_ui = null;
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: keycard authentication.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)) || this.waiting || !this.allowed(Task13.User))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "red_alert":

                if (!(this.event_source != null))
                {
                    this.sendEvent("Red Alert");
                    _default = GlobalVars.TRUE;
                }
                break;

            case "emergency_maint":

                if (!(this.event_source != null))
                {
                    this.sendEvent("Emergency Maintenance Access");
                    _default = GlobalVars.TRUE;
                }
                break;

            case "auth_swipe":

                if (this.event_source != null)
                {
                    this.event_source.trigger_event(Task13.User);
                    this.event_source = null;
                    _default          = GlobalVars.TRUE;
                }
                break;
            }
            return(_default);
        }
Beispiel #28
0
        // Function from file: airlock_electronics.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            double?access = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "clear":
                this.accesses   = new ByTable();
                this.one_access = false;
                _default        = GlobalVars.TRUE;
                break;

            case "one_access":
                this.one_access = !this.one_access;
                _default        = GlobalVars.TRUE;
                break;

            case "set":
                access = String13.ParseNumber(_params["access"]);

                if (!Lang13.Bool(this.accesses.Contains(access)))
                {
                    this.accesses += access;
                }
                else
                {
                    this.accesses -= access;
                }
                _default = GlobalVars.TRUE;
                break;
            }
            return(_default);
        }
Beispiel #29
0
        // Function from file: subsystem.dm
        public void on_open(Tgui ui = null)
        {
            string  src_object_key = null;
            dynamic uis            = null;

            src_object_key = new Txt().Ref(ui.src_object).ToString();

            if (this.open_uis[src_object_key] == null || !(this.open_uis[src_object_key] is ByTable))
            {
                this.open_uis[src_object_key] = new ByTable().Set(ui.ui_key, new ByTable());
            }
            else if (this.open_uis[src_object_key][ui.ui_key] == null || !(this.open_uis[src_object_key][ui.ui_key] is ByTable))
            {
                this.open_uis[src_object_key][ui.ui_key] = new ByTable();
            }
            ui.user.open_uis |= ui;
            uis  = this.open_uis[src_object_key][ui.ui_key];
            uis |= ui;
            this.processing_uis.Or(ui);
            return;
        }
Beispiel #30
0
        // Function from file: tank_dispenser.dm
        public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null)
        {
            int?_default = null;

            dynamic tank  = null;
            dynamic tank2 = null;


            if (Lang13.Bool(base.ui_act(action, _params, ui, state)))
            {
                return(_default);
            }

            switch ((string)(action))
            {
            case "plasma":
                tank = Lang13.FindIn(typeof(Obj_Item_Weapon_Tank_Internals_Plasma), this);

                if (Lang13.Bool(tank))
                {
                    Task13.User.put_in_hands(tank);
                    this.plasmatanks--;
                }
                _default = GlobalVars.TRUE;
                break;

            case "oxygen":
                tank2 = Lang13.FindIn(typeof(Obj_Item_Weapon_Tank_Internals_Oxygen), this);

                if (Lang13.Bool(tank2))
                {
                    Task13.User.put_in_hands(tank2);
                    this.oxygentanks--;
                }
                _default = GlobalVars.TRUE;
                break;
            }
            this.update_icon();
            return(_default);
        }