Gerold55 / laptop

Introducing the MineTest Laptop Mod
Other
25 stars 14 forks source link

Themes #102

Closed Gerold55 closed 6 years ago

Gerold55 commented 6 years ago

Should we be able to make the icons customizable like the other things of the theme?

Last-To-Do List

Gerold55 commented 6 years ago

@grizzly-Adam if I send you some pics of a new theme created by CrossZover could you implement them for me?

Grizzly-Adam commented 6 years ago

I think that would be a good option for future.

Yes, I can impliment them as soon as bell releases the cs-bos update. I dont want to delay it any further.

Gerold55 commented 6 years ago

Ok because @CrossZover has 2 new plain red and blue themes ready. Also a new PCPack is being worked on.

Grizzly-Adam commented 6 years ago

Oh! Can I make a couple suggestions for the new PC pack?

Grizzly-Adam commented 6 years ago

Pls send me those images so I can work on this tonight.

Gerold55 commented 6 years ago

I'll send them tonight after I'm done working

Gerold55 commented 6 years ago

@Grizzly-Adam do you have a business email so I can send them to you?

Grizzly-Adam commented 6 years ago

Just send to my personal. I will PM you on mt.

bell07 commented 6 years ago

I did the tables themeable too

- `table_background` - Table background color
- `table_color` - Table text color
- `table_highlight` - Table highlighted background
- `table_highlight_text` - Table highlighted textcolor
- `table_border` -  draw border (true or false)

@Gerold55, @Grizzly-Adam, can you please propose values for "Default/Freedom" theme and may adjust existing themes? See my pr_tables_theming branch.

I set currently as demo-values:

        table_background='#000000',
        table_color='#FFFFFF',
        table_highlight='#FFFF00',
        table_highlight_text='#0000FF',
        table_border='false',
Grizzly-Adam commented 6 years ago

I am working late today, got a door tech here. Will try them layer if I get out soon.

Grizzly-Adam commented 6 years ago

I have been working on skinning the mail program and was planning to ask you for more theme options to make it all work. I will try these ones and let you know if I need any more fields added (I was thinking something similar to the contrast colors, but with the main theme color (just not tied to other attributes). Anyway, I will work on it and let you know what I need

Sorry guy, I didn't get a lot done but I got out of work several hours late tonight.

Grizzly-Adam commented 6 years ago

Is it still possible to override CS-BOS text color when registering hardware? I have a computer running 1.10 that I would like to give a monochrome green monitor.

bell07 commented 6 years ago

At the time - no. But I can implement it. It does sense since this color is more depending on hardware then on software version..

bell07 commented 6 years ago

I removed my branched and pushed all my new changes to my master: https://github.com/bell07/minetest-laptop

For more systematic attribute names shema I renamed the table parameters to:

- `table_bgcolor` - Table background color
- `table_textcolor` - Table text color
- `table_highlight_bgcolor` - Table highlighted background
- `table_highlight_textcolor` - Table highlighted textcolor
- `table_border` -  draw border (true or false)

Can you please provide the default values to me or set up a branch that I can merge?

which theming option do you like to have in addition? Let me know so I can implement it as I find time.

I was thinking something similar to the contrast colors, but with the main theme color (just not tied to other attributes)

This should be simple as the "prefixes" does work generic

Example: new prefix "abc" you set an abc_button = "laptop_abc_button.png" and abc_textcolor = "#123456" you can use theme:get_button('x,y;w,h', 'abc', code, text) theme:get_label('x,y', text, 'abc')

They are two challanges:

Is it still possible to override CS-BOS text color when registering hardware? I have a computer running 1.10 that I would like to give a monochrome green monitor.

I added the option hwdef.tty_style, so you can set the tty_style='AMBER', tty_style='GREEN' or tty_style='WHITE' to the hardware definition. If you need more colors, you need to add new colors to "supported_textcolors" table in cs-bos_app.lua file, or provide the value to me

bell07 commented 6 years ago

Added support for textures replacement in themes: You can define in theme now

    texture_replacements = {
        ['laptop_email_trash.png'] = 'laptop_themed_trash.png',
    }

to replace the email trash button icon if an theme is selected.

works with all theme:get_image_button() (all buttons in mail_app) and if the new method theme:(get_texture) is used (bomb or boom in TNTSweeper). Should be complete, if something missed, let me know. The tetris is difficult because additional texutre colorization is used.

bell07 commented 6 years ago

added support for texture_replacements in launcher to replace the app icons...

bell07 commented 6 years ago

Should we be able to make the icons customizable like the other things of the theme?

this is done by texture_replacements support mentioned above

In my more_theming_support branch. The changes could be merged if the tables theming support is finished (Themes adjustment needed to use the new colorizing parameters)

bell07 commented 6 years ago

added some table colors to themes. @Grizzly-Adam , please check if the colors does match your imagination

Grizzly-Adam commented 6 years ago

Thanks bell07, I will take a look. I am hoping that I can concentrate well enough to fully evaluate it. I am returning to work tomorrow.

Grizzly-Adam commented 6 years ago

@bell07 Give me two more things and I theme I can fully skin the apps to match the themes (except for app specific buttons).

I need: muted_textcolor (a text color that can be used for things like read mail) theme_background or uniform_background (a background that is complimentary to the theme-- opposite of contrast background).

bell07 commented 6 years ago

ok, new prefix "muted" and value "bgcolor" global or prefixed. "background" is used already for background texture, so the background color is "bgcolor" as I introduced for tables

bell07 commented 6 years ago

@Grizzly-Adam do you need support you to add the required things?

You need just to add default values for "muted_textcolor" to "bgcolor" to the default theme "Freedom" in themes.lua, then to the other themes if differ. In code you can access the values by "mtos.theme.mutedtextcolor" and "mtos.theme.bgcolor" or using prefix in theme:get* methods.

(except for app specific buttons).

This is possible too with my last changes. Just define in theme

laptop.register_theme("???", {
    desktop_background = 
...
    texture_replacements = {
        ['laptop_email_trash.png'] = 'laptop_themed_trash.png',
        ['original.png'] = 'themed.png',
    }
})
bell07 commented 6 years ago

By the way, I am unhappy with "Freedom" as technically fallback theme. The fallback should not be green. The most themes needs to override most values because not green. My proposal is to move the "Freedom" to own file like the other themes, and then define hidden "default" theme with settings as used in the most themes., then redundancy could be removed from other themes. The "Freedom" can be still hardcoded as default theme if no theme selected.

Grizzly-Adam commented 6 years ago

I agree, we need something with the typical blues and greys. Either a new basic theme, or use the clouds theme.

bell07 commented 6 years ago

Are you working on skins colors adjustments? If not I can consolidate the default theme and degrade the Freedom to "usua"l theme in the evening. "default" is hidden hard-coded so it will be really fallback-only definition, with background image = "" and so

Grizzly-Adam commented 6 years ago

I am not currently. Go ahead and make your changes and I will start after work.

bell07 commented 6 years ago

I done the split of freedom from fallback values and removed all fallback redundancies. more_theming_support @Grizzly-Adam you can take over again to adjust the themes. If you miss something, just add it or ask me ;-) I think using texture_replacements and the table-colors it is able now to get nearly full monochrome output for old computers

Grizzly-Adam commented 6 years ago

All changes are in my git. I will work on the buttons tomorrow. See screenshots.

Can green/black menu in screenshot 1 be changed to match theme?

Can message text area in screenshot 3 be bordered?

screenshot from 2018-03-12 19-10-37 screenshot from 2018-03-12 19-16-11 screenshot from 2018-03-12 19-17-08

bell07 commented 6 years ago

Can green/black menu in screenshot 1 be changed to match theme?

maybe (needs to be tested) we can change the text color by colorizing the text string using minetest.colorize(color, string)`, but no idea how to theme the green bar and background in dropdown :-( We have some other not colorizable elements like scrollbars :-(

By the way, I found in lua_api.txt the formspec

box[<X>,<Y>;<W>,<H>;<color>]

  • Simple colored semitransparent box
  • x and y position the box relative to the top left of the menu
  • w and h are the size of box
  • color is color specified as a ColorString

Maybe we can remove all "1-color-backgrounds" and replace them by this command? So we can remove some texture files? I write the theme:get_background(texture or rgb) method to be able to use both, texture and color in "background" settings.

Grizzly-Adam commented 6 years ago

Sorry, I missed this one earlier. That sounds like a great idea. All the 1x1 pixel images are a pain!

bell07 commented 6 years ago

Yea, and the "contrast_background" can be "migrated" to contrast_bgcolor ;-)

I am working on method theme:get_bgcolor_box(area, prefix) with tech-demo in "file selection dialog"..

Grizzly-Adam commented 6 years ago

What am I doing wrong, buddy? (This isn't the fully theme, but enough to show you how I am using the new code. Many lines removed between app_background and texture_replacement.

laptop.register_theme("Amber Shell", {
    desktop_background = "laptop_theme_ambershell_desktop_background.png",
    app_background = "laptop_theme_ambershell_app_background.png",
    texture_replacements = {
        ['laptop_mail.png'] = 'laptop_theme_ambershell_mail.png',
        ['laptop_email_letter_new.png'] = 'laptop_theme_ambershell_email_letter_new.png',
    }
})
bell07 commented 6 years ago

Looks right. What is the issue?

bell07 commented 6 years ago

Done the theme:get_bgcolor_box(area, prefix): https://github.com/bell07/minetest-laptop/commit/1feeddf108cf62cf67fae62f7d36fd079fd80664 You can see in commit how to use and which themes parameter could be used.I re-used existing prefixes. The idea is the bgcolor should match the prefix-background texture basecolor.

app_bgcolor is the base color of app-background for example (white). Please modify the default values to more meaningful. I just set some values for demo reasons.

You can checkout my more_theming_support branch or just learn about git cherry-pick ;-)

Grizzly-Adam commented 6 years ago

I am not seeing the texture_replacements is not showing up in the theme.

bell07 commented 6 years ago

What am I doing wrong, buddy?

I see your issue ;-) not all png files does support the replacing. For example laptop_mail.png and laptop_mail.png and laptop_mail_read.png

"image,align=center,1=laptop_mail.png,2=laptop_mail_read.png;"..

To support them the line should be

"image,align=center,1="..mtos.theme:get_texture('laptop_mail.png')..",2="..mtos.theme:get_texture('laptop_mail_read.png')..";"..

I did not adjusted all textures. Only the get_image_button() method that is used for most buttons in mail app.

bell07 commented 6 years ago

laptop_email_letter_new.png is not used in app. The app icon is laptop_email_letter.png

Therefore: ['laptop_email_letter.png'] = 'laptop_theme_ambershell_email_letter_new.png',

Grizzly-Adam commented 6 years ago

Oh. I thought it was the one in the message lift on the left side.

On Tue, Mar 13, 2018 at 6:08 PM, bell07 notifications@github.com wrote:

laptop_email_letter_new.png is not used in app. The app icon is laptop_email_letter.png

Therefore: ['laptop_email_letter.png'] = 'laptop_theme_ambershell_email_letter_new.png',

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Gerold55/minetest-laptop/issues/102#issuecomment-372849185, or mute the thread https://github.com/notifications/unsubscribe-auth/AhktCRRhWnyz7m68azrKIkQ5orT_NUC-ks5teFFjgaJpZM4SSiUn .

Grizzly-Adam commented 6 years ago

OK great, I got the above changes you mentions and now am working on more themed textures for the buttons. I will let you know when I get all of the amber shell done for the mail program and get your opinion.

Grizzly-Adam commented 6 years ago

OK, these two apps are looking pretty good, except the green tooltips and the green dropdown screen we discussed earlier.

screenshot from 2018-03-13 19-53-51 screenshot from 2018-03-13 20-05-04

Grizzly-Adam commented 6 years ago

@apachano @Gerold55 What do you guys think of the buttons in the mail screenshot and the fire in the tnt sweeper screenshot? I need to convert to green yet, but want to make sure the work is acceptable before I do so.

Gerold55 commented 6 years ago

I think they look great @Grizzly-Adam

Grizzly-Adam commented 6 years ago

@bell07 I could not figure out how to get mtos themes to work with the chess pieces and the printer online color. Could you please advice-- I am assuming that it is due to mtos not being called in functions but am not sure how to properly call it.

Grizzly-Adam commented 6 years ago

Shell icons done.

shell

bell07 commented 6 years ago

mtos themes to work with the chess pieces and the printer online color.

chess pieces are registered technically as items. There is no way to change the texture for items.

The printer colors could be themed as next:

Add the current values to the default theme called as status_online_textcolor, status_disabled_textcolor and status_off_textcolor. The values could be useful in other apps too.

Then you can remove the colors defined in local function get_printer_info(pos). We are able to get it dynamically by "status_"..printer.status.."_textcolor"

The printer online color is defined in https://github.com/Gerold55/minetest-laptop/blob/master/apps/os_print_app.lua#L221 minetest.pos_to_string(printer.pos)..' '.. minetest.colorize(printer.status_color,printer.status))

replace printer.status_color by mtos.theme["status_"..printer.status.."_textcolor"]

Done

PS: you get the next issue in theming the tetris app, because of hard-coded colorizing. I think we need a "monochrome = true" parameter to skip colorizing. But then all bricks looks the same..

Grizzly-Adam commented 6 years ago

OK, that just leaves the Tetris issue, and the chess that we can do nothing about. Maybe we set chess to not run on monochrome monitors?

bell07 commented 6 years ago

OK, for chest game we can set os_min_version to a value higher then the monochrome versions. All other themes needs to be tested and adjusted for new parameters. I try to merge our and my branch, then I add "monochrome" parameter and adjust tetris to colorize all by the cs-bos console textcolor in this case

bell07 commented 6 years ago

Please change/rename also theme.bgcolor2 to something prefixed (theme.second_bgcolor ?) I strart a"last-to-do" list in the first post

bell07 commented 6 years ago

ok, I set the os_min_version for realchess and adjusted the framework + tetris app for monochrome output. By the way, The default_diamond_block.png in tetris app needs to be replaced by own texture. Own texture should be gray, because colorized in lua.

Both changes are in pull request to your repo, @Grizzly-Adam

Grizzly-Adam commented 6 years ago

I will make some progress with this tomorrow. Just got home from work and I am exhausted. Not sure why.