コード例 #1
0
ファイル: Prep0.xaml.cs プロジェクト: nauhtnn/sQz
        private void LoadTxt()
        {
            Txt t = Txt.s;

            btnMMenu.Content = t._[(int)TxI.BACK_MMENU];
            txtDt.Text       = t._[(int)TxI.DATE_L];
            txtHm.Text       = t._[(int)TxI.TIME_L];
            txtIU.Text       = t._[(int)TxI.IUS];
            tbi1.Header      = t._[(int)TxI.PREP_NEE];
            tbi2.Header      = t._[(int)TxI.PREP_Q];
            txtId.Text       = t._[(int)TxI.NEEID_S];
            txtName.Text     = t._[(int)TxI.NEE_NAME];
            txtBirdate.Text  = t._[(int)TxI.BIRDATE];
            txtBirpl.Text    = t._[(int)TxI.BIRPL];
            txtRoom.Text     = t._[(int)TxI.ROOM];
            btnImp.Content   = t._[(int)TxI.PREP_IMP];
            btnDelQ.Content  = t._[(int)TxI.PREP_DEL_SEL];
            btnImpQ.Content  = t._[(int)TxI.PREP_IMP];
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(Txt.s._[(int)TxI.Q_DB], 0, QuestSheet.DBGetND(mSelQCat));
            tbiDBQ.Header = sb.ToString();
            sb.Clear();
            sb.AppendFormat(Txt.s._[(int)TxI.Q_TMP], 0, mTmpQS.CountD);
            tbiTmpQ.Header = sb.ToString();
        }
コード例 #2
0
        // Function from file: lib_machines.dm
        public override dynamic interact(dynamic user = null, bool?flag1 = null)
        {
            string  dat      = null;
            DBQuery query    = null;
            dynamic author   = null;
            dynamic title    = null;
            dynamic category = null;
            dynamic id       = null;
            Browser popup    = null;

            ((Mob)user).set_machine(this);
            dat = "";

            switch ((int)(this.screenstate))
            {
            case 0:
                dat += "<h2>Search Settings</h2><br>";
                dat += new Txt("<A href='?src=").Ref(this).str(";settitle=1'>Filter by Title: ").item(this.title).str("</A><BR>").ToString();
                dat += new Txt("<A href='?src=").Ref(this).str(";setcategory=1'>Filter by Category: ").item(this.category).str("</A><BR>").ToString();
                dat += new Txt("<A href='?src=").Ref(this).str(";setauthor=1'>Filter by Author: ").item(this.author).str("</A><BR>").ToString();
                dat += new Txt("<A href='?src=").Ref(this).str(";search=1'>[Start Search]</A><BR>").ToString();
                break;

            case 1:
                GlobalFuncs.establish_db_connection();

                if (!GlobalVars.dbcon.IsConnected())
                {
                    dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font><BR>";
                }
                else if (!Lang13.Bool(this.SQLquery))
                {
                    dat += "<font color=red><b>ERROR</b>: Malformed search request. Please contact your system administrator for assistance.</font><BR>";
                }
                else
                {
                    dat  += "<table>";
                    dat  += "<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td>SS<sup>13</sup>BN</td></tr>";
                    query = GlobalVars.dbcon.NewQuery(this.SQLquery);
                    query.Execute();

                    while (query.NextRow())
                    {
                        author   = query.item[1];
                        title    = query.item[2];
                        category = query.item[3];
                        id       = query.item[4];
                        dat     += "<tr><td>" + author + "</td><td>" + title + "</td><td>" + category + "</td><td>" + id + "</td></tr>";
                    }
                    dat += "</table><BR>";
                }
                dat += new Txt("<A href='?src=").Ref(this).str(";back=1'>[Go Back]</A><BR>").ToString();
                break;
            }
            popup = new Browser(user, "publiclibrary", this.name, 600, 400);
            popup.set_content(dat);
            popup.set_title_image(((Mob)user).browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
コード例 #3
0
        // Function from file: lib_machines.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string  dat   = null;
            Browser popup = null;

            Task13.User.set_machine(this);
            dat = "";

            if (this.cache != null)
            {
                dat += "<FONT color=#005500>Data stored in memory.</FONT><BR>";
            }
            else
            {
                dat += "No data stored in memory.<BR>";
            }
            dat += new Txt("<A href='?src=").Ref(this).str(";scan=1'>[Scan]</A>").ToString();

            if (this.cache != null)
            {
                dat += new Txt("       <A href='?src=").Ref(this).str(";clear=1'>[Clear Memory]</A><BR><BR><A href='?src=").Ref(this).str(";eject=1'>[Remove Book]</A>").ToString();
            }
            else
            {
                dat += "<BR>";
            }
            popup = new Browser(a, "scanner", this.name, 600, 400);
            popup.set_content(dat);
            popup.set_title_image(((Mob)a).browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
コード例 #4
0
        // Function from file: machine_interactions.dm
        public override string Options_Menu(  )
        {
            string dat = null;

            dat = new Txt("<br>Change Signal Frequency: <A href='?src=").Ref(this).str(";change_freq=1'>").item((Lang13.Bool(this.change_frequency) ? "YES (" + this.change_frequency + ")" : "NO")).str("</a>").ToString();
            return(dat);
        }
コード例 #5
0
        // Function from file: computer_funcs.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string  dat   = null;
            dynamic A     = null;
            dynamic A2    = null;
            Browser popup = null;

            ((Mob)a).set_machine(this);
            dat  = "<h3>Current Loaded Programs</h3>";
            dat += new Txt("<a href='?src=").Ref(this).str(";loadarea=").item(this.offline_program.type).str("'>Power Off</a><br>").ToString();

            foreach (dynamic _a in Lang13.Enumerate(this.program_cache))
            {
                A = _a;

                dat += new Txt("<a href='?src=").Ref(this).str(";loadarea=").item(A.type).str("'>").item(A.name).str("</a><br>").ToString();
            }

            if (Lang13.Bool(this.emagged) && this.emag_programs.len != 0)
            {
                dat += "<span class='warning'>SUPERVISOR ACCESS - SAFETY PROTOCOLS DISABLED - CAUTION: EMITTER ANOMALY</span><br>";

                foreach (dynamic _b in Lang13.Enumerate(this.emag_programs))
                {
                    A2 = _b;

                    dat += new Txt("<a href='?src=").Ref(this).str(";loadarea=").item(A2.type).str("'>").item(A2.name).str("</a><br>").ToString();
                }
            }
            popup = new Browser(a, "computer", this.name, 400, 500);
            popup.set_content(dat);
            popup.set_title_image(((Mob)a).browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
コード例 #6
0
        // Function from file: hologram.dm
        public override dynamic interact(dynamic user = null, bool?flag1 = null)
        {
            string  dat   = null;
            Browser popup = null;


            if (!(user is Mob_Living_Carbon_Human))
            {
                return(null);
            }

            if (Lang13.Bool(user.stat) || (this.stat & 3) != 0)
            {
                return(null);
            }
            ((Mob)user).set_machine(this);

            if (Lang13.Bool(this.temp))
            {
                dat = this.temp;
            }
            else
            {
                dat = new Txt("<A href='?src=").Ref(this).str(";AIrequest=1'>request an AI's presence.</A>").ToString();
            }
            popup = new Browser(user, "holopad", this.name, 300, 130);
            popup.set_content(dat);
            popup.set_title_image(((Mob)user).browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
コード例 #7
0
        // Function from file: grown.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            string msg = null;

            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);

            if (A is Obj_Item_Device_Analyzer_PlantAnalyzer)
            {
                msg = new Txt("<span class='info'>*---------*\n This is ").a(this).str("<span class='name'>").item().str("</span>\n").ToString();

                switch ((int)(this.plant_type))
                {
                case 0:
                    msg += "- Plant type: <i>Normal plant</i>\n";
                    break;

                case 1:
                    msg += "- Plant type: <i>Weed</i>.  Can grow in nutrient-poor soil.\n";
                    break;

                case 2:
                    msg += "- Plant type: <i>Mushroom</i>.  Can grow in dry soil.\n";
                    break;
                }
                msg += "- Potency: <i>" + this.potency + "</i>\n";
                msg += "- Yield: <i>" + this.yield + "</i>\n";
                msg += "- Maturation speed: <i>" + this.maturation + "</i>\n";
                msg += "- Production speed: <i>" + this.production + "</i>\n";
                msg += "- Endurance: <i>" + this.endurance + "</i>\n";
                msg += "*---------*</span>";
                Task13.User.WriteMsg(msg);
                return(null);
            }
            return(null);
        }
コード例 #8
0
        // Function from file: safe.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string  dat = null;
            int?    i   = null;
            dynamic P   = null;

            ((Mob)a).set_machine(this);
            dat  = "<center>";
            dat += new Txt("<a href='?src=").Ref(this).str(";open=1'>").item((this.open ? "Close" : "Open")).str(" ").item(this).str("</a> | <a href='?src=").Ref(this).str(";decrement=1'>-</a> ").item(this.dial * 5).str(" <a href='?src=").Ref(this).str(";increment=1'>+</a>").ToString();

            if (this.open)
            {
                dat += "<table>";
                i    = null;
                i    = this.contents.len;

                while ((i ?? 0) >= 1)
                {
                    P    = this.contents[i];
                    dat += new Txt("<tr><td><a href='?src=").Ref(this).str(";retrieve=").Ref(P).str("'>").item(P.name).str("</a></td></tr>").ToString();
                    i--;
                }
                dat += "</table></center>";
            }
            Interface13.Browse(a, "<html><head><title>" + this.name + "</title></head><body>" + dat + "</body></html>", "window=safe;size=350x300");
            return(null);
        }
コード例 #9
0
        // Function from file: laborstacker.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic dat = null;

            dat += "<b>Point Claim Console</b><br><br>";

            if (Lang13.Bool(this.emagged))
            {
                dat += "<b>QU&#t0A In%aL*D</b><br>";
            }
            else if (this.inserted_id is Obj_Item_Weapon_Card_Id_Prisoner)
            {
                dat += new Txt("ID: ").item(this.inserted_id.registered_name).str(" <A href='?src=").Ref(this).str(";choice=eject'>Eject ID.</A><br>").ToString();
                dat += "Points Collected:" + this.inserted_id.points + "<br>";
                dat += "Point Quota: " + this.inserted_id.goal + " - Reach your quota to earn your release<br>";
                dat += new Txt("Unclaimed Collection Points: ").item(this.machine.points).str(".  <A href='?src=").Ref(this).str(";choice=claim'>Claim points.</A><br>").ToString();
            }
            else
            {
                dat += new Txt("No ID inserted.  <A href='?src=").Ref(this).str(";choice=insert'>Insert ID.</A><br>").ToString();
            }

            if (this.check_auth())
            {
                dat += new Txt("<A href='?src=").Ref(this).str(";choice=station'>Proceed to Station.</A><br>").ToString();
                dat += new Txt("<A href='?src=").Ref(this).str(";choice=release'>Open release door.</A><br>").ToString();
            }

            if (Lang13.Bool(this.machine))
            {
                dat += "<HR><b>Mineral Value List:</b><BR>" + this.machine.get_ore_values();
            }
            Interface13.Browse(a, "" + dat, "window=console_stacking_machine");
            return(null);
        }
コード例 #10
0
        public static void ObjectSchemaToXhtml(String XhtmlDir, String Title, String CopyrightText)
        {
            var oslr          = GetObjectSchemaLoaderResult();
            var CompiledFiles = oslr.CompileToXhtml(Title, CopyrightText);

            foreach (var f in CompiledFiles)
            {
                var Compiled = f.Content;
                var Path     = FileNameHandling.GetPath(XhtmlDir, f.Path);
                if (File.Exists(Path))
                {
                    var Original = Txt.ReadFile(Path);
                    if (String.Equals(Compiled, Original, StringComparison.Ordinal))
                    {
                        continue;
                    }
                }
                var Dir = FileNameHandling.GetFileDirectory(Path);
                if (Dir != "" && !Directory.Exists(Dir))
                {
                    Directory.CreateDirectory(Dir);
                }
                Txt.WriteFile(Path, TextEncoding.UTF8, Compiled);
            }
        }
コード例 #11
0
        // Function from file: soulstone.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            string dat = null;
            Mob_Living_SimpleAnimal_Shade A = null;


            if (!(Map13.GetDistance(this, user) <= 1))
            {
                return(null);
            }

            if (!GlobalFuncs.iscultist(user) && !GlobalFuncs.iswizard(user) && !this.usability)
            {
                ((Mob)user).Paralyse(5);
                user.WriteMsg("<span class='userdanger'>Your body is wracked with debilitating pain!</span>");
                return(null);
            }
            ((Mob)user).set_machine(this);
            dat = "<TT><B>Soul Stone</B><BR>";

            foreach (dynamic _a in Lang13.Enumerate(this, typeof(Mob_Living_SimpleAnimal_Shade)))
            {
                A = _a;

                dat += "Captured Soul: " + A.name + "<br>";
                dat += new Txt("<A href='byond://?src=").Ref(this).str(";choice=Summon'>Summon Shade</A>").ToString();
                dat += "<br>";
                dat += new Txt("<a href='byond://?src=").Ref(this).str(";choice=Close'>Close</a>").ToString();
            }
            Interface13.Browse(user, dat, "window=aicard");
            GlobalFuncs.onclose(user, "aicard");
            return(null);
        }
コード例 #12
0
        public static void WriteLog(String LogDir, SessionLogEntry Entry)
        {
            var LocalTime = Entry.Time.ToLocalTime();
            var Dir       = FileNameHandling.GetPath(LogDir, LocalTime.Date.ToString("yyyyMMdd"));

            if (Dir != "" && !Directory.Exists(Dir))
            {
                Directory.CreateDirectory(Dir);
            }
            var Path  = FileNameHandling.GetPath(Dir, String.Format("{0}-{1}.log", Entry.RemoteEndPoint.ToString().Replace(".", "_").Replace(":", "_"), Entry.Token));
            var e     = Encoding.UTF8;
            var Lines = GetLines(Entry);

            if (File.Exists(Path))
            {
                e = Txt.GetEncoding(Path, e);
            }
            using (var r = new StreamWriter(Path, true, e))
            {
                foreach (var Line in Lines)
                {
                    r.WriteLine(Line);
                }
            }
        }
コード例 #13
0
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);

            var t = (BaseTextVObject)obj;

            t.Text = Txt.Replace("&gt;", ">").Replace("&lt;", "<").Replace("&quot;", "\"").Replace("&amp;", "&");

            // Backward compatibility
            if (F_N == null && FN != null)
            {
                var font = FontService.FindSuitableFont(FN, B, I, S);
                t.Font.FauxBold       = font.FauxBold;
                t.Font.FauxItalic     = font.FauxItalic;
                t.Font.PostScriptName = font.PostScriptName;
                t.Font.Size           = FS;
            }
            else
            {
                t.Font.FauxBold       = F_FB;
                t.Font.FauxItalic     = F_FI;
                t.Font.PostScriptName = F_N;
                t.Font.Size           = F_S;
            }

            t.TextColor = TC;
            t.Underline = U;
            t.SetInternalAlignment(A);
            t.Tracking        = Tr;
            t.Leading         = Ld;
            t.CurrentFileId   = CFI;
            t.IsRichText      = IRT;
            t.VerticalScale   = VS;
            t.HorizontalScale = HS;
        }
コード例 #14
0
        public static void ObjectSchemaToJavaBinaryCode(String JavaCodeDirPath, String PackageName)
        {
            var ObjectSchema  = GetObjectSchema();
            var CompiledFiles = ObjectSchema.CompileToJavaBinary(PackageName);

            foreach (var f in CompiledFiles)
            {
                var FilePath = FileNameHandling.GetPath(JavaCodeDirPath, f.Key.Replace('/', Path.DirectorySeparatorChar));
                var Compiled = f.Value;
                if (File.Exists(FilePath))
                {
                    var Original = Txt.ReadFile(FilePath);
                    if (String.Equals(Compiled, Original, StringComparison.Ordinal))
                    {
                        continue;
                    }
                }
                var Dir = FileNameHandling.GetFileDirectory(FilePath);
                if (Dir != "" && !Directory.Exists(Dir))
                {
                    Directory.CreateDirectory(Dir);
                }
                Txt.WriteFile(FilePath, Compiled);
            }
        }
コード例 #15
0
        // Function from file: navbeacon.dm
        public override dynamic interact(dynamic user = null, bool?flag1 = null)
        {
            flag1 = flag1 ?? false;

            Ent_Static T     = null;
            string     t     = null;
            dynamic    key   = null;
            dynamic    key2  = null;
            Browser    popup = null;

            T = this.loc;

            if (Lang13.Bool(((dynamic)T).intact))
            {
                return(null);
            }

            if (!this.open && !(flag1 == true))
            {
                user.WriteMsg("<span class='warning'>The beacon's control cover is closed!</span>");
                return(null);
            }

            if (this.locked && !(flag1 == true))
            {
                t = "<TT><B>Navigation Beacon</B><HR><BR>\n<i>(swipe card to unlock controls)</i><BR>\nLocation: " + (Lang13.Bool(this.location) ? this.location : "(none)") + "</A><BR>\nTransponder Codes:<UL>";

                foreach (dynamic _a in Lang13.Enumerate(this.codes))
                {
                    key = _a;

                    t += "<LI>" + key + " ... " + this.codes[key];
                }
                t += "<UL></TT>";
            }
            else
            {
                t = new Txt(@"<TT><B>Navigation Beacon</B><HR><BR>
<i>(swipe card to lock controls)</i><BR>

<HR>
Location: <A href='byond://?src=").Ref(this).str(";locedit=1'>").item((Lang13.Bool(this.location) ? this.location : "None")).str("</A><BR>\nTransponder Codes:<UL>").ToString();

                foreach (dynamic _b in Lang13.Enumerate(this.codes))
                {
                    key2 = _b;

                    t += "<LI>" + key2 + " ... " + this.codes[key2];
                    t += new Txt("	<A href='byond://?src=").Ref(this).str(";edit=1;code=").item(key2).str("'>Edit</A>").ToString();
                    t += new Txt("	<A href='byond://?src=").Ref(this).str(";delete=1;code=").item(key2).str("'>Delete</A><BR>").ToString();
                }
                t += new Txt("	<A href='byond://?src=").Ref(this).str(";add=1;'>Add New</A><BR>").ToString();
                t += "<UL></TT>";
            }
            popup = new Browser(user, "navbeacon", "Navigation Beacon", 300, 400);
            popup.set_content(t);
            popup.open();
            return(null);
        }
コード例 #16
0
 void _kbListener_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.LWin && _magicCombination)
     {
         string txt = TxtFetcherFacade.FetchSelectedText();
         Txt.AppendText(txt + Environment.NewLine);
     }
 }
コード例 #17
0
        public static void Log(Func <string> color, params object[] msg)
        {
#if UNITY_EDITOR
            string str = msg.Map(x => x.ToString()).Flatten();
            Txt    t   = new Txt(str, color?.Invoke());
            Debug.Log(t.GetText);
#endif
        }
コード例 #18
0
        // Function from file: honker.dm
        public override string get_commands(  )
        {
            string output = null;

            output  = new Txt("<div class='wr'>\n						<div class='header'>Sounds of HONK:</div>\n						<div class='links'>\n						<a href='?src=").Ref(this).str(";play_sound=sadtrombone'>Sad Trombone</a>\n						</div>\n						</div>\n						").ToString();
            output += base.get_commands();
            return(output);
        }
コード例 #19
0
ファイル: Obj_Item_Projectile.cs プロジェクト: Somnium13/SS13
        // Function from file: projectile.dm
        public virtual dynamic on_hit(Ent_Static target = null, double?blocked = null, dynamic hit_zone = null)
        {
            blocked = blocked ?? 0;

            Ent_Static L = null;
            string     organ_hit_text = null;
            int?       volume         = null;
            string     reagent_note   = null;
            Reagent    R = null;


            if (!(target is Mob_Living))
            {
                return(0);
            }
            L = target;

            if (blocked != 100)
            {
                organ_hit_text = "";

                if (Lang13.Bool(((dynamic)L).has_limbs))
                {
                    organ_hit_text = new Txt(" in ").the(GlobalFuncs.parse_zone(this.def_zone)).item().ToString();
                }

                if (this.suppressed)
                {
                    GlobalFuncs.playsound(this.loc, this.hitsound, 5, 1, -1);
                    ((dynamic)L).WriteMsg(new Txt("<span class='userdanger'>You're shot by ").a(this).item().item(organ_hit_text).str("!</span>").ToString());
                }
                else
                {
                    if (Lang13.Bool(this.hitsound))
                    {
                        volume = this.vol_by_damage();
                        GlobalFuncs.playsound(this.loc, this.hitsound, volume, 1, -1);
                    }
                    L.visible_message(new Txt("<span class='danger'>").item(L).str(" is hit by ").a(this).item().item(organ_hit_text).str("!</span>").ToString(), new Txt("<span class='userdanger'>").item(L).str(" is hit by ").a(this).item().item(organ_hit_text).str("!</span>").ToString());
                }
                ((dynamic)L).on_hit(this.type);
            }

            if (this.reagents != null && this.reagents.reagent_list != null)
            {
                reagent_note = " REAGENTS:";

                foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent)))
                {
                    R = _a;

                    reagent_note += R.id + " (";
                    reagent_note += String13.NumberToString(R.volume) + ") ";
                }
            }
            GlobalFuncs.add_logs(this.firer, L, "shot", this, reagent_note);
            return(((dynamic)L).apply_effects(this.stun, this.weaken, this.paralyze, this.irradiate, this.slur, this.stutter, this.eyeblur, this.drowsy, blocked, this.stamina, this.jitter));
        }
コード例 #20
0
ファイル: cmdNG.cs プロジェクト: 15831944/EM
        NG()
        {
            Layer.manageLayers("EXIST-SPOT");
            Layer.manageLayers("SPOT-LABEL");

            SelectionSet ss = Select.buildSSet(typeof(CogoPoint), selectAll: false);

            if (ss == null || ss.Count == 0)
            {
                return;
            }
            string elev   = "";
            int    length = 0;

            ObjectId[] ids    = ss.GetObjectIds();
            ObjectId   idMTxt = ObjectId.Null;
            Vector3d   v3d    = new Vector3d();

            for (int i = 0; i < ids.Length; i++)
            {
                Point3d pnt3dX = ids[i].getCogoPntCoordinates() + v3d;
                elev   = string.Format("({0:F2})", ids[i].getCogoPntElevation());
                length = elev.Length;
                switch (length)
                {
                case 6:             //      (X.XX)
                    v3d = new Vector3d(.030, .03, 0) * Misc.getCurrAnnoScale();
                    break;

                case 7:             //     (XX.XX)
                    v3d = new Vector3d(-.000, .03, 0) * Misc.getCurrAnnoScale();
                    break;

                case 8:             //    (XXX.XX)
                    v3d = new Vector3d(-.030, .03, 0) * Misc.getCurrAnnoScale();
                    break;

                case 9:             //   (XXXX.XX)
                    v3d = new Vector3d(-.060, .03, 0) * Misc.getCurrAnnoScale();
                    break;

                case 10:            //  (XXXXX.XX)
                    v3d = new Vector3d(-.090, .03, 0) * Misc.getCurrAnnoScale();
                    break;

                case 11:            // (XXXXXX.XX)
                    v3d = new Vector3d(-.120, .03, 0) * Misc.getCurrAnnoScale();
                    break;

                case 12:            //(XXXXXXX.XX)
                    v3d = new Vector3d(-.150, .03, 0) * Misc.getCurrAnnoScale();
                    break;
                }

                idMTxt = Txt.addMText(elev, pnt3dX + v3d,
                                      0.0, 0.09, nameLayer: "SPOT-LABEL", justify: Pub.JUSTIFYCENTER);
            }
        }
コード例 #21
0
        public void Fetch(string[] commandStrings)
        {
            Enums.Version.version version = (Enums.Version.version)Enum.Parse(typeof(Enums.Version.version), commandStrings[1], true);
            Txt connexion_stat            = (Txt)Manager.manager.GfxObjList.Find(f => f.Name() == "__connexion_stat");

            if (!Manager.manager.mainForm.Controls.Find("username", false).Any())
            {
                return;
            }
            TextBox username = (TextBox)Manager.manager.mainForm.Controls.Find("username", false)[0];

            if (!Manager.manager.mainForm.Controls.Find("password", false).Any())
            {
                return;
            }
            TextBox password = (TextBox)Manager.manager.mainForm.Controls.Find("password", false)[0];

            if (connexion_stat == null)
            {
                return;
            }

            // pas de differance entre MAJOR_LESS et REVISION_LESS puisque le client dois avoir la meme version avec le serveur
            switch (version)
            {
            case Enums.Version.version.MAJOR_LESS:
                // VersionResponseMessage•MAJOR_LESS•Network.downloadMajorLink
                break;

            case Enums.Version.version.REVISION_LESS:
                // VersionResponseMessage•REVISION_LESS•Network.downloadMajorLink
                break;

            default:
                throw new ArgumentOutOfRangeException("Enum " + version + " does'nt have it's handle in switch scoop");
            }

            DialogResult result1 = MessageBox.Show(CommonCode.TranslateText(11), "Version Error", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result1 == DialogResult.Yes)
            {
                System.Diagnostics.Process.Start(commandStrings[2]);
            }

            Bmp ConnexionBtn = (Bmp)Manager.manager.GfxObjList.Find(f => f.Name() == "__ConnexionBtn");

            username.Focus();
            username.Enabled     = true;
            password.Enabled     = true;
            ConnexionBtn.visible = true;
            IGfx __connexionBtnLabel = Manager.manager.GfxObjList.Find(f => f.Name() == "__connexionBtnLabel");

            if (__connexionBtnLabel != null)
            {
                Manager.manager.GfxObjList.Find(f => f.Name() == "__connexionBtnLabel").Visible(true);
            }
            Network.netClient.Shutdown("0x5");
        }
コード例 #22
0
        // Function from file: pai.dm
        public void recruitWindow(Mob M = null)
        {
            PaiCandidate candidate = null;
            PaiCandidate c         = null;
            string       dat       = null;


            foreach (dynamic _a in Lang13.Enumerate(this.candidates, typeof(PaiCandidate)))
            {
                c = _a;


                if (c.key == M.key)
                {
                    candidate = c;
                }
            }

            if (!(candidate != null))
            {
                candidate     = new PaiCandidate();
                candidate.key = M.key;
                this.candidates.Add(candidate);
            }
            dat  = "";
            dat += @"
			<style type=""text/css"">

			p.top {
				background-color: #AAAAAA; color: black;
			}

			tr.d0 td {
				background-color: #CC9999; color: black;
			}
			tr.d1 td {
				background-color: #9999CC; color: black;
			}
			</style>
			"            ;
            dat += "<p class=\"top\">Please configure your pAI personality's options. Remember, what you enter here could determine whether or not the user requesting a personality chooses you!</p>";
            dat += "<table>";
            dat += "<tr class=\"d0\"><td>Name:</td><td>" + candidate.name + "</td></tr>";
            dat += new Txt("<tr class=\"d1\"><td><a href='byond://?src=").Ref(this).str(";option=name;new=1;candidate=").Ref(candidate).str("'>[Edit]</a></td><td>What you plan to call yourself. Suggestions: Any character name you would choose for a station character OR an AI.</td></tr>").ToString();
            dat += "<tr class=\"d0\"><td>Description:</td><td>" + candidate.description + "</td></tr>";
            dat += new Txt("<tr class=\"d1\"><td><a href='byond://?src=").Ref(this).str(";option=desc;new=1;candidate=").Ref(candidate).str("'>[Edit]</a></td><td>What sort of pAI you typically play; your mannerisms, your quirks, etc. This can be as sparse or as detailed as you like.</td></tr>").ToString();
            dat += "<tr class=\"d0\"><td>Preferred Role:</td><td>" + candidate.role + "</td></tr>";
            dat += new Txt("<tr class=\"d1\"><td><a href='byond://?src=").Ref(this).str(";option=role;new=1;candidate=").Ref(candidate).str("'>[Edit]</a></td><td>Do you like to partner with sneaky social ninjas? Like to help security hunt down thugs? Enjoy watching an engineer's back while he saves the station yet again? This doesn't have to be limited to just station jobs. Pretty much any general descriptor for what you'd like to be doing works here.</td></tr>").ToString();
            dat += "<tr class=\"d0\"><td>OOC Comments:</td><td>" + candidate.comments + "</td></tr>";
            dat += new Txt("<tr class=\"d1\"><td><a href='byond://?src=").Ref(this).str(";option=ooc;new=1;candidate=").Ref(candidate).str("'>[Edit]</a></td><td>Anything you'd like to address specifically to the player reading this in an OOC manner. \"I prefer more serious RP.\", \"I'm still learning the interface!\", etc. Feel free to leave this blank if you want.</td></tr>").ToString();
            dat += "</table>";
            dat += "<br>";
            dat += new Txt("<h3><a href='byond://?src=").Ref(this).str(";option=submit;new=1;candidate=").Ref(candidate).str("'>Submit Personality</a></h3><br>").ToString();
            dat += new Txt("<a href='byond://?src=").Ref(this).str(";option=save;new=1;candidate=").Ref(candidate).str("'>Save Personality</a><br>").ToString();
            dat += new Txt("<a href='byond://?src=").Ref(this).str(";option=load;new=1;candidate=").Ref(candidate).str("'>Load Personality</a><br>").ToString();
            Interface13.Browse(M, dat, "window=paiRecruit");
            return;
        }
コード例 #23
0
ファイル: AirlockMaker.cs プロジェクト: Somnium13/SS13
        // Function from file: airlock_maker.dm
        public void interact(  )
        {
            ByTable leftcolumn  = null;
            ByTable rightcolumn = null;
            dynamic access      = null;
            dynamic option      = null;
            int?    length      = null;
            string  dat         = null;
            int?    i           = null;

            leftcolumn  = new ByTable();
            rightcolumn = new ByTable();
            leftcolumn.Add("<u><b>Required Access</b></u>");

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_all_accesses()))
            {
                access = _a;

                leftcolumn.Add(this.linkpretty("access=" + access, GlobalFuncs.get_access_desc(access), this.access_used.Contains(access)));
            }
            leftcolumn.Add("Require all listed accesses: " + this.linkpretty("reqall", null, this.require_all));
            rightcolumn.Add("<u><b>Paintjob</b></u>");

            foreach (dynamic _b in Lang13.Enumerate(new ByTable(new object [] { "none", "engineering", "atmos", "security", "command", "medical", "research", "mining", "maintenance", "external", "highsecurity" })))
            {
                option = _b;

                rightcolumn.Add(this.linkpretty("paint=" + option, option, option == this.paintjob));
            }
            rightcolumn.Add("Glass door: " + this.linkpretty("glass", null, this.glassdoor) + "<br><br>");
            length = Num13.MaxInt(leftcolumn.len, rightcolumn.len);
            dat    = "You may move the model airlock around.  A new airlock will be built in its space when you click done, below.<hr><br>";
            dat   += new Txt("<a href='?src=").Ref(this).str(";rename'>Door name</a>: \"").item(this.doorname).str("\"").ToString();
            dat   += "<table>";
            i      = null;
            i      = 1;

            while ((i ?? 0) <= (length ?? 0))
            {
                dat += "<tr><td>";

                if ((i ?? 0) <= leftcolumn.len)
                {
                    dat += leftcolumn[i];
                }
                dat += "</td><td>";

                if ((i ?? 0) <= rightcolumn.len)
                {
                    dat += rightcolumn[i];
                }
                dat += "</td></tr>";
                i++;
            }
            dat += new Txt("</table><hr><a href='?src=").Ref(this).str(";done'>Finalize Airlock Construction</a> | <a href='?src=").Ref(this).str(";cancel'>Cancel and Destroy Airlock</a>").ToString();
            Interface13.Browse(Task13.User, dat, "window=airlockmaker");
            return;
        }
コード例 #24
0
        // Function from file: food_cart.dm
        public override dynamic interact(dynamic user = null, bool?flag1 = null)
        {
            dynamic dat   = null;
            Reagent R     = null;
            Reagent R2    = null;
            dynamic V     = null;
            Browser popup = null;

            dat += "<br><b>STORED INGREDIENTS AND DRINKS</b><br><div class='statusDisplay'>";
            dat += "Remaining glasses: " + this.glasses + "<br>";
            dat += new Txt("Portion: <a href='?src=").Ref(this).str(";portion=1'>").item(this.portion).str("</a><br>").ToString();

            foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent)))
            {
                R = _a;

                dat += "" + R.name + ": " + R.volume + " ";
                dat += new Txt("<a href='?src=").Ref(this).str(";disposeI=").item(R.id).str("'>Purge</a>").ToString();

                if (this.glasses > 0)
                {
                    dat += new Txt("<a href='?src=").Ref(this).str(";pour=").item(R.id).str("'>Pour in a glass</a>").ToString();
                }
                dat += new Txt("<a href='?src=").Ref(this).str(";mix=").item(R.id).str("'>Add to the mixer</a><br>").ToString();
            }
            dat += "</div><br><b>MIXER CONTENTS</b><br><div class='statusDisplay'>";

            foreach (dynamic _b in Lang13.Enumerate(this.mixer.reagents.reagent_list, typeof(Reagent)))
            {
                R2 = _b;

                dat += "" + R2.name + ": " + R2.volume + " ";
                dat += new Txt("<a href='?src=").Ref(this).str(";transfer=").item(R2.id).str("'>Transfer back</a>").ToString();

                if (this.glasses > 0)
                {
                    dat += new Txt("<a href='?src=").Ref(this).str(";m_pour=").item(R2.id).str("'>Pour in a glass</a>").ToString();
                }
                dat += "<br>";
            }
            dat += "</div><br><b>STORED FOOD</b><br><div class='statusDisplay'>";

            foreach (dynamic _c in Lang13.Enumerate(this.stored_food))
            {
                V = _c;


                if (Convert.ToDouble(this.stored_food[V]) > 0)
                {
                    dat += new Txt("<b>").item(V).str(": ").item(this.stored_food[V]).str("</b> <a href='?src=").Ref(this).str(";dispense=").item(V).str("'>Dispense</a><br>").ToString();
                }
            }
            dat  += new Txt("</div><br><a href='?src=").Ref(this).str(";refresh=1'>Refresh</a> <a href='?src=").Ref(this).str(";close=1'>Close</a>").ToString();
            popup = new Browser(user, "foodcart", "Food Cart", 500, 350, this);
            popup.set_content(dat);
            popup.open();
            return(null);
        }
        private void BtnLimpiar_Click(object sender, EventArgs e)
        {
            foreach (TextBox Txt in this.Controls.OfType <TextBox>())
            {
                Txt.Clear();

                TxtCantidad.Focus();
            }
        }
コード例 #26
0
        // Function from file: autolathe.dm
        public string category_win(dynamic user = null, dynamic selected_category = null)
        {
            string  dat            = null;
            dynamic v              = null;
            Design  D              = null;
            int     max_multiplier = 0;

            dat  = new Txt("<A href='?src=").Ref(this).str(";menu=").item(1).str("'>Return to main menu</A>").ToString();
            dat += "<div class='statusDisplay'><h3>Browsing " + selected_category + ":</h3><br>";
            dat += "<b>Total amount:</b> " + this.materials.total_amount + " / " + this.materials.max_amount + " cm<sup>3</sup><br>";
            dat += "<b>Metal amount:</b> " + this.materials.amount("$metal") + " cm<sup>3</sup><br>";
            dat += "<b>Glass amount:</b> " + this.materials.amount("$glass") + " cm<sup>3</sup><br>";

            foreach (dynamic _a in Lang13.Enumerate(this.files.known_designs))
            {
                v = _a;

                D = this.files.known_designs[v];

                if (!D.category.Contains(selected_category))
                {
                    continue;
                }

                if (Lang13.Bool(this.disabled) || !this.can_build(D))
                {
                    dat += "<span class='linkOff'>" + D.name + "</span>";
                }
                else
                {
                    dat += new Txt("<a href='?src=").Ref(this).str(";make=").item(D.id).str(";multiplier=1'>").item(D.name).str("</a>").ToString();
                }

                if (Lang13.Bool(D.build_path.IsSubclassOf(typeof(Obj_Item_Stack))))
                {
                    max_multiplier = Num13.MinInt(D.maxstack, ((int)((Lang13.Bool(D.materials["$metal"]) ? Num13.Floor((this.materials.amount("$metal") ?1:0) / Convert.ToDouble(D.materials["$metal"])) : Double.PositiveInfinity))), ((int)((Lang13.Bool(D.materials["$glass"]) ? Num13.Floor((this.materials.amount("$glass") ?1:0) / Convert.ToDouble(D.materials["$glass"])) : Double.PositiveInfinity))));

                    if (max_multiplier > 10 && !Lang13.Bool(this.disabled))
                    {
                        dat += new Txt(" <a href='?src=").Ref(this).str(";make=").item(D.id).str(";multiplier=10'>x10</a>").ToString();
                    }

                    if (max_multiplier > 25 && !Lang13.Bool(this.disabled))
                    {
                        dat += new Txt(" <a href='?src=").Ref(this).str(";make=").item(D.id).str(";multiplier=25'>x25</a>").ToString();
                    }

                    if (max_multiplier > 0 && !Lang13.Bool(this.disabled))
                    {
                        dat += new Txt(" <a href='?src=").Ref(this).str(";make=").item(D.id).str(";multiplier=").item(max_multiplier).str("'>x").item(max_multiplier).str("</a>").ToString();
                    }
                }
                dat += "" + this.get_design_cost(D) + "<br>";
            }
            dat += "</div>";
            return(dat);
        }
コード例 #27
0
        // Function from file: computer.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            ByTable options          = null;
            Obj_DockingPort_Mobile M = null;
            string dat = null;
            bool   destination_found     = false;
            Obj_DockingPort_Stationary S = null;
            Browser popup = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            options = String13.ParseUrlParams(this.possible_destinations);
            M       = GlobalVars.SSshuttle.getShuttle(this.shuttleId);
            dat     = "Status: " + (M != null ? M.getStatusText() : "*Missing*") + "<br><br>";

            if (M != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSshuttle.stationary, typeof(Obj_DockingPort_Stationary)))
                {
                    S = _a;


                    if (!(options.Find(S.id) != 0))
                    {
                        continue;
                    }

                    if (M.canDock(S) != 0)
                    {
                        continue;
                    }
                    destination_found = true;
                    dat += new Txt("<A href='?src=").Ref(this).str(";move=").item(S.id).str("'>Send to ").item(S.name).str("</A><br>").ToString();
                }

                if (!destination_found)
                {
                    dat += "<B>Shuttle Locked</B><br>";

                    if (this.admin_controlled)
                    {
                        dat += "Authorized personnel only<br>";
                        dat += new Txt("<A href='?src=").Ref(this).str(";request=1]'>Request Authorization</A><br>").ToString();
                    }
                }
            }
            dat  += new Txt("<a href='?src=").Ref(a).str(";mach_close=computer'>Close</a>").ToString();
            popup = new Browser(a, "computer", (M != null ? M.name : "shuttle"), 300, 200);
            popup.set_content("<center>" + dat + "</center>");
            popup.set_title_image(Task13.User.browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
        // Function from file: airlock_controller.dm
        public override string return_text(  )
        {
            string state_options   = null;
            int    state           = 0;
            string sensor_pressure = null;
            string exterior_status = null;
            string interior_status = null;
            string pump_status     = null;
            string current_status  = null;
            string output          = null;

            state_options   = null;
            state           = 0;
            sensor_pressure = "----";
            exterior_status = "----";
            interior_status = "----";
            pump_status     = "----";
            current_status  = "Inactive<BR>&nbsp;";

            if (this.program != null)
            {
                state           = this.program.state;
                sensor_pressure = (Lang13.Bool(this.program.memory["sensor_pressure"]) ? this.program.memory["sensor_pressure"] : "----");
                exterior_status = (Lang13.Bool(this.program.memory["exterior_status"]) ? this.program.memory["exterior_status"] : "----");
                interior_status = (Lang13.Bool(this.program.memory["interior_status"]) ? this.program.memory["interior_status"] : "----");
                pump_status     = (Lang13.Bool(this.program.memory["pump_status"]) ? this.program.memory["pump_status"] : "----");
            }

            switch ((int)(state))
            {
            case -2:
                state_options  = new Txt("<A href='?src=").Ref(this).str(";command=cycle_closed'>Close Interior Airlock</A><BR>\n<A href='?src=").Ref(this).str(";command=cycle_exterior'>Cycle to Exterior Airlock</A><BR>").ToString();
                current_status = "Interior Airlock Open<BR><span class='good'>Chamber Pressurized</span>";
                break;

            case -1:
                state_options  = new Txt("<A href='?src=").Ref(this).str(";command=abort'>Abort Cycling</A><BR>").ToString();
                current_status = "Cycling to Interior Airlock<BR><span class='average'>Chamber Pressurizing</span>";
                break;

            case 0:
                state_options = new Txt("<A href='?src=").Ref(this).str(";command=cycle_interior'>Open Interior Airlock</A><BR>\n<A href='?src=").Ref(this).str(";command=cycle_exterior'>Open Exterior Airlock</A><BR>").ToString();
                break;

            case 1:
                state_options  = new Txt("<A href='?src=").Ref(this).str(";command=abort'>Abort Cycling</A><BR>").ToString();
                current_status = "Cycling to Exterior Airlock<BR><span class='average'>Chamber Depressurizing</span>";
                break;

            case 2:
                state_options  = new Txt("<A href='?src=").Ref(this).str(";command=cycle_interior'>Cycle to Interior Airlock</A><BR>\n<A href='?src=").Ref(this).str(";command=cycle_closed'>Close Exterior Airlock</A><BR>").ToString();
                current_status = "Exterior Airlock Open<BR><span class='bad'>Chamber Depressurized</span>";
                break;
            }
            output = "<h3>Airlock Status</h3>\n<div class='statusDisplay'>\n<div class='line'><div class='statusLabel'>Current Status:</div><div class='statusValue'>" + current_status + "</div></div>\n<div class='line'>&nbsp;</div>\n<div class='line'><div class='statusLabel'>&gt; Chamber Pressure:</div><div class='statusValue'>" + sensor_pressure + " kPa</div></div>\n<div class='line'><div class='statusLabel'>&gt; Control Pump:</div><div class='statusValue'>" + pump_status + "</div></div>\n<div class='line'><div class='statusLabel'>&gt; Interior Door:</div><div class='statusValue'>" + interior_status + "</div></div>\n<div class='line'><div class='statusLabel'>&gt; Exterior Door:</div><div class='statusValue'>" + exterior_status + "</div></div>\n</div>\n" + state_options;
            return(output);
        }
コード例 #29
0
ファイル: Program.cs プロジェクト: nauhtnn/sQz
        static void Main(string[] args)
        {
            Txt p = new Txt();

            p.Scan(Utils.ReadFile("../../../samples/GUI-vi.txt"));
            p.WriteEnum("../../../sQzLib/TxI.cs");
            p.WriteByte("../../../samples/GUI-vi.bin");
            //p.ReadByte(Txt.sRPath + "samples/GUI-vi.bin");
        }
コード例 #30
0
ファイル: AssetManager.cs プロジェクト: Blumster/DataLoader
        private static void ProcessReader(String name, String ext, BinaryReader br)
        {
            switch (ext)
            {
            case "fat":     // Map written in text mode, actually it doesn't exist in the packed files
                break;

            case "fam":     // Map
                SectorMap.Read(name, br);
                break;

            case "xml":     // Xml
                using (var sw = new StreamWriter(name))
                    sw.WriteLine(Xml.Read(name, br).Content);

                break;

            case "txt":     // Text
                Txt.Read(name, br);
                break;

            case "ndw":
                NDW.Read(name, br);
                break;

            // Not needed for the server (yet or anyways)
            case "cat":     // Catalog
            case "dds":
            case "DDS":
            case "png":     // Png
            case "tga":     // Tga
            case "pgm":
            case "bak":     // Backup
            case "anm":     // Animation
            case "fx":
            case "fxh":
            case "fxi":
            case "geo":
            case "geo01":
            case "ogg":     // Ogg
                break;

            // Unknown yet
            case "tec":
            case "sha":
            case "spt":
            case "scc":
            case "cache":
            case "tk":
            case "lnk":
                break;

            default:
                Console.WriteLine(ext);
                break;
            }
        }