MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Update

Method Update

project.go:236–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234}
235
236func (project *Project) Update() {
237
238 if globals.NextProject != nil && globals.NextProject != project {
239 // You're the old project, so you can just chill. We do this
240 // because otherwise, a card may use a resource that got destroyed
241 // to render.
242 return
243 }
244
245 project.AutoBackup()
246
247 project.Camera.Update()
248
249 globals.Mouse.HiddenPosition = false
250
251 for _, page := range project.Pages {
252 if page.Valid() {
253 page.Update()
254 }
255 }
256
257 globals.Mouse.HiddenPosition = false
258
259 project.GlobalShortcuts()
260
261 globals.InputText = []rune{}
262
263 project.UndoHistory.Update()
264
265 // This should only be true for a total of essentially 1 or 2 frames, immediately after loading
266 project.Loading = false
267
268 if project.Modified && project.justModified {
269 globals.Dispatcher.Run()
270 }
271
272 project.justModified = false
273
274}
275
276// SetModifiedState sets the modified variable for the Project to true, but also sets justModified to true, allowing the Dispatcher to run to make things happen when the project is altered in some appreciable way.
277func (project *Project) SetModifiedState() {

Callers

nothing calls this directly

Calls 5

AutoBackupMethod · 0.95
GlobalShortcutsMethod · 0.95
UpdateMethod · 0.65
ValidMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected