private static void BeginExport(string path, string[] tracked)
        {
            streamWriter?.Dispose();

            exporting = true;
            if (Path.GetDirectoryName(path) is { } dir&& dir.IsNotEmpty())
            {
                Directory.CreateDirectory(dir);
            }

            streamWriter = new StreamWriter(path);
            streamWriter.WriteLine(string.Join("\t", "Line", "Inputs", "Frames", "Time", "Position", "Speed", "State", "Statuses", "Entities"));
            trackedEntities = new Dictionary <string, Func <List <Entity> > >();
            foreach (string typeName in tracked)
            {
                if (!InfoCustom.TryParseTypes(typeName, out List <Type> types))
                {
                    continue;
                }

                foreach (Type type in types)
                {
                    if (type.IsSameOrSubclassOf(typeof(Entity)) && type.FullName != null)
                    {
                        trackedEntities[type.FullName] = () => InfoCustom.FindEntities(type, string.Empty);
                    }
                }
            }
        }
Exemple #2
0
        public GiaThanh()
        {
            InfoCustom ic1 = new InfoCustom(5001, "Tính giá thành", "Chi phí giá thành");
            InfoCustom ic2 = new InfoCustom(5002, "Tính dở dang cuối kỳ", "Chi phí giá thành");

            _lstInfo.AddRange(new InfoCustom[] { ic1, ic2 });
        }
        private static void SetCommand(string[] args)
        {
            if (args.Length < 2)
            {
                return;
            }

            try {
                if (args[0].Contains("."))
                {
                    string[] parameters = args.Skip(1).ToArray();
                    if (TrySetModSetting(args[0], parameters))
                    {
                        return;
                    }

                    if (InfoCustom.TryParseMemberNames(args[0], out string typeText, out List <string> memberNames, out string errorMessage) &&
                        InfoCustom.TryParseType(typeText, out Type type, out string entityId, out errorMessage))
                    {
                        SetObject(type, entityId, memberNames, parameters);
                    }
                    else
                    {
                        errorMessage.Log();
                    }
                }
                else
                {
                    SetGameSetting(args);
                }
            } catch (Exception e) {
Exemple #4
0
        public CapNhatHD()
        {
            InfoCustom ic  = new InfoCustom(1207, "Tính lại số tiền phải trả của hóa đơn.", "Mua hàng phải trả");
            InfoCustom ic1 = new InfoCustom(1208, "Tính lại số tiền phải thu của hóa đơn.", "Bán hàng phải thu");

            _lstInfo.Add(ic);
            _lstInfo.Add(ic1);
        }
 public override void LoadContent(bool firstLoad)
 {
     if (firstLoad)
     {
         TasCommandAttribute.CollectMethods();
         InfoCustom.CollectAllTypeInfo();
     }
 }
        private static void ExportInfo(InputFrame inputFrame)
        {
            InputController controller = Manager.Controller;
            string          output;

            if (Engine.Scene is Level level)
            {
                Player player = level.Tracker.GetEntity <Player>();
                if (player == null)
                {
                    return;
                }

                string time  = GameInfo.GetChapterTime(level);
                string pos   = player.ToSimplePositionString(CelesteTasModuleSettings.MaxDecimals);
                string speed = player.Speed.ToSimpleString(Settings.SpeedDecimals);

                int    dashCooldown = (int)GameInfo.GetDashCooldownTimer(player);
                string statuses     = GameInfo.GetStatuses(level, player, dashCooldown);

                output = string.Join("\t",
                                     inputFrame.Line + 1, $"{controller.CurrentFrameInInput}/{inputFrame}", controller.CurrentFrameInTas, time, pos, speed,
                                     PlayerStates.GetStateName(player.StateMachine.State),
                                     statuses);

                foreach (string typeName in trackedEntities.Keys)
                {
                    List <Entity> entities = trackedEntities[typeName].Invoke();
                    if (entities == null)
                    {
                        continue;
                    }

                    foreach (Entity entity in entities)
                    {
                        output += $"\t{typeName}: {entity.ToSimplePositionString(Settings.CustomInfoDecimals)}";
                    }
                }

                if (InfoCustom.Parse() is { } customInfo&& customInfo.IsNotEmpty())
                {
                    output += $"\t{customInfo.ReplaceLineBreak(" ")}";
                }

                if (InfoWatchEntity.GetWatchingEntitiesInfo("\t", true) is { } watchInfo&& watchInfo.IsNotEmpty())
                {
                    output += $"\t{watchInfo}";
                }
            }
            else
            {
                string sceneName;
                if (Engine.Scene is Overworld overworld)
                {
                    sceneName = $"Overworld {(overworld.Current ?? overworld.Next).GetType().Name}";
                }
                else
                {
                    sceneName = Engine.Scene.GetType().Name;
                }

                output = string.Join("\t", inputFrame.Line + 1, $"{controller.CurrentFrameInInput}/{inputFrame}", controller.CurrentFrameInTas,
                                     sceneName);
            }

            streamWriter.WriteLine(output);
            streamWriter.Flush();
        }
Exemple #7
0
        public LichLamViec()
        {
            InfoCustom ic = new InfoCustom(1001, "Lịch làm việc", "Quản lý kinh doanh");

            _lstInfo.Add(ic);
        }
Exemple #8
0
        public InvPBCCDC()
        {
            InfoCustom ic = new InfoCustom(1000, "Phân bổ chi phí trả trước", "Tổng hợp");

            _lstInfo.Add(ic);
        }
Exemple #9
0
        public GlPhanbo()
        {
            InfoCustom ic = new InfoCustom(1004, "Phân bổ cuối kỳ", "Tổng hợp");

            _lstInfo.Add(ic);
        }
Exemple #10
0
        public CLTG()
        {
            InfoCustom ic = new InfoCustom(1005, "Xử lý chênh lệch tỷ giá cuối kỳ", "Tổng hợp");

            _lstInfo.Add(ic);
        }
Exemple #11
0
        public TempTinhSBCL()
        {
            InfoCustom ic = new InfoCustom(1054, "Tinh so buoi con lai de cap nhat", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
Exemple #12
0
        public SiSoToiThieu()
        {
            InfoCustom ic = new InfoCustom(1007, "Theo dõi sỉ số tối thiểu", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
 public ToKhaiTTDB()
 {
     InfoCustom ic1 = new InfoCustom(5812, "Tạo tờ khai thuế TTDB", "Thuế khác");
     _lstInfo.AddRange(new InfoCustom[] { ic1 });
 }
Exemple #14
0
        public HVBaoLuu()
        {
            InfoCustom ic = new InfoCustom(1053, "Cho học viên bảo lưu", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
Exemple #15
0
        public SiSoDiHoc()
        {
            InfoCustom ic = new InfoCustom(1173, "Cập nhật sỉ số / cho lớp nghỉ", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
Exemple #16
0
        public TimKiemCatalog()
        {
            InfoCustom ic = new InfoCustom(1176, "Tìm kiếm theo catalog", "Tìm kiếm");

            _lstInfo.Add(ic);
        }
Exemple #17
0
        public TMBCTC()
        {
            InfoCustom ic = new InfoCustom(1006, "Thuyết minh báo cáo tài chính", "Tổng hợp");

            _lstInfo.Add(ic);
        }
Exemple #18
0
        public XepLop()
        {
            InfoCustom info = new InfoCustom(1001, "Xếp lớp theo danh sách chờ", "Quản lý học viên");

            _lstInfo.Add(info);
        }
Exemple #19
0
        public Chamcong()
        {
            InfoCustom ic = new InfoCustom(1011, "Chấm công", "Tổng hợp");

            _lstInfo.Add(ic);
        }
Exemple #20
0
        public Inventory()
        {
            InfoCustom ic = new InfoCustom(1003, "Tính giá tồn kho", "Quản lý kho");

            _lstInfo.Add(ic);
        }
Exemple #21
0
        public LichTuan()
        {
            InfoCustom ic = new InfoCustom(1011, "Xếp lịch học", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
Exemple #22
0
        public Fa()
        {
            InfoCustom ic = new InfoCustom(1001, "Khấu hao tài sản cố định", "Tài sản cố định");

            _lstInfo.Add(ic);
        }
Exemple #23
0
        public HVNghiHoc()
        {
            InfoCustom ic = new InfoCustom(1103, "Cho học viên nợ học phí nghỉ học ", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
Exemple #24
0
        public DonHang()
        {
            InfoCustom ic = new InfoCustom(6001, "Theo dõi đơn hàng", "Xử lý đơn hàng");

            _lstInfo.Add(ic);
        }
Exemple #25
0
        public GLKC()
        {
            InfoCustom ic = new InfoCustom(1002, "Kết chuyển cuối kỳ", "Tổng hợp");

            _lstInfo.Add(ic);
        }
Exemple #26
0
        public HoaHongSales()
        {
            InfoCustom ic = new InfoCustom(3000, "Quản lý hoa hồng nhân viên kinh doanh", "Bán hàng phải thu");

            _lstInfo.Add(ic);
        }
Exemple #27
0
        public HoiThamHV()
        {
            InfoCustom ic = new InfoCustom(1173, "Hỏi thăm học viên", "Quản lý học viên");

            _lstInfo.Add(ic);
        }
Exemple #28
0
        public PhanBoCN()
        {
            InfoCustom ic = new InfoCustom(7001, "Phân bổ công nợ theo hóa đơn", "Bán hàng phải thu");

            _lstInfo.Add(ic);
        }
Exemple #29
0
        public TimKiemKMH()
        {
            InfoCustom ic = new InfoCustom(1175, "Tìm kiếm theo ký mã hiệu", "Quản lý kho");

            _lstInfo.Add(ic);
        }
 public ToKhaiThueGTGT()
 {
     InfoCustom ic1 = new InfoCustom(7001, "Tạo tờ khai thuế GTGT", "Thuế GTGT");
     _lstInfo.AddRange(new InfoCustom[] { ic1 });
 }
Exemple #31
0
        public TimKiemTen()
        {
            InfoCustom ic = new InfoCustom(1173, "Tìm kiếm theo tên", "Quản lý kho");

            _lstInfo.Add(ic);
        }
Exemple #32
0
        public TimKiemCode()
        {
            InfoCustom ic = new InfoCustom(1174, "Tìm kiếm theo code", "Quản lý kho");

            _lstInfo.Add(ic);
        }