Skip to content

Add nightmode theme#119

Merged
nthykier merged 1 commit intosingularity:masterfrom
cryptarch:master
Jul 26, 2019
Merged

Add nightmode theme#119
nthykier merged 1 commit intosingularity:masterfrom
cryptarch:master

Conversation

@cryptarch
Copy link
Contributor

This pull request adds a black-and-red theme intended to be easier on the eyes when playing in dark environments.

It is based on the "vector" theme: the earth map is the same as the vector "night" map, except recoloured to black with red tracings using the Gnu Image Manipulation Program (GIMP).

Some improvement could be done with colouring the Research/Task sliders, but the theme is usable enough as it is for people to try out and provide feedback.

@Xenega
Copy link
Member

Xenega commented Dec 21, 2018

Add some screenshots, so people could see your theme in action.

@cryptarch
Copy link
Contributor Author

Main menu

Intro

Base dialog

Build dialog

Research/Task sliders

Endgame

@rofl0r
Copy link

rofl0r commented Dec 22, 2018

attention: this PR includes potentially copyrighted fonts.
also it has a merge commit (i personally don't merge PR's with merge commits in them)

@cryptarch
Copy link
Contributor Author

@rofl0r It uses the same fonts as already used in Singularity? Given that they are already licensed for use in Singularity, then there is no violation that could result from reusing them in a different theme.

You might need to explain more about what you think the possible violation is here.

How to avoid merge-commits? Rebase?

@cryptarch
Copy link
Contributor Author

@rofl0r

this PR includes potentially copyrighted fonts

Well, yes, given the author is still alive then they own copyright. That is true of everything, Singularity itself included.

The question is, has the copyright holder released them under a free licence? If not then they had better be removed from the other themes as well.

@rofl0r
Copy link

rofl0r commented Dec 22, 2018

@rofl0r It uses the same fonts as already used in Singularity?

attention: this PR includes potentially copyrighted fonts.

i'm not refering to usage, i'm refering to inclusion. you packed the ttf files themselves into the commit.

How to avoid merge-commits? Rebase?

yeah, you rebase on master before commiting or do your work in a new branch based on master. (you can force-push your branch after the rebase to update the PR here)

@cryptarch
Copy link
Contributor Author

I've checked the licence. It is all in the README. You might want to familiarise yourself with it ;)

To summarise: Everything under data is CC BY-SA; the fonts themselves are under "do whatever you feel like" licence.

@cryptarch
Copy link
Contributor Author

@rofl0r I did the rebase/force-push as you suggested, can you confirm that aspect of the pull request seems okay to you now?

I'm open to suggestion about how to do the ttf differently; I just modelled the new theme off the themes already present. As for licence issues, you're jumping at shadows ;)

@rofl0r
Copy link

rofl0r commented Dec 22, 2018

@rofl0r I did the rebase/force-push as you suggested, can you confirm that aspect of the pull request seems okay to you now?

yes

I've checked the licence. It is all in the README. You might want to familiarise yourself with it ;)

i wasn't aware that singularity already ships the deja vu font, which has a rather lengthy license (but as you say it's in README).

nonetheless with your commit, these files are now duplicated in 2 directories, which is quite inefficient and bloats the repo by >0.5MB.

if the current theme logic requires the fonts to be stored per-game, this should be reconsidered.

@cryptarch
Copy link
Contributor Author

Hi @rofl0r

Thanks for the feedback.

I agree that files shouldn't be duplicated over and over, even though it doesn't actually change the size of the Git repo itself, only the checked-out size. Git will store identical files under the same blob.

To prevent redundancy in the filesystem, I might propose that there be a data/fonts folder, and that each theme.dat should just name the preferred font for the theme, rather than looking under data/themes/<theme_name>/fonts. I mean, theme.dat is basically set up in that way already, it will just be a matter of changing the search path I think?

However, that kind of change seems outside the scope of the current pull request. If the nightmode theme gets merged in, and this motivates a change in the way fonts get handled in themes, I'm not disinterested in helping with the follow-up work of changing the search path. But one step at a time :)

@Xenega
Copy link
Member

Xenega commented Dec 22, 2018

Currently, all them inherit from default theme content. You don't need to add something present in default theme, so you should remove font, you don't need them if you don't modify them.

@cryptarch
Copy link
Contributor Author

Hi @Xenega

I tried removing the fonts and it gave an error:

$ python2 singularity.py
pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
Invalid or missing 'grab' setting in preferences.
Traceback (most recent call last):
  File "singularity.py", line 23, in <module>
    import code.singularity
  File "/home/<username>/src/singularity/code/singularity.py", line 273, in <module>
    graphics.g.init_graphics_system()
  File "/home/<username>/src/singularity/code/graphics/g.py", line 104, in init_graphics_system
    theme.current.init_cache()
  File "/home/<username>/src/singularity/code/graphics/theme.py", line 169, in init_cache
    self._variants[variant].init_cache()
  File "/home/<username>/src/singularity/code/graphics/theme.py", line 223, in init_cache
    g.fonts[font_name] = g.load_font(font_filename)
  File "/home/<username>/src/singularity/code/graphics/g.py", line 164, in load_font
    font[i] = pygame.font.Font(filename, i)
IOError: unable to read font file '/home/<username>/src/singularity/data/themes/nightmode/fonts/acknowtt.ttf'

@cryptarch
Copy link
Contributor Author

(I did just send up an amended commit to fix the French and Russian translation of "Night mode", which previously had been left at default.)

@rofl0r
Copy link

rofl0r commented Dec 22, 2018

i suspect you gotta remove the fonts-related lines from your theme, too

@cryptarch
Copy link
Contributor Author

@rofl0r Thanks, that did the trick. I've pushed up an amendment which removes the fonts.

@Xenega
Copy link
Member

Xenega commented Dec 24, 2018

@cryptarch The earth image is the same than earth-night? Is it deliberate?

@cryptarch
Copy link
Contributor Author

@Xenega Yeah, that was deliberate. It didn't look so good to have the continents filled up with red light, so I decided to have both maps be the same, based on the "vector" theme's night map.

@Xenega
Copy link
Member

Xenega commented Jan 30, 2019

@Xenega Yeah, that was deliberate. It didn't look so good to have the continents filled up with red light, so I decided to have both maps be the same, based on the "vector" theme's night map.

I think we could find a solution. Just fill the continent with a darker shade of red.

Otherwise the theme is really good, but there always a lot of defect. A lot are from hardcoded things, so I will resolve them this week-end.

@cryptarch
Copy link
Contributor Author

Thanks, I'll try out the darker shade of red idea. I'll look into it on the weekend.

@cryptarch
Copy link
Contributor Author

Hi @Xenega

I think the idea of using a darker shade of red worked well. The land masses are now filled with #400000 and I found it quite comfortable to play.

@cryptarch
Copy link
Contributor Author

@Xenega I've amended the PR to include simple_menu_background and simple_menu_border settings consistent with #134

@nthykier
Copy link
Member

@cryptarch Thanks for creating the theme. :)

@nthykier nthykier merged commit 9f093bc into singularity:master Jul 26, 2019
@cryptarch
Copy link
Contributor Author

Thanks!

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.

5 participants