Sign in to follow this  
Followers 0
bej

2 widgets - Auto-switch-enemy-colour per mode, and Auto-switch-maxfps on fullscreen/windowed

2 posts in this topic

Hey, I know very little or nothing about scripting, but I wanted a couple simple scripts made, so I managed to hack together what I needed (with the help of some of you guys on discord /modding). I would put them on the workshop, but they are not very polished. I've no idea how to add options for them in the options menu. I've also been having a lot less time for these sorts of things lately. And as I'm no coder/scripter, I thought at the least I could put them up here incase someone might find them useful or improve them.

 

Widget 1.

AutoSwitchEnemyColour

This will switch the enemy model colour to or from relative, depending on which mode you're on. So in race for example, everyone automatically get's their own uniquely chosen colour, where as in every team mode, cl_colors_relative is set to 1. What this widget is missing is options so people can choose what they want for each mode, or perhaps more importantly what 1v1 has.

 

Widget 2.

AutoSwitchMaxFps

This is more a dial-down-cpu/gpu usage widget, for when you are idle and have alt-tabbed out of the game. I've set com_maxfps to 125 when fullscreen; but when windowed the game will automatically set com_maxfps to 30. Some low end spec users may find this helpful. What this widget is missing is options to set what maxfps they prefer for each state.

 

The widgets could be modded for other commands easily.

AutoSwitchEnemyColour.lua

AutoSwitchMaxFps.lua

Share this post


Link to post
Share on other sites

Adding options is pretty straightforward, just look at some other widgets for examples.

The basic structure is that you define variables for your user options in self.userData inside your widget's inititalize function. In your drawOptions function you draw the options screen using the functions from the reflexcore library, which do thinks like drawing checkboxes, edit boxes, drop downs, sliders, etc. Each of these functions will take a current value and return a new value. Save the new value to self.userData and then call a function to save the new userData.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0