Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some things added #1

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
little changes
asakura42 authored Sep 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit db9c42bfecb196092c8c5c14f7ecb7ae0895b9a9
9 changes: 5 additions & 4 deletions src/main.nim
Original file line number Diff line number Diff line change
@@ -74,6 +74,7 @@ let
prefix & "/" & cfg.getSectionValue("Animation Frames", "EyeBlink"),
prefix & "/" & cfg.getSectionValue("Animation Frames", "Talk1"),
prefix & "/" & cfg.getSectionValue("Animation Frames", "Talk2"),
prefix & "/" & cfg.getSectionValue("Animation Frames", "Talk3"),
prefix & "/" & cfg.getSectionValue("Emotions", "Amused"),
prefix & "/" & cfg.getSectionValue("Emotions", "Good"),
prefix & "/" & cfg.getSectionValue("Emotions", "Bad"),
@@ -123,13 +124,13 @@ while not quit:
of KeyDown:
case e.key.keysym.sym
of K_1:
frame = 4 # frame for Amused
frame = 5 # frame for Amused
keyIsPressed = true
of K_2:
frame = 5 # frame for Good
frame = 6 # frame for Good
keyIsPressed = true
of K_3:
frame = 6 # frame for Bad
frame = 7 # frame for Bad
keyIsPressed = true
else:
discard
@@ -159,7 +160,7 @@ while not quit:
timeSinceLastBlink = currentTime - lastBlinkTime

if isTalking or ticks - stoppedTalkingAt < talkCooldown.uint32:
frame = 2 + ticks.int div 250 mod 2
frame = 2 + ticks.int div 250 mod 3
elif timeSinceLastBlink >= blinkInterval.uint32:
if timeSinceLastBlink - blinkDuration.uint32 <= blinkInterval.uint32:
frame = 1