Project Arrhythmia
A video game developed by Vitamin Games.
Loading...
Searching...
No Matches
EditorManager Class Reference

The main editor manager for the editor. More...

+ Inheritance diagram for EditorManager:

Classes

class  EditorDialog
 
struct  LiveNotif
 

Public Types

enum  NotificationType { Info = 3 , Success = 0 , Error = 1 , Warning = 2 }
 

Public Member Functions

void OpenThemeFolder ()
 
void OpenPrefabFolder ()
 
void OpenLevelFolder ()
 
void OpenLink (string _link)
 
void OpenGuides ()
 
void OpenSteamWorkshop ()
 
void OpenDiscord ()
 
void OpenTutorials ()
 
void OpenVerifiedSongs ()
 
float GetTimelinePosition ()
 
float SnapToBPM (float _time, bool _snap)
 
float SnapToBPM (float _time)
 
float GetTimelineTime (float _offset=0, bool _bpmSnap=false)
 
void ClearPopups ()
 
void ToggleEditor (bool _zen=false)
 
void ToggleEditorWithSelectedMode ()
 
void ToggleShowAdvanced ()
 
void SetShowAdvanced (bool _showAdvanced)
 
void ToggleShowGrid ()
 
void ToggleShowFPS ()
 
void SetProjectName (string _projectName)
 
void SetCreatorName (string _creatorName)
 
void SetTrackName (string _trackName)
 
void SetArtistName (string _artistName)
 
void SetDifficulty (int _difficulty)
 
float GetZoomFloat ()
 
float ClampZoomPosToEnds (float _zoomPos)
 
void SetMainTimelineZoom (float _timelinePos)
 
void UpdateScrollbarSize ()
 
int GetObjectLayer ()
 
void SetLayer (int _layer)
 
void SetLayerButton (int _layer)
 
async void GetLevelList ()
 
async System.Threading.Tasks.Task WaitForLevelsToLoad ()
 
void QuitToMenuRaw ()
 
void LoadBaseLevel ()
 
void ResetEditorLevelState ()
 
void DisplayLoadingError (string _text)
 
IEnumerator LoadMusic (string _folder)
 
void ReLoadLevel ()
 
void LoadLevel (MetadataWrapper _level, float _delay=0f)
 
void StartAutosaveInterval ()
 
void HelpfulNChan ()
 
void AutoSaveLevel ()
 
string[] GetAutoSaves ()
 
void NukeOldAutosaves (int _keepMax=3)
 
void DisplayNotification (string _text, float _time, NotificationType _type=NotificationType.Warning)
 Displays a popup to give the user information.
 
void DisplayErrorNotification (string _text, float _time=3)
 
void TogglePlayingSong ()
 Toggles playing of the current song.
 
void UpdatePlayButton ()
 
void UpdateFPS ()
 
void Duplicate ()
 
void Cut ()
 
void Copy (bool _cut=false, bool _dup=false)
 
void Paste (float _offsetTime=0)
 
void Delete ()
 
void SetMusicTime (float _new)
 Sets the time of the music.
 
float SetMusicTime_UI (float _min, float _sec, float _ms)
 Sets the time of the music.
 
void AddToPitch (float _add)
 
void SetPitch (float _value)
 
void UpdateEditButtons ()
 
void Undo ()
 
void Redo ()
 
void SetSaveAsBeatmapName (string _newBeatmapName)
 
void SaveBeatmapAs ()
 
async void SaveBeatmapAs (string _levelName)
 
async void SaveBeatmap ()
 
void SaveMetadata (bool _isLegacy=false)
 
IEnumerator GetSprite (string _path, SpriteLimits _limits, Action< Sprite > callback, System.Action< string, string > onError)
 
IEnumerator GetAlbumSprite (string _levelName, Action< Sprite > callback, System.Action< string, string > onError)
 
void MoveTimeline (float _normalizedAmount)
 
void RenderTimeline (float _timelinePos)
 
void SetTimelineSliderHover (bool _value)
 
void updatePointer ()
 
void UpdateTimelineSizes ()
 
void QuitToMenu ()
 
void QuitGame ()
 
Rect GetEditViewRect ()
 
async System.Threading.Tasks.Task SaveCoverImage (string _imageFilePath, string _levelName)
 
async System.Threading.Tasks.Task SaveCoverImageLegacy (string _imageFilePath, string _levelName)
 
async System.Threading.Tasks.Task SaveCoverImage (string _imageFilePath, string _levelName, bool _isLegacy)
 
string GetTimeToString (float _time)
 
void TimelineJumpToStartExtra ()
 
void TimelineJumpToStart ()
 
void TimelineJumpToEnd ()
 
void TimelineJumpToCurrent ()
 
void TimelineJumpToTime (float _time)
 

Static Public Member Functions

static Rect RectTransformToScreenSpace (RectTransform transform)
 

Public Attributes

List< Color > GridColors = new List<Color>()
 
List< CurveOptionCurveOptions = new List<CurveOption>()
 
float ScreenScale = 1
 
float ScreenScaleInverse = 1
 
WaveGenerator waveformGenerator
 
RectTransform timelineWaveform
 
RectTransform timelineContainer
 
TextMeshProUGUI ZenPreviewModeText
 
ShapesGrid ObjectGridRenderer
 
GameObject MousePositionObject
 
TextMeshProUGUI MousePositionText
 
GameObject[] notificationPrefabs
 
RectTransform CameraRect
 
bool isHoveringUI = false
 
bool DebugSave = false
 
bool LoadingEditorLevels = true
 
History history = new History()
 
bool hasSaved = false
 
DateTime lastSaveTime
 
bool ZenPreviewMode = false
 
bool firstOpened = false
 
bool hasLoadedLevel = false
 
List< Image > AlbumArtSprites = new List<Image>()
 
float prevAudioTime = 0f
 
bool savingBeatmap = false
 
List< string > autosaves = new List<string>()
 
int totalLevelCount = 0
 
List< MetadataWrapperloadedLevels = new List<MetadataWrapper>()
 
RectTransform SelectionBoxImage
 
Vector2 DragStartPos
 
Vector2 DragEndPos
 
Rect SelectionRect
 
Transform TimelineBar
 
UpdateFunctions updateFunctions
 
List< Sprite > KeyframeSprites = new List<Sprite>()
 
readonly Dictionary< int, DG.Tweening.Ease > curveDictionary
 
readonly Dictionary< DG.Tweening.Ease, int > curveDictionaryBack
 
List< GameObject > DropdownMenus
 
AudioClip baseSong
 
string currentLoadedLevel = null
 
Transform PopupParent
 
bool isEditing = false
 
bool OpenLevel = false
 
Sprite arrowSprite
 
Sprite pauseSprite
 
Scrollbar timelineScrollRectBar
 
ScrollRect timelineScrollRect
 
GameObject playButton
 
GameObject GUI
 
GameObject timelineWaveformOverlay
 
GameObject timeline
 
GameObject timelineGrid
 
GameObject markerTimeline
 
bool timelineSliderHovered
 
GameObject timelineSlider
 
GameObject timelineSliderBG
 
GameObject timelineScrollbar
 
GameObject notification
 
string openFileSearch
 
string parentSearch
 
string objectSearch
 
List< string > objectPath
 
string saveAsLevelName
 
GameObject spriteFolderButtonPrefab
 
GameObject crumbButtonPrefab
 
GameObject undoButton
 
GameObject redoButton
 
GameObject deleteButton
 
GameObject speedText
 
Transform dialogs
 
GameObject blankButton
 
GameObject colorGUI
 
GameObject toggleGUI
 
bool showAdvanced = false
 
Toggle ShowGridButton
 
GameObject FPSTextObject
 
TextMeshProUGUI FPSText
 
Toggle ShowFPSButton
 
string projectName = "null string"
 
string creatorName = "null string"
 
string trackName = "null string"
 
string artistName = "null string"
 
int difficulty = 0
 
Vector2 zoomBounds = new Vector2(16, 512)
 
float TimelineZoomPosNormalized
 
bool canChangeViewPos = false
 
List< Toggle > layerSelectors = new List<Toggle>()
 
List< Color > layerColors = new List<Color>()
 
bool updateAudioTime
 
bool wasPlayingOnDrag
 
bool wasDraggingPointer
 
NChanPopup nChanPopup
 
Canvas MainEditorCanvas
 

Static Public Attributes

static EditorManager inst
 
const string PARENT_NAME_PATH = "folder-name"
 
const string PARENT_SHAPE_PATH = "shape-icon/icon"
 
const int EVENT_LAYER = 6
 
static int TimelineOffset = 6
 
static int BaseUnit = 12
 
static int ScreenOffset = 1916
 
const string EDITOR_BEATMAPS_PATH = "beatmaps/editor/"
 

Properties

bool OpenedEditor [get]
 Was the editor opened?
 
bool ClosedEditor [get]
 Was the editor closed?
 
bool IsEditing [get]
 
float CurrentAudioPos [get]
 
bool OpenedLevel [get]
 Was the editor closed?
 
bool ShowGrid [get, set]
 
bool ShowFPS [get, set]
 
float Zoom [get, set]
 
int Layer [get, set]
 
string SetMin [set]
 
string SetSec [set]
 
string SetMS [set]
 

Events

static Action FinishedLoadingLevels
 
static UnityAction< bool > updatedAdvancedVisible
 
Action< float > updatedTimelineZoom
 

Private Member Functions

float posCalc (float _time)
 
void Awake ()
 Make sure there is only one instance of this object.
 
void FinishedLoadingLevelsDefault ()
 
string GetQuitMessage (bool _quitGame=false)
 
void PopupInit ()
 
void TimelineEventsInit ()
 
void InitCurveDropdowns ()
 
void Start ()
 
async System.Threading.Tasks.Task IsDoneLoading_Levels ()
 
void SetFileInfoPopupText (string _text)
 
void StopLoadingLevel ()
 
IEnumerator LoadLevelInternal (MetadataWrapper _level, float _delay=0f)
 
async void AutoSaveCycle (string _path, string _file)
 
void DisplayNotificationLoop (string _text, float _time, NotificationType _type)
 
IEnumerator DestroyNotificationLoop (string _text, GameObject _notification, float _time=0.5f)
 
void DestroyNotification (string _text, GameObject _notification)
 
void Update ()
 
void UpdateTimelineGridScale ()
 
void AssignWaveformTextures ()
 
void SetEditRenderArea ()
 
IEnumerator CameraSetter ()
 
void SetNormalRenderArea ()
 

Private Attributes

bool loadingError = false
 
AudioClip CurrentlyLoadedAudioClip
 
System.Text.StringBuilder sb = new System.Text.StringBuilder()
 
string className = "[<color=#e65100>EditorManager</color>] \n"
 
bool wasEditing = false
 
bool wasOpenLevel = false
 
bool showGrid
 
bool showFPS
 
float zoomFloat = 0f
 
float zoomVal = 16f
 
Debounce CanChangeZoomPosDebounce = new Debounce()
 
int layer = 0
 
int lastLayer = 0
 
EditorPopup QuitGamePopup
 
EditorPopup QuitToMenuPopup
 
string[] CORE_QUIT_MESSAGE
 
string QUIT_GAME_MESSAGE = "Are you sure you want to quit the game?"
 
string QUIT_EDITOR_MESSAGE = "Are you sure you want to quit to the main menu?"
 
string[] QUIT_GAME_MESSAGE_PROGRESS
 
bool isDragging = false
 
MetadataWrapper _currentLevel
 
Dictionary< string, LiveNotifliveNotifTracking = new Dictionary<string, LiveNotif>()
 
int frameCount = 0
 
float dt = 0.0f
 
int fps = 0
 
float updateRate = 4.0f
 

Detailed Description

The main editor manager for the editor.

Member Function Documentation

◆ DisplayNotification()

void EditorManager.DisplayNotification ( string _text,
float _time,
NotificationType _type = NotificationType::Warning )

Displays a popup to give the user information.

Parameters
_textText to be displayed.
_timeAmount of time it will be displayed for.
_isErrorIs it an error?

◆ SetMusicTime()

void EditorManager.SetMusicTime ( float _new)

Sets the time of the music.

Parameters
_newThe new time.

◆ SetMusicTime_UI()

float EditorManager.SetMusicTime_UI ( float _min,
float _sec,
float _ms )

Sets the time of the music.

Parameters
_newThe new time.

Member Data Documentation

◆ CORE_QUIT_MESSAGE

string [] EditorManager.CORE_QUIT_MESSAGE
private
Initial value:
= new string[3]{
"Thank you for your hard work today!",
"The level is looking great so far!",
"I love you and your level ♥"
}

◆ curveDictionary

readonly Dictionary<int, DG.Tweening.Ease> EditorManager.curveDictionary
Initial value:
= new Dictionary<int, DG.Tweening.Ease>(){
{0, DG.Tweening.Ease.Linear},
{1, DG.Tweening.Ease.InSine},
{2, DG.Tweening.Ease.OutSine},
{3, DG.Tweening.Ease.InOutSine},
{4, DG.Tweening.Ease.InElastic},
{5, DG.Tweening.Ease.OutElastic},
{6, DG.Tweening.Ease.InOutElastic},
{7, DG.Tweening.Ease.InBack},
{8, DG.Tweening.Ease.OutBack},
{9, DG.Tweening.Ease.InOutBack},
{10, DG.Tweening.Ease.InBounce},
{11, DG.Tweening.Ease.OutBounce},
{12, DG.Tweening.Ease.InOutBounce}
}

◆ curveDictionaryBack

readonly Dictionary<DG.Tweening.Ease, int> EditorManager.curveDictionaryBack
Initial value:
= new Dictionary<DG.Tweening.Ease, int>() {
{DG.Tweening.Ease.Linear, 0},
{DG.Tweening.Ease.InSine, 1},
{DG.Tweening.Ease.OutSine, 2},
{DG.Tweening.Ease.InOutSine, 3},
{DG.Tweening.Ease.InElastic, 4},
{DG.Tweening.Ease.OutElastic, 5},
{DG.Tweening.Ease.InOutElastic, 6},
{DG.Tweening.Ease.InBack, 7},
{DG.Tweening.Ease.OutBack, 8},
{DG.Tweening.Ease.InOutBack, 9},
{DG.Tweening.Ease.InBounce, 10},
{DG.Tweening.Ease.OutBounce, 11},
{DG.Tweening.Ease.InOutBounce, 12}
}

◆ QUIT_GAME_MESSAGE_PROGRESS

string [] EditorManager.QUIT_GAME_MESSAGE_PROGRESS
private
Initial value:
= new string[3]{
"",
"All level progress since load will be lost.",
"All level progress since [{0}] will be lost."
}

The documentation for this class was generated from the following file: