GreaseMonkey'ing Cantr - customizing Cantr, clientside

General out-of-character discussion among players of Cantr II.

Moderators: Public Relations Department, Players Department

User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Doug R. » Thu Mar 21, 2013 10:05 pm

I was hoping to get the emotes colored something other than light grey. I've always dreamed of yellow text on the screen, but right now, I'm not sure what it should represent. I have to think about it.
Hamsters is nice. ~Kaylee, Firefly
AlchemicRaker
Posts: 311
Joined: Thu Feb 05, 2009 4:56 am

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby AlchemicRaker » Thu Mar 21, 2013 10:28 pm

Doug R. wrote:I was hoping to get the emotes colored something other than light grey. I've always dreamed of yellow text on the screen, but right now, I'm not sure what it should represent. I have to think about it.


The color I was testing with for this (almost-perfect yellow) was #EEEE00. If you edit the basic script, you can change the line for hilight_emote to:

Code: Select all

var hilight_emotes = function(i) {return '<span style="color: #EEEE00;font-style: italic;">' + i + '</span>';};


Or if you're using the advanced version, make this your new custom CSS:

Code: Select all

.cvee_emote {
color: #EEEE00;
font-style: italic;
}
.cvee_quote {
color: #ffffff;
}
.cvee_character {
color: #ff9700;
}
.cvee_event {
color: #999999;
}

If you want to mess around with coloring stuff, just grab the advanced one and you can control the CSS styling yourself.
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby Doug R. » Thu Mar 21, 2013 10:45 pm

Yeah, but I know exactly nothing about css, so I haven't any idea where to even start. Hence, needing to spend time researching.

And thanks for that.
Hamsters is nice. ~Kaylee, Firefly
AlchemicRaker
Posts: 311
Joined: Thu Feb 05, 2009 4:56 am

Re: CVEE: Event and Emote Restyling mod, read events easier

Postby AlchemicRaker » Thu Mar 21, 2013 11:56 pm

Doug R. wrote:Yeah, but I know exactly nothing about css, so I haven't any idea where to even start. Hence, needing to spend time researching.

And thanks for that.

Ah, I see then. Well I can put together other color codes for you if you have other ideas.

Also if anyone has any other ideas for related stuff this mod can do (visual tweaking type stuff) let me know.
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby EchoMan » Fri Mar 22, 2013 11:08 am

Merging topics
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Doug R. » Thu Apr 11, 2013 11:24 pm

Further customization is possible by referencing the event's type (eventgroup_21 for talking, eventgroup_9 for radio, and so on)


Anyone know how to mod this to add a span tag for radio?
Hamsters is nice. ~Kaylee, Firefly
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby EchoMan » Mon Apr 15, 2013 6:14 am

Where (in what tool) do you want to make the change? In stylish you would add:

Code: Select all

DIV.eventgroup_9 { font-style: italic !important; }


or something like that.
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Doug R. » Thu Apr 18, 2013 11:02 pm

Is Cantr Enhanced tick countdown going to be screwed up now?
Hamsters is nice. ~Kaylee, Firefly
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Greek » Thu Apr 18, 2013 11:13 pm

Yes. Until I'll fix that.
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Greek » Sun Apr 21, 2013 8:13 pm

CE is updated.
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Doug R. » Sun Apr 21, 2013 10:34 pm

Thank you!
Hamsters is nice. ~Kaylee, Firefly
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Greek » Wed May 08, 2013 10:42 pm

New version of Cantr Enhanced - 1.5.0 - http://userscripts.org/scripts/show/109440

Added simple export/import of personal settings using text format (json).
It may be useful when you must clean all your browser data but you don't want to lose options or bookmarks (highlights) for b & veh or as a backup.

How to use that?
Open [Cantr Enhanced options] on player (character list) page. Then click export. If everything works fine then you get some text in textarea. Copy it somewhere (notepad etc). When you want to load your settings then paste text you previously saved and click import. It does never remove or overwrite any data, so it's quite safe to use. If it doesn't work at all then contact me.

Why use that?
I've implemented that because soon we are going to enforce https (more secure because of encryption) for browsing Cantr (https://cantr.net). It uses different data storage than http://cantr.net, so you must take care to move your local settings. So all you have to do is download new version, export data from http://cantr.net and import in https://cantr.net

It will be mentioned in in-game announcement so no need to hurry. But http will eventually be redirected to https and then moving the data will be much harder.
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’
User avatar
Chris
Posts: 855
Joined: Sat May 05, 2007 1:03 pm

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Chris » Fri Jun 07, 2013 1:57 pm

Chrome won't let me install directly from a website other than the Chrome Store. See https://support.google.com/chrome_webst ... rning&rd=1
User avatar
Doug R.
Posts: 14857
Joined: Wed Mar 23, 2005 6:56 pm
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Doug R. » Fri Jun 07, 2013 3:45 pm

At least on my Mac, if you click the install link, it'll download the script to your computer (while giving you the error message). Then all you have to do is drag it into your extensions page.
Hamsters is nice. ~Kaylee, Firefly
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: GreaseMonkey'ing Cantr - customizing Cantr, clientside

Postby Greek » Thu Jul 25, 2013 9:52 pm

I'm using built-in option of setting own CSS skin to make some events smaller.

Code: Select all

/*whisper, ppl/veh entering, obj dragging, ppl/veh leaving, obj take/drop */
div.eventsgroup_22, div.eventsgroup_3, div.eventsgroup_8, div.eventsgroup_4, div.eventsgroup_31 {
font-size:8pt;
color:#888;
margin-top: -5px !important;
margin-bottom: 10px !important;
}

Quite much can be done using just that feature and it guarantees same settings will be available on every PC you use.

I'm doing some work on Cantr Enhanced. The last new version (1.5.1.1) doesn't change anything important, it just shows execution time of script on events page in browser's js console.
In the past I've announced I'll not continue development of CE, but it's not really true. I'm going to use it to offer some experimental changes which, in case they'll be welcomed, may be added to the game.
It's because CE is unofficial stuff and I don't have to guarantee it always works on every software configuration etc. I'm testing it on FF and Chrome.

New big release (1.8) will offer:
* significant reduction of execution time on events page (events grouping and character name matching at least by 50% on FF, probably even better on Chrome)
* Whispering to people using AJAX (core functionality works, but I'm working on most comfortable interface)
* toolbar with character menu buttons on the right side of the screen (with fixed position)

I remind that it's possible to make CE working not just for English, Polish and Portugiese and it's not needed to translate whole interface to make it work. PM me if you are interested.

EDIT: Another thing I'd like to do it red line showing where you stopped reading autorefreshed events. Do you have idea how should it work to be useful? I'll probably try to mark which events were shown by autorefresh when browser tab with Cantr was not focused. Do you have any other ideas?
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest