Esempio n. 1
0
        private void OnAddClick(MyGuiControlButton sender)
        {
            MyGuiScreenEditorConnectPrefab connectPrefabScreen = new MyGuiScreenEditorConnectPrefab();

            connectPrefabScreen.OnSubmit += ConnectPrefabScreen_OnSubmit;
            MyGuiManager.AddScreen(connectPrefabScreen);
        }
Esempio n. 2
0
        private void ConnectPrefabScreen_OnSubmit(object sender, EventArgs e)
        {
            MyGuiScreenEditorConnectPrefab connectPrefabScreen = (MyGuiScreenEditorConnectPrefab)sender;

            uint prefabId = connectPrefabScreen.PrefabId;
            MyConnectEntityOperation result = PrefabSecurityControlHUB.ConnectEntity(prefabId);

            switch (result)
            {
            case MyConnectEntityOperation.AlreadyConnected:
                DisplayErrorMessage(MyTextsWrapperEnum.EntityIsAlreadyConnected);
                break;

            case MyConnectEntityOperation.NotExists:
                DisplayErrorMessage(MyTextsWrapperEnum.EntityIsNotExist);
                break;

            case MyConnectEntityOperation.NotSupported:
                DisplayErrorMessage(MyTextsWrapperEnum.EntityIsNotSupported);
                break;

            case MyConnectEntityOperation.Success:
                m_connectedPrefabIdsListbox.AddItem((int)prefabId, new StringBuilder(prefabId.ToString()));
                connectPrefabScreen.CloseScreen();
                break;

            default:
                throw new MyMwcExceptionApplicationShouldNotGetHere();
            }
        }
 private void OnAddClick(MyGuiControlButton sender) 
 {
     MyGuiScreenEditorConnectPrefab connectPrefabScreen = new MyGuiScreenEditorConnectPrefab();
     connectPrefabScreen.OnSubmit += ConnectPrefabScreen_OnSubmit;
     MyGuiManager.AddScreen(connectPrefabScreen);
 }