Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Version 2.1.8 is up for WoT 1.2.0.1
Sun, 21 Oct 2018 23:11:59 +0000

See link for changes and download.
https://smashpuppet.net/smashconfig

~SmashPuppet

Simple version checker for custom XVM configs

SmashPuppetSmashPuppet Member, Moderator Posts: 14
edited September 4 in XVM Configs
I wanted to display the version status of my config in the hangar to let others know when a new version is up.

So I made one for XVM to use in the hangar via widgets and a simple script and thought that other custom config authors might want to use it for their own config pack as well.


I did not want to use the notifications button as it changes too often for my liking and thus, breaking the mod on a regular basis. Call me lazy! =) So before anyone asks: No this is not clickable or a hyperlink. It simply tells you if the config you are running is current or not. Nice and simple.

It updates itself after every battle. (When the hangar is reloaded)

Again, this is only useful and meant for config authors. If you do not make and distribute your own config, this is probably not for you.

Images:
status current:
G41WPk2t.jpg

status update available:
1sRMcGut.jpg

status network error:
KNZ6ZXBt.jpg

Installation:

Add this line to your @xvm.xc file. I put mine just after the hangar entry.
    "configVersionCheck": ${"configCheck.xc":"configVersionCheck"},     // Check custom config version

Add this to your widgets.xc file in the lobby section.
${ "widgetsTemplates.xc":"configVersion" }

Add this to your widgetsTemplates.xc file.
// Config Version Check
  "configVersion": {
    "enabled": true,
    "layer": "top",
    "type": "extrafield",
    "formats": [
      { "x": -110,
        "y": 50,
        "screenHAlign": "right",
        "width": 400,
        "height": 60,
        "textFormat": { "color": "0xA8A888", "size": 12},

       // Obviously you would want to edit below to suit your own needs. This is my own format as an example...
        "format": "<img src='xvm://res/clanicons/NA/nick/SmashPuppet.png' vspace='-6' width='22' height='22'><font size='16'>{{py:cvc.checkVersion}}</font>"
      }
    ]
  }

Add the attached configVersionCheck.py script to your py_macro folder.

Add the attached configCheck.xc file to your config folder. Edit the settings according to your own needs. It has my own settings in it and will probably not be useful to you!

And as an example, create a text file ( .txt ) and write your config version into it. Keep it small and concise. It can read any text based document but a text file is simplest.

Example:
1.9.8

You will of course, need to upload this text file to a remote HTTP server and edit your config to match it's URL. Every time you change your version number, package up your config after the necessary edits and then upload a new text file, containing the latest version number.

If you host your own site, you should already be familiar with mod_rewrite and/or .htaccess files (assuming your host server is Unix/Linux (Apache etc) based). You may need to do some editing in order to access a file with a .txt extension. Just ask if you run into issues... I or someone here may be able to help you.

Here is the provided settings file, configCheck.xc
// Simple Config Version Checker for your Hangar. configVersionCheck.py ~ SmashPuppet (NA) 2018
{
"configVersionCheck": {
    "enabled": true,
    "settings": {
        "version": "1.9.8", // Text to search for in remote file/document. Change it to your current version number before packaging config!
        "configName": "SmashConfig", // The name of your xvm configuration.
        "updateConfig": "New Version Available!", // Text to display when a new version is available.
        "updateColor": "{{py:replace('{{.colors.system.enemy_alive}}', '0x', '#')}}", // The colour of the update text. (HTML colours)
        "currentConfig": "is Current.", // Text to display if configuration is current.
        "currentColor": "{{py:replace('{{.colors.system.ally_alive}}', '0x', '#')}}", // The colour of the current text. (HTML colours)
        "notAvailable": "Information not available!" // Text to display if network error.
    },
    "links": {
        "remoteLink": "https://smashpuppet.net/SmashConfig/version.txt", // link to remote text file containing the version text.
        "updateLink": "https://smashpuppet.net/smashconfig" // The update URL to get latest configuration.
    }
  }
}

Like I said, it is very simple. Feel free to make it fancy if you like. I prefer it this way though as it will require little maintenance and still does it's job just fine.

I hope you find this useful.

Cheers!
Post edited by SmashPuppet on
py
py
configVersionCheck.py
2K
xc
xc
configCheck.xc
1K

Comments

Sign In or Register to comment.