public static void FetchMission(int missionId) { EconomyScript.Instance.ClientConfig.MissionId++; if (missionId < 0) // debug clear. { Sandbox.Game.MyVisualScriptLogicProvider.SetQuestlogVisible(false); } MissionBaseStruct currentMission = EconomyScript.Instance.ClientConfig.Missions.FirstOrDefault(m => m.MissionId == missionId); if (currentMission == null) missionId = -1; EconomyScript.Instance.ClientConfig.MissionId = missionId; EconomyScript.Instance.ClientConfig.LazyMissionText = currentMission?.GetName(); if (currentMission == null) { //Sandbox.Game.MyVisualScriptLogicProvider.SetQuestlogVisible(false); } else { Sandbox.Game.MyVisualScriptLogicProvider.SetQuestlog(true, currentMission.GetName()); Sandbox.Game.MyVisualScriptLogicProvider.AddQuestlogDetail(currentMission.GetDescription()); } }
public override void ProcessClient() { switch (CommandType) { case PlayerMissionManage.AddMission: EconomyScript.Instance.ClientConfig.Missions.Add(Mission); Mission.AddGps(); if (StartMission) { HudManager.FetchMission(Mission.MissionId); } else { MyAPIGateway.Utilities.ShowMissionScreen("Mission", Mission.MissionId + " : ", Mission.GetName(), Mission.GetDescription(), null, "Yes Sir!"); } Mission.SeenBriefing = true; EconomyScript.Instance.ClientConfig.MissionId = Mission.MissionId; EconomyScript.Instance.ClientConfig.LazyMissionText = Mission.GetName(); HudManager.UpdateHud(); break; default: //MessageClientTextMessage.SendMessage(SenderSteamId, "mission", (MissionId + "client side")); break; } }
public static void FetchMission(int missionId) { EconomyScript.Instance.ClientConfig.MissionId++; MissionBaseStruct currentMission = EconomyScript.Instance.ClientConfig.Missions.FirstOrDefault(m => m.MissionId == missionId); if (currentMission == null) { missionId = -1; } EconomyScript.Instance.ClientConfig.MissionId = missionId; EconomyScript.Instance.ClientConfig.LazyMissionText = currentMission == null ? null : currentMission.GetName(); }