static void Main() { #if (!DEBUG) try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); /* pre-load stuff */ PreLoad.Load(); mainForm = new Loading(); Application.Run(mainForm); } catch (Exception ex) { GModIDE.Classes.ErrorHandler.CreateError(ex, "Unmanaged error caught!", 100000); } #else Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm = new MainForm(); Application.Run(mainForm); #endif }
private void SyncPlayerBaseInfo(KProtoBuf buf) { S2C_SYNC_PLAYER_BASE_INFO respond = buf as S2C_SYNC_PLAYER_BASE_INFO; MajorPlayer majorPlayer = PlayerManager.GetInstance().MajorPlayer; majorPlayer.PlayerID = respond.uPlayerID; majorPlayer.LastSaveTime = respond.nLastSaveTime; majorPlayer.LastLoginTime = respond.nLastLoginTime; majorPlayer.TotalGameTime = respond.nTotalGameTime; majorPlayer.CreateTime = respond.nCreateTime; majorPlayer.Gender = (KGender)respond.byGender; majorPlayer.CanRename = respond.byCanRename; majorPlayer.AccountName = respond.szAccountName; majorPlayer.PlayerName = respond.szPlayerName; majorPlayer.ServerTime = respond.nServerTime; majorPlayer.ClubID = respond.uClubID; majorPlayer.Job = (ushort)respond.byHeroJob; majorPlayer.GroupID = respond.nGroupID; SkillLogic.GetInstance().DefaultSkill(); SceneLogic.GetInstance().InitScene(); KGender gender = EnumUtils.GetEnumIns <KGender>(respond.byGender); majorPlayer.gender = gender; EventDispatcher.GameWorld.Dispath(ControllerCommand.CHANGE_HEAD, respond.byGender); PreLoad.GetInstance().OnLoadMajorPlayer(); }
private void MainForm_Load(object sender, EventArgs e) { /* Load */ PreLoad.Load(); /* Workspace */ _workspace = new Workspace(this, dckMain, null, null, null, null, null); /* Add Plugin Menu Items */ foreach (KeyValuePair <MenuSection, List <ToolStripMenuItem> > kv in PluginManager.MenuItems) { if (kv.Value.Count > 0) { _workspace.AddMenuItem(kv.Key, new ToolStripSeparator()); foreach (ToolStripMenuItem tmi in kv.Value) { _workspace.AddMenuItem(kv.Key, tmi); } } } /* Language */ LanguageManager.HandleForm(this); }
public void OnLoad(object sender, RoutedEventArgs e) { this.Loaded -= OnLoad; PreLoad?.Invoke(this, EventArgs.Empty); UpdateGroup(); }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(Assets)); InternalLoad(); PostLoad?.Invoke(this, new LoadEventArgs(Assets)); }
private void InitCoreManager() { RegisterLog(); DontDestroyOnLoad(this.gameObject); log.Debug("Start game application..."); GameWorld.GetInstance(); LoggerView.GetInstance(); CameraLayerManager.GetInstance(); AssetLoader.GetInstance(); ViewCameraManager.GetInstance().Init(); LayerManager.GetInstance().Init(); RemoteCallLogic.GetInstance(); NGUIManager.GetInstance(); LoginController.GetInstance(); SceneLogic.GetInstance(); PlayerController.GetInstance(); BagLogic.GetInstance(); NpcLogic.GetInstance(); TimeManager.GetInstance(); ViewManager.GetInstance(); gameObject.AddComponent("CronJob"); LoadResource(); //ActiveRush.InitFx(); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_g2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao01_lipihuashantexiao")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao03_xuanfengzhan_mingzhong2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_mingzhong_g")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao_wuqifeixing")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao04_yuanyuewandao")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_badao02_nuzhanbahuang_gongji")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_06_nuhou_shifa")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_05_zhenfei")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_skill_daobin_04_chongfeng_mingzhong")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_guaiwusiwang2")); AssetLoader.GetInstance().PreLoad(URLUtil.GetEffectPath("effect_levelup")); AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan_yellow"), PLAYER_SEL_LoadComplete, AssetType.BUNDLER); AssetLoader.GetInstance().Load(URLUtil.GetEffectPath("effect_guangquan2_red"), NPC_SEL_LoadComplete, AssetType.BUNDLER); PreLoad.GetInstance().OnEnterScene(); SelecterManager.GetInstance(); }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(this.Assets)); foreach (Cursor mouseCursor in Cursor.All) { mouseCursor.Load(Assets); } PostLoad?.Invoke(this, new LoadEventArgs(this.Assets)); }
public static void Load(Assembly assembly, AppDomain appDomain = null) { if (libs.ContainsKey(assembly)) { return; } var attrData = assembly.CustomAttributes .FirstOrDefault(a => a.AttributeType == typeof(InitLoaderAttribute)); if (attrData != null) { var p1 = attrData.ConstructorArguments[0]; var initLoaderAtt = (InitLoaderAttribute)Activator.CreateInstance( typeof(InitLoaderAttribute), p1.Value); object t; if (appDomain is null) { t = Activator.CreateInstance(initLoaderAtt.InitType); } else { throw new NotImplementedException(); //t = appDomain.CreateInstanceAndUnwrap( // assembly.FullName, // initLoaderAtt.InitType.FullName); } if (t is LibInitializer init) { LibInfo libInfo = new LibInfo(appDomain, assembly, init); if (!(appDomain is null)) { domainLibs.Add(appDomain, libInfo); } libs.Add(assembly, libInfo); libInfo.Registers.ItemRegistered += Registers_MethodRegistered; PreLoad?.Invoke(libInfo); if (init is PlatformInitializer platformInitializer) { var platform = (PlatformRegister)Activator.CreateInstance(platformInitializer.PlatformType); platformInitializer.Platform = platform; libInfo.Registers.RegisterPlatform(platform); } init.Initialize(libInfo.Registers); OnLoad?.Invoke(libInfo); } } }
public virtual void OnLoad(object sender, RoutedEventArgs e) { this.Loaded -= OnLoad; PreLoad?.Invoke(this, EventArgs.Empty); if (DesignerProperties.GetIsInDesignMode(this)) { return; } if (this.Type == null) { throw new InvalidOperationException("Type property is not set for control {0}".FormatWith(LabelText)); } }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(Assets)); foreach (Dialog dialog in Dialogs) { dialog.Load(); } foreach (Window window in Windows) { window.Load(); } Mouse.Load(); PostLoad?.Invoke(this, new LoadEventArgs(Assets)); }
static void Load(SaveFile saveFile) { Migrations.Migrate(saveFile); PreLoad?.Invoke(); GameTime.save = saveFile.gameTime; CurrencySystem.instance.save = saveFile.currency; ConveyorSystem.instance.save = saveFile.conveyor; MachineSystem.instance.save = saveFile.machine; TileSelectionManager.instance.save = saveFile.tileSelection; OverviewCameraController.instance.save = saveFile.overviewCameraController; Analytics.instance.save = saveFile.analytics; BackgroundMusic.instance.SetSave(in saveFile.backgroundMusic); InterfaceSelectionManager.instance.SetSave(in saveFile.interfaceSelection); MachineGroupAchievements.instance.SetSave(in saveFile.machineGroupAchievements); MachineUnlockSystem.instance.SetSave(in saveFile.machineUnlocks); ProgressionStore.instance.SetSave(in saveFile.progressionSystem); SpacePlatform.SetSave(in saveFile.spacePlatforms); PostLoad?.Invoke(); LoadComplete?.Invoke(); }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(Assets)); this.background = this.Assets.CreateTexture2D(1, 1); background.SetData(new[] { Background }); InternalLoad(); if (!isWidthSet) { Width = DefaultWidth; } if (!isHeightSet) { Height = DefaultHeight; } this.IsLoaded = true; PostLoad?.Invoke(this, new LoadEventArgs(Assets)); }
void Start() { preLoad = gameObject.GetComponent <PreLoad>(); }
protected virtual void OnPreLoad() => PreLoad?.Invoke(this, EventArgs.Empty);