• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code [Template] Web-admin mutator settings class template

Ducky

Super Moderator
May 22, 2011
6,358
237
Netherlands
Introduction:

I've created a class template which enables easy creation of web-admin mutator setting pages. The name of that class template is TAdvMutatorSettings and it allows you to create a base-class for your settings screen at compile time. That base-class will do all the work behind the scenes. The only thing left is to put the mutator settings on the screen and reading them out after the save button is hit.


Features:
  • Gives the possibility to have more action buttons then the default save settings button.
  • Implements an easy to use API to create static or dynamic setting screens.
  • Screens can be created without any knowledge of HTML, JQuery or JavaScript (only for none-interactive screens).
  • Possible to make interactive screens by adding your own HTML, JQuery or JavaScripting.
  • On board locking feature to secure the mutator settings (no multi-admin hustle).
  • Possibility to define your own actions.
  • Multi-session support.

Download:

The package can only be downloaded from an SVN server. If you don't have it yet, then you will need to install an SVN client (e.g. TortoiseSVN).
SVN Checkout URL: svn://62.163.53.115/TAdvMutatorSettings/tags/V2.0/
SVN User Name: Guest
SVN Password: Welcome

Change log:
Release V2.0:
  • Added pre-processor directives to exclude/include features from the binary. This can reduce the size of the binary for those cases where a simple web-admin would be sufficient. The available directives are:
    • TAMS_LOCKING_SUPPORT
      If True, then the code to add the mutator lock bottons (right top of the settings screen) will be present.
      Default: True.
    • TAMS_PASSWORD_DIALOG_SUPPORT
      If True, then the code to generate the password dialogs will be present. This option will be automatically enabled if TAMS_LOCKING_SUPPORT is True.
      Default: True.
    • TAMS_DIALOG_SUPPORT
      If True, then the code to generate the dialogs will be present. This option will be automatically enabled if TAMS_PASSWORD_DIALOG_SUPPORT is True.
      Default: True.
    • TAMS_BUTTON_PANEL_SUPPORT
      If True, then the code to generate the top-right button panel will be present. This option will be automatically enabled if TAMS_LOCKING_SUPPORT is True.
      Default: True.
    • TAMS_PAYPAL_DONATE_SUPPORT
      If True, then the code to generate a PayPal donation button will be present.
      Default: False.
    • TAMS_PAYPAL_DONATE_BY_EMAIL
      If True, then the code to generate a PayPal donation button will be present assume that an email address is used to generate the button. If False, then it assumes that a PayPal Secure Hash is used.
      Default: False.
  • Added PayPal Donate support. This makes it very simple to add a PayPal Donate button to your web-admin page. For instance on the About tab. There are however a restriction. The PayPal button does break the web-page html code and for this reason it should be placed at the bottom of the last tab on your web-page. Any controls placed below the button will not work as they should be. The example shows where and how to place the button.
Release V1.2:
  • Added better dialog support.

Example:

The package includes a compilable and working example of a simple settings screen. Below two screenshots of the settings screen of the example mutator.

SimpleConfigsTab.png


AboutTab.png


And this is the source to create those screens:
MyExampleMut/Classes/MyExampleMutSettings.us:
Code:
/**
 * @copyright Copyright
 
Last edited:
Released V2.0. Change log:
  • Added pre-processor directives to exclude/include features from the binary. This can reduce the size of the binary for those cases where a simple web-admin would be sufficient. The available directives are:
    • TAMS_LOCKING_SUPPORT
      If True, then the code to add the mutator lock bottons (right top of the settings screen) will be present.
      Default: True.
    • TAMS_PASSWORD_DIALOG_SUPPORT
      If True, then the code to generate the password dialogs will be present. This option will be automatically enabled if TAMS_LOCKING_SUPPORT is True.
      Default: True.
    • TAMS_DIALOG_SUPPORT
      If True, then the code to generate the dialogs will be present. This option will be automatically enabled if TAMS_PASSWORD_DIALOG_SUPPORT is True.
      Default: True.
    • TAMS_BUTTON_PANEL_SUPPORT
      If True, then the code to generate the top-right button panel will be present. This option will be automatically enabled if TAMS_LOCKING_SUPPORT is True.
      Default: True.
    • TAMS_PAYPAL_DONATE_SUPPORT
      If True, then the code to generate a PayPal donation button will be present.
      Default: False.
    • TAMS_PAYPAL_DONATE_BY_EMAIL
      If True, then the code to generate a PayPal donation button will be present assume that an email address is used to generate the button. If False, then it assumes that a PayPal Secure Hash is used.
      Default: False.
  • Added PayPal Donate support. This makes it very simple to add a PayPal Donate button to your web-admin page. For instance on the About tab. There are however a restriction. The PayPal button does break the web-page html code and for this reason it should be placed at the bottom of the last tab on your web-page. Any controls placed below the button will not work as they should be. The example shows where and how to place the button.
 
Upvote 0