You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removed PositionSelector (can now drag AreaSelector), Click on ChildStoryItem selects it properly in EditMode, Resize of AreaSelector resizes selected item to that new size, Added UseStoryTimer toggle button to autonavigate to Next StoryPoint every 8sec, Zooming correctly to ActiveStoryItem after LoadFromSavedState
//ZoomFrame.ScrollBox.AniCalculations.AutoShowing := true; //fade the toolbars when not active //TODO: doesn't work with direct mouse drags near the bottom and right edges (scrollbars do show when scrolling e.g. with mousewheel) since there's other HUD content above them (the navigation and the edit sidebar panes)
144
151
LoadSavedStateOrNewRootStoryItem;
@@ -176,6 +183,11 @@ procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Cha
176
183
end;
177
184
end;
178
185
186
+
procedureTMainForm.FormResize(Sender: TObject);
187
+
begin
188
+
ActiveStoryItem := ActiveStoryItem; //keep the ActiveStoryItem in view
189
+
end;
190
+
179
191
{$ENDREGION}
180
192
181
193
{$region 'IStory'}
@@ -290,32 +302,39 @@ procedure TMainForm.SetActiveStoryItem(const Value: IStoryItem); //TODO: should
290
302
begin
291
303
if Assigned(partialRoot) then
292
304
begin
293
-
TStoryItem(partialRoot).EditMode := false; //TODO: see StoryMode of IStoryItem instead
294
-
TStoryItem(partialRoot).Enabled := true; //re-enable if previously disabled due to EditMode of its parent
305
+
var StoryItem := TStoryItem(partialRoot.View);
306
+
StoryItem.EditMode := false; //TODO: see StoryMode of IStoryItem instead
307
+
StoryItem.Enabled := true; //restore any items that had been left disabled accidentally
308
+
//StoryItem.Enabled := (StoryMode <> EditMode) and (StoryItem <> RootStoryItemView); //TODO: test
295
309
296
310
//Do for item's children too if any
297
-
forvarStoryItemin partialRoot.StoryItems do
298
-
RecursiveClearEditMode(StoryItem);
311
+
forvarChildStoryItemin partialRoot.StoryItems do
312
+
RecursiveClearEditMode(ChildStoryItem);
299
313
end;
300
314
end;
301
315
302
316
begin
303
-
TStoryItem.ActiveStoryItem := Value;
304
-
ZoomTo(Value);
305
-
306
317
RecursiveClearEditMode(RootStoryItemView); //Clear EditMode from all items recursively
307
318
308
319
//Set any current editmode to the newly active item
309
320
if Assigned(Value) then
310
-
begin
321
+
begin
311
322
var StoryItem := TStoryItem(Value.View);
312
-
StoryItem.EditMode := HUD.EditMode; //TODO: see StoryMode of IStoryItem instead (or move that to the IStory)
313
-
StructureView.SelectedObject := Value.View;
314
-
end
323
+
with StoryItem do
324
+
begin
325
+
EditMode := HUD.EditMode; //TODO: see StoryMode of IStoryItem instead (or move that to the IStory)
326
+
//AreaSelector := RootStoryItemView.AreaSelector; //re-use RootStoryItem's AreaSelector (so that we don't get drawing artifacts when resizing area selector and is always on top of everything when extending outside of ActiveStoryItem's bounds - since that can have children that are not inside its area, like a speech bubble for a character) //TODO: not working correctly
327
+
end;
328
+
//Change StructureView selection
329
+
StructureView.SelectedObject := StoryItem;
330
+
end
315
331
else
316
332
StructureView.SelectedObject := nil;
317
333
318
334
//HUD.actionDelete.Visible := (ActiveStoryItem.View <> RootStoryItem.View); //doesn't seem to work (neither HUD.btnDelete.Visible does), but have implemented delete of RootStoryItem as a call to actionNew.Execute instead
procedureTMainForm.StoryTimerTimer(Sender: TObject); //TODO: should show some timer animation at top-right when the story timer is enabled (AnimatedStoryMode)
448
+
begin
449
+
//special case used at app startup
450
+
ifnot FTimerStarted then//TODO: should check if we loaded from saved state and remember if we were playing the timer and continue [see CCR.PrefsIniFile github repo maybe to keep app settings])
451
+
begin
452
+
ActiveStoryItem := ActiveStoryItem; //re-apply ActiveStoryItem (needed upon app first loading to ZoomTo ActiveStoryItem from loaded saved state
453
+
StoryTimer.Enabled := false;
454
+
exit;
455
+
end;
456
+
457
+
ActivateNextStoryPoint;
458
+
459
+
if ActiveStoryItem.Home then
460
+
HUD.UseStoryTimer := false; //TODO: should instead define EndStoryPoint(s) and stop the timer once the end is reached
0 commit comments