Example #1
0
 //private void SnapTilesSelectedToGrid() {
 //    foreach (RoomTile tile in tilesSelected) {
 //        Vector2 pos = tile.MyRoomData.PosGlobal;
 //        pos = SnapToGrid(pos);
 //        tile.MyRoomData.SetPosGlobal(pos);
 //    }
 //}
 private void ToggleTilesSelectedIsSecret()
 {
     // Toggle and save 'em all.
     foreach (RoomTile tile in tilesSelected)
     {
         RoomData rd = tile.MyRoomData;
         rd.SetIsSecret(!rd.IsSecret);
         RoomSaverLoader.UpdateRoomPropertiesInRoomFile(rd);
         tile.RefreshAllVisuals();
     }
 }
Example #2
0
 private void ToggleTilesSelectedIsClustStart()
 {
     // Toggle and save 'em all.
     foreach (RoomTile tile in tilesSelected)
     {
         RoomData rd = tile.MyRoomData;
         rd.isClustStart = !rd.isClustStart;
         RoomSaverLoader.UpdateRoomPropertiesInRoomFile(rd);
     }
     // Reload the world, as our Clusters may have changed from this.
     ReloadAllTiles();
 }
Example #3
0
        private void OnMouseDown()
        {
            RoomData rd = roomTileRef.MyRoomData;
            // Determine the new value of our flag!
            int newDesignerFlagValue = rd.DesignerFlag + 1;

            if (newDesignerFlagValue >= NUM_FLAG_TYPES)
            {
                newDesignerFlagValue = 0;
            }                                                                             // Loop back to 0.
            // Set and save!
            rd.SetDesignerFlag(newDesignerFlagValue);
            RoomSaverLoader.UpdateRoomPropertiesInRoomFile(rd);
            // Update the designerFlag button
            UpdateDesignerFlagButtonVisuals();
        }
Example #4
0
    private void DuplicateCurrRoom()
    {
        // Add a new room file, yo!
        RoomData currRD     = CurrRoom.MyRoomData;
        string   newRoomKey = currRD.MyWorldData.GetUnusedRoomKey(currRD.RoomKey);

        RoomSaverLoader.SaveRoomFileAs(currRD, currRD.WorldIndex, newRoomKey);
        dm.ReloadWorldDatas();
        RoomData newRD = dm.GetRoomData(currRD.WorldIndex, newRoomKey, false);

        newRD.isClustStart = false;                                                           // say new room's NOT a clustStart.
        newRD.SetPosGlobal(newRD.PosGlobal + new Vector2(15, -15) * GameProperties.UnitSize); // offset its position a bit.
        newRD.SetDesignerFlag(0);                                                             // Reset its designerFlag
        RoomSaverLoader.UpdateRoomPropertiesInRoomFile(newRD);                                // update file!
        dm.currRoomData = newRD;
        SceneHelper.ReloadScene();
    }
Example #5
0
        private void OnMouseUp()
        {
            int mouseButton = InputController.GetMouseButtonUp();

            // Dragging a TILE(S), released the LEFT mouse button, AND not holding down the multi-selection key??
            if (tilesSelected.Count > 0 && mouseButton == 0 && !isKeyMultiSelection)
            {
                // Save all dragging tiles' roomData to file (and clear out any snapshot datas)!
                foreach (RoomTile tile in tilesSelected)
                {
                    RoomSaverLoader.UpdateRoomPropertiesInRoomFile(tile.MyRoomData);
                }
                // Update the world-bounds, room neighbors, etc.!
                CurrWorldData.SetAllRoomDatasFundamentalProperties();
                // Update ALL Tiles' visuals.
                foreach (RoomTile tile in CurrWorldRoomTiles)
                {
                    tile.RefreshColors();
                }

//			// Mouse up = release all roomTilesSelected!
//			DeselectTilesSelected();
            }
        }