[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs bfb089d1de 213/472: Exctract init code to a functi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs bfb089d1de 213/472: Exctract init code to a function (#115) |
Date: |
Thu, 6 Jan 2022 21:59:25 -0500 (EST) |
branch: elpa/pacmacs
commit bfb089d1def3eb2fe51d4bd90d05cccb8556ec53
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Exctract init code to a function (#115)
---
pacmacs.el | 10 +++++++---
tools/it-recorder.el | 15 ++-------------
2 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/pacmacs.el b/pacmacs.el
index 39c5844bda..701ded9857 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -89,19 +89,23 @@
;;;###autoload
(defun pacmacs-start ()
(interactive)
+ (pacmacs--initialize-game 'pacmacs-tick)
+ (pacmacs-mode))
+
+(defun pacmacs--initialize-game (tick-function)
(switch-to-buffer pacmacs-buffer-name)
- (pacmacs-mode)
(setq pacmacs-lives 3)
(setq pacmacs-score 0)
(setq pacmacs-levels (pacmacs--get-list-of-levels))
(setq pacmacs-current-level 0)
-
+
(pacmacs--load-current-level)
(pacmacs--switch-to-play-state)
(unless pacmacs-timer
- (setq pacmacs-timer (run-at-time nil (* pacmacs-tick-duration-ms 0.001)
'pacmacs-tick))))
+ (setq pacmacs-timer (run-at-time nil (* pacmacs-tick-duration-ms 0.001)
+ tick-function))))
(defun pacmacs-destroy ()
(when pacmacs-timer
diff --git a/tools/it-recorder.el b/tools/it-recorder.el
index f65d1aff6c..e31424152d 100644
--- a/tools/it-recorder.el
+++ b/tools/it-recorder.el
@@ -55,17 +55,6 @@
(defun pacmacs--start-it-recorder ()
(interactive)
- (switch-to-buffer pacmacs-buffer-name)
+ (pacmacs--initialize-game 'pacmacs-record-tick)
(pacmacs-it-recorder-mode)
-
- (setq pacmacs-lives 3)
- (setq pacmacs-score 0)
- (setq pacmacs-levels (pacmacs--get-list-of-levels))
- (setq pacmacs-current-level 0)
- (pacmacs--reset-recorder)
-
- (pacmacs--load-current-level)
- (pacmacs--switch-to-play-state)
-
- (unless pacmacs-timer
- (setq pacmacs-timer (run-at-time nil (* pacmacs-tick-duration-ms 0.001)
'pacmacs-record-tick))))
+ (pacmacs--reset-recorder))
- [nongnu] elpa/pacmacs f28d928e89 177/472: Update README.md, (continued)
- [nongnu] elpa/pacmacs f28d928e89 177/472: Update README.md, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8b44939a29 179/472: Merge pull request #121 from kRITZCREEK/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 368609060e 182/472: Add Win animation for Ghost. Close #90, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2c1881afdf 185/472: Compile the project on CI (#123), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 94c3a3cc1e 191/472: Merge branch 'master' into board-refactoring-105, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b03ee65528 195/472: Merge branch 'board-refactoring-105'. Close #105, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs f84acb56ad 201/472: Double dash load-map function (#126), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e13b23bc34 206/472: Remove object-at-p predicate, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0c0f6c141c 210/472: Merge branch 'master' into integration-test-recorder-115, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e64420ace4 209/472: Fix meta for Red-Ghost-Win animation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs bfb089d1de 213/472: Exctract init code to a function (#115),
ELPA Syncer <=
- [nongnu] elpa/pacmacs 09c0a15f40 217/472: Get pacmacs--object-at-p back (#122), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs daca08b8b1 219/472: Add another it case (#122), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ed46a4b500 221/472: Add big pills sprites. Close #82, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ca32745bcb 224/472: Refactor char making duplicate code (#81), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5f7b4fcb12 235/472: Rename pacmacs--put-dot function (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ba28d344be 068/472: Remove copypaste (#54), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 49e0ff0fe8 020/472: Cask: take package info from pacman.el file, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7a8db8e06c 228/472: Merge branch 'xbm-flip-bit-hack-133'. Close #133, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs f65f288b18 239/472: Cache wall tiles (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs edf7600fca 237/472: Add functions for drawing bars (#131), ELPA Syncer, 2022/01/06