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

Add a default clock mod #7635

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Add a default clock mod #7635

merged 2 commits into from
Jan 10, 2025

Conversation

glebm
Copy link
Collaborator

@glebm glebm commented Jan 10, 2025

This mod renders a clock in the top-right corner and is always available (disabled by default).

It is useful to have a mod available by default as we work on mod support.

Screenshot from 2025-01-10 08-48-52

/cc @nelchael who did the first attempt at this in Nov 2023 in #6775

glebm added 2 commits January 10, 2025 08:46
This mod renders a clock in the top-right corner
and is always available (disabled by default).

It is useful to have a mod available by default
as we work on mod support.
@AJenbo
Copy link
Member

AJenbo commented Jan 10, 2025

you read my mind :)

@glebm glebm enabled auto-merge (rebase) January 10, 2025 08:55
std::vector<std::string> modNames = ini->getKeys(key);

// Add mods available by default:
for (const std::string_view modName : { "clock" }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully we can get this to scan the mod folder instead

Copy link
Collaborator Author

@glebm glebm Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The built-in lua/mods folder may be in devilutionx.mpq, which is tricky to scan

local render = require("devilutionx.render")

events.GameDrawComplete.add(function()
render.string(os.date('%H:%M:%S', os.time()), render.screen_width() - 69, 6)
Copy link
Member

@AJenbo AJenbo Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting number of px 🤔

@glebm glebm merged commit 7668de3 into diasurgical:master Jan 10, 2025
23 checks passed
@glebm glebm deleted the lua-time branch January 10, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants