Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
36a4e395
Commit
36a4e395
authored
May 28, 2023
by
timel
Committed by
Chunchi Che
May 28, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: colorful console; export module
parent
1dd518a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
+22
-3
src/env.d.ts
src/env.d.ts
+7
-1
src/infra/console.ts
src/infra/console.ts
+10
-0
src/infra/eventbus.ts
src/infra/eventbus.ts
+2
-0
src/infra/index.ts
src/infra/index.ts
+1
-0
src/service/duel/move.ts
src/service/duel/move.ts
+2
-2
No files found.
src/env.d.ts
View file @
36a4e395
...
...
@@ -18,7 +18,13 @@ import { EventEmitter } from "eventemitter3";
declare
global
{
var
eventBus
:
EventEmitter
;
var
myExtraDeckCodes
:
number
[];
e
xport
e
num
Report
{
enum
Report
{
Move
=
"
move
"
,
}
interface
Console
{
color
:
(
color
:
string
,
backgroundColor
?:
string
)
=>
(...
args
:
any
[])
=>
void
;
}
}
src/infra/console.ts
0 → 100644
View file @
36a4e395
console
.
color
=
(
color
:
string
,
backgroundColor
?:
string
)
=>
(...
args
:
any
[])
=>
{
console
.
log
(
`%c
${
args
.
join
(
"
"
)}
`
,
`color:
${
color
}
; backgroundColor:
${
backgroundColor
??
"
none
"
}
`
);
};
export {};
src/infra/eventbus.ts
View file @
36a4e395
...
...
@@ -8,3 +8,5 @@ enum Report {
// @ts-ignore
window
.
Report
=
Report
;
export
{};
src/infra/index.ts
View file @
36a4e395
...
...
@@ -4,3 +4,4 @@
export
*
from
"
./eventbus
"
;
export
*
from
"
./sleep
"
;
export
*
from
"
./stream
"
;
export
*
from
"
./console
"
;
src/service/duel/move.ts
View file @
36a4e395
...
...
@@ -31,10 +31,10 @@ export default async (move: MsgMove) => {
// log出来看看,后期删掉即可
(
async
()
=>
{
const
{
text
}
=
await
fetchCard
(
code
);
console
.
info
(
console
.
color
(
"
green
"
)
(
`
${
text
.
name
}
${
ygopro
.
CardZone
[
fromZone
]}
:
${
from
.
sequence
}
→
${
ygopro
.
CardZone
[
toZone
]}
:
${
to
.
sequence
}
`
);
// console.
info
("overlay", from.overlay_sequence, to.overlay_sequence);
// console.
color("green")
("overlay", from.overlay_sequence, to.overlay_sequence);
})();
let
target
:
CardType
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment