public override void Use(UseActionEnum actionEnum, IMyEntity entity) { var user = entity as MyCharacter; var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId); if (!relation.IsFriendly()) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } switch (actionEnum) { case UseActionEnum.OpenTerminal: MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Block); break; case UseActionEnum.OpenInventory: if (Block.GetInventory(0) as MyInventory != null) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block); } break; } }
public override void Use(UseActionEnum actionEnum, IMyEntity entity) { var user = entity as MyCharacter; var relation = Door.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId); if (!relation.IsFriendly()) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } switch (actionEnum) { case UseActionEnum.Manipulate: Door.SetOpenRequest(!Door.Open, user.ControllerInfo.ControllingIdentityId); break; case UseActionEnum.OpenTerminal: MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Door); break; } }
void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity) { var user = entity as MyCharacter; var relation = Door.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId); if (relation != Common.MyRelationsBetweenPlayerAndBlock.Owner && relation != Common.MyRelationsBetweenPlayerAndBlock.FactionShare) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } switch (actionEnum) { case UseActionEnum.Manipulate: Door.SetOpenRequest(!Door.Open, user.ControllerInfo.ControllingIdentityId); break; case UseActionEnum.OpenTerminal: MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Door); break; } }
public void ShowTerminal(string blockId) { var block = m_lowLevelObserver.GetBlockById(blockId); block.FatBlock.ThrowIfNull("Block has to be functional to show terminal"); MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, Character, block.FatBlock); }
public override void ShowInventory() { if (m_enableShipControl) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, m_pilot, this); } }
void IMyUseObject.Use(UseActionEnum actionEnum, MyCharacter user) { var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId); if (relation != Common.MyRelationsBetweenPlayerAndBlock.Owner && relation != Common.MyRelationsBetweenPlayerAndBlock.FactionShare) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } switch (actionEnum) { case UseActionEnum.OpenTerminal: MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Block); break; case UseActionEnum.OpenInventory: if (Block as IMyInventoryOwner != null) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block); } break; } }
public void Use(UseActionEnum actionEnum, MyCharacter user) { var relation = GetUserRelationToOwner(user.ControllerInfo.Controller.Player.Identity.IdentityId); if (!relation.IsFriendly()) { if (user.ControllerInfo.Controller.Player == MySession.Static.LocalHumanPlayer) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } if (actionEnum == UseActionEnum.OpenTerminal) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, this); } else if (actionEnum == UseActionEnum.Manipulate) { if (m_user != null && m_user != user) { return; } MyMultiplayer.RaiseEvent(this, x => x.RequestUse, actionEnum, user.EntityId); } }
void IMyUseObject.Use(UseActionEnum actionEnum, IMyEntity entity) { var user = entity as MyCharacter; var relation = Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId); if (!relation.IsFriendly()) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } switch (actionEnum) { case UseActionEnum.OpenInventory: case UseActionEnum.OpenTerminal: MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block); break; default: //MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Block); break; } }
private void OnOwnerUse(UseActionEnum actionEnum, MyCharacter user) { if (actionEnum == UseActionEnum.Manipulate) { OpenWindow(true, true, false); } else if (actionEnum == UseActionEnum.OpenTerminal) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, this); } }
public override void ShowInventory() { base.ShowInventory(); if (m_enableShipControl) { var user = GetUser(); if (user != null) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, this); } } }
private void OnFactionUse(UseActionEnum actionEnum, MyCharacter user) { bool isAccessible = IsAccessibleForFaction; bool readOnlyNotification = false; if (IsAccessibleForFaction) { if (actionEnum == UseActionEnum.Manipulate) { if (IsWritableForFaction) { OpenWindow(true, true, false); } else if (IsReadableForFaction) { OpenWindow(false, true, false); } else { Debug.Fail("Unknown state of text panel"); } } else if (actionEnum == UseActionEnum.OpenTerminal) { if (IsWritableForFaction) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, this); } else { readOnlyNotification = true; } } } if (user.ControllerInfo.Controller.Player == MySession.LocalHumanPlayer) { if (!isAccessible) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } else if (readOnlyNotification) { MyHud.Notifications.Add(MyNotificationSingletons.TextPanelReadOnly); } } }
public override void Use(UseActionEnum actionEnum, IMyEntity entity) { var user = entity as MyCharacter; var block = Entity as MyCubeBlock; if (block != null) { var relation = block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId); if (!relation.IsFriendly()) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } return; } } //by Gregory: on use action the button pressed should be checked because on use action we will always get only Inventory TODO: refactor somehow if (MyInput.Static.IsNewGameControlPressed(MyControlsSpace.TERMINAL)) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, Entity); } else { MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity); } /* * switch (actionEnum) * { * case UseActionEnum.OpenInventory: * MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity); * break; * case UseActionEnum.OpenTerminal: * MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity); * break; * default: * //MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, Entity); * break; * } */ }
public override void Use(UseActionEnum actionEnum, IMyEntity entity) { MyCharacter user = entity as MyCharacter; if (!this.Door.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId).IsFriendly() && !MySession.Static.AdminSettings.HasFlag(AdminSettingsEnum.UseTerminals)) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } } else if (actionEnum == UseActionEnum.Manipulate) { this.Door.SetOpenRequest(!this.Door.Open, user.ControllerInfo.ControllingIdentityId); } else if (actionEnum == UseActionEnum.OpenTerminal) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, this.Door); } }
public override void Use(UseActionEnum actionEnum, IMyEntity entity) { if (MySession.Static.CheckDLCAndNotify(this.Block.BlockDefinition)) { MyCharacter user = entity as MyCharacter; if (!this.Block.GetUserRelationToOwner(user.ControllerInfo.ControllingIdentityId).IsFriendly() && !MySession.Static.AdminSettings.HasFlag(AdminSettingsEnum.UseTerminals)) { if (user.ControllerInfo.IsLocallyHumanControlled()) { MyHud.Notifications.Add(MyNotificationSingletons.AccessDenied); } } else if (actionEnum == UseActionEnum.OpenTerminal) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, this.Block); } else if ((actionEnum == UseActionEnum.OpenInventory) && (this.Block.GetInventory(0) != null)) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.Inventory, user, this.Block); } } }
private void OnFactionUse(UseActionEnum actionEnum, MyCharacter user) { bool readOnlyNotification = false; if (actionEnum == UseActionEnum.Manipulate) { var relation = GetUserRelationToOwner(user.GetPlayerIdentityId()); if (relation == MyRelationsBetweenPlayerAndBlock.FactionShare) { OpenWindow(true, true, true); } else { OpenWindow(false, true, true); } } else if (actionEnum == UseActionEnum.OpenTerminal) { var relation = GetUserRelationToOwner(user.GetPlayerIdentityId()); if (relation == MyRelationsBetweenPlayerAndBlock.FactionShare) { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, user, this); } else { readOnlyNotification = true; } } if (user.ControllerInfo.Controller.Player == MySession.Static.LocalHumanPlayer) { if (readOnlyNotification) { MyHud.Notifications.Add(MyNotificationSingletons.TextPanelReadOnly); } } }
public override void ShowTerminal() { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, m_pilot, this); }
public override void ShowTerminal() { MyGuiScreenTerminal.Show(MyTerminalPageEnum.ControlPanel, MySession.LocalHumanPlayer.Character, this); }