[REJOICE] Mod switcher with graphical user interface!

[REJOICE] Mod switcher with graphical user interface!

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

[REJOICE] Mod switcher with graphical user interface!

Post by [K.B.] Napalm Cobra »

Just drag and drop into your spring directory and create a shortcut to your desktop.

Features
  • It can handle AA, OTA, SWTA, XTA and EvOTA.
    Can launch spring client or spring.exe.
    Nice looking.
    Convenient.
    Made by me.
Download it from FileUniverse NOW! http://www.fileuniverse.com/?page=showitem&ID=805
Last edited by [K.B.] Napalm Cobra on 23 May 2005, 06:50, edited 1 time in total.
User avatar
Storm
Posts: 443
Joined: 12 Sep 2004, 22:23

Post by Storm »

NICE SHOT!
Doomweaver
Posts: 704
Joined: 30 Oct 2004, 14:14

Post by Doomweaver »

How do we use it? I'm confused.
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

I'm sure I included a readme. Anyway, extract the files to your spring directory and open the exe file.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

Doomweaver...dude. How more simple can you get?

And KB... please tell me it wasn't done in VB... *sobs*

-Buggi
User avatar
Cheery
Posts: 129
Joined: 09 May 2005, 10:30

Post by Cheery »

http://taspring.clan-sy.com/phpbb/viewtopic.php?t=1193

If you want a simpler and you don't mind about DOS interface, check out what me and michilus did there with single batch file!

I think we need the ability to add these mods more, but I gues it's good for now like this. the spring lobby is under construction anyway so sooner or later we have the complete modselecter included into the game itself.
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

No buggy, I'd rather circumsise myself without anesthetic than programme in VB.

-main.cpp

Code: Select all

#include <windows.h>

#include "resource.h"

const char g_szClassName[] = "myWindowClass";
extern bool allOff(void);

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CREATE:    
            {
                        HMENU hMenu, hSubMenu;
                        HICON hIcon, hIconSm;
                
                        hMenu = CreateMenu();
                
                        hSubMenu = CreatePopupMenu();
                        AppendMenu(hSubMenu, MF_STRING, ID_FILE_RUN_CLIENT, "Run Spring &client");
                        AppendMenu(hSubMenu, MF_STRING, ID_FILE_RUN_SPRING, "Run &Spring.exe");
                        AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
                        AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");
                        
                        hSubMenu = CreatePopupMenu();
                        AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_AA, "Switch to &AA");
                        AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_EVOTA, "Switch to &EvOTA");
                        AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_OTA, "Switch to &OTA");
                        AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_SWTA, "Switch to &SWTA");
                        AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_XTA, "Switch to &XTA");
                        AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&Switch");
                        
                        hSubMenu = CreatePopupMenu();
                        AppendMenu(hSubMenu, MF_STRING, IDD_ABOUT, "&About");
                        AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&Help");
                
                        SetMenu(hwnd, hMenu);
            }
        break;
        case WM_COMMAND:
            {
                 switch(LOWORD(wParam))
                 {
                      case ID_SWITCH_AA:
                      {
                           allOff();
                           system("aa.bat");
                      }
                      break;
                      
                      case ID_SWITCH_EVOTA:
                      {
                           allOff();
                           system("evota.bat");
                      }
                      break;
                      
                      case ID_SWITCH_OTA:
                      {
                           allOff();
                           system("ota.bat");
                      }
                      break;
                      
                      case ID_SWITCH_SWTA:
                      {
                           allOff();
                           system("swta.bat");
                      }
                      break;
                      
                      case ID_SWITCH_XTA:
                      {
                           allOff();
                           system("xta.bat");
                      }
                      break;
                      
                      case ID_FILE_RUN_CLIENT:
                      {
                           DestroyWindow(hwnd);
                           system("SpringClient.exe");
                      }
                      break;
                      
                      case ID_FILE_RUN_SPRING:
                      {
                           DestroyWindow(hwnd);
                           system("spring.exe");
                      }
                      break;
                      
                      case ID_FILE_EXIT:
                      {
                           PostMessage(hwnd, WM_CLOSE, 0, 0);
                      }
                      break;
                      
                      case IDD_ABOUT:
                      {
                           MessageBox(hwnd, "Made by Das Bruce, uber_napalm_cobra@hotmail.com.", "About", MB_OK);
                      }
                      break;
                 }
            }
        break;
        
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    WNDCLASSEX wc;
    HWND hwnd;
    MSG Msg;

    //Step 1: Registering the Window Class
    wc.cbSize        = sizeof(WNDCLASSEX);
    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MYMENU);
    wc.lpszClassName = g_szClassName;
    wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&wc))
    {
        MessageBox(NULL, "Window Registration Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    // Step 2: Creating the Window
    hwnd = CreateWindowEx(
        WS_EX_CLIENTEDGE,
        g_szClassName,
        "Switcher.",
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 360, 240,
        NULL, NULL, hInstance, NULL);

    if(hwnd == NULL)
    {
        MessageBox(NULL, "Window Creation Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

    // Step 3: The Message Loop
    while(GetMessage(&Msg, NULL, 0, 0) > 0)
    {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
    return Msg.wParam;
}
-batchfunctions.cpp

Code: Select all

#include <windows.h>

bool allOff(void)
{
    system("@echo off");
    system("if exist AbsoluteAnnihilation.hpi rename AbsoluteAnnihilation.hpi AbsoluteAnnihilation.old");
    system("if exist AbsoluteAnnihilation.ccx rename AbsoluteAnnihilation.ccx AbsoluteAnnihilation.old");
    system("if exist taenheter.hpi rename taenheter.hpi taenheter.old");
    system("if exist taenheter.ccx rename taenheter.ccx taenheter.old");
    system("if exist \"SWTA_&_IA_for_Spring_503.gp3\" rename \"SWTA_&_IA_for_Spring_503.gp3\" \"SWTA_&_IA_for_Spring_503.old\"");
    system("if exist \"SWTA_&_IA_sounds.ufo\" rename \"SWTA_&_IA_sounds.ufo\" \"SWTA_&_IA_sounds.old\"");
    system("if exist OTA_settings_for_spring_patch.ufo rename OTA_settings_for_spring_patch.ufo OTA_settings_for_spring_patch.old");
    return true;
}
-resource.h

Code: Select all

#define IDR_MYMENU 101
#define IDI_MYICON 201


#define ID_SWITCH_AA 9001
#define ID_SWITCH_EVOTA 9002
#define ID_SWITCH_XTA 9003
#define ID_SWITCH_SWTA 9004
#define ID_SWITCH_OTA 9005


#define ID_FILE_EXIT 9011
#define ID_FILE_RUN_CLIENT 9013
#define ID_FILE_RUN_SPRING 9014

#define IDD_ABOUT 9021
Happy now buggi?
User avatar
Cheery
Posts: 129
Joined: 09 May 2005, 10:30

Post by Cheery »

:? :|

You used C, but why didn't you used it to create database which allows users to add mods and disable them as well?

The artillery is not there to drop down flies only. :-)

Oh well, if you are going to do something well, do it yourself.

I'll make some things for your code.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

Buggi wrote:Doomweaver...dude. How more simple can you get?

And KB... please tell me it wasn't done in VB... *sobs*

-Buggi
You know... I used to think like that also but VB.net is a handy little language.
User avatar
Cheery
Posts: 129
Joined: 09 May 2005, 10:30

Post by Cheery »

Me and Napalm Cobra talked in the MSN. We decided to take a cooperative approach into this addon.

I wrote a mod database on it. There's what came:
http://www.kolumbus.fi/suomen.siirtoval ... 3_5_06.zip
kookos
Posts: 19
Joined: 21 May 2005, 20:46

Post by kookos »

there would be mod switcher folder where is EVota,Ota and etc folders what include game files you just set the files in the folders so it be easy.
User avatar
Cheery
Posts: 129
Joined: 09 May 2005, 10:30

Post by Cheery »

I gues they'll do something like that.

But this is an external solution until they does it into lobby client.

Some upgrades is coming yet, then it can be like this.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

smoth... dude, you just lost cool points.

Which is a bad thing, cool points must be collected and cherished.

I'm glad he didn't use VB, but sad because he didn't impliment some sort of cool XML config file to edit the mod values and such.

So no cool points lost there.

;)

-Buggi
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

Buggi wrote:smoth... dude, you just lost cool points.

Which is a bad thing, cool points must be collected and cherished.

-Buggi
I had cool points!?! SWEET! I thought I had none.

Seriously. I think vb.net is neat. I am writing up a unit view utility right now it it. Something that if I wanted to write it in C++ would take substantially longer. Especially with 100+ variables in my object. I find that for object oriented programming VB is very handy. If only because of the way it handles the code and can give me lists of all of my availble object functions.

I am not going to lie it is for the lazy coder but TRUST me I am horribly busy. In situations that I need to crap out an app I love VB..... Not that I will put down good ole MSVC++ 6.
mongus
Posts: 1463
Joined: 15 Apr 2005, 18:52

Post by mongus »

how do you use that modman... is it a complement of switch? or replace?
is it only to add more mods? or to manage existing ones?

please add some documentation.
User avatar
Cheery
Posts: 129
Joined: 09 May 2005, 10:30

Post by Cheery »

Ugh. I'm really sorry forgotting the documentation! :-)

It's an updated version from napalm cobra's work.(complement)

- Actual update is a mod database which allows you to add your own mods into the list. Otherwise it's like napalm cobra's original tool.

Napalm were doing somekind of mod -on indicator when I saw him last time. So the next update may be from him. I gave him the source that he could do that.

You should have next files in your TASpring folder after installation:
AddMod.exe
Reset.bat
Install Absolute Annihilation.bat
Install EvOTA2.bat
ModMan.exe

FOR USERS:
- Run Reset.bat, make sure it created a file named: Mods.mmn

Next are optional, if you aren't sure, you can run them and run reset.bat again if you hadn't the mods.
- Run Install Absolute Annihilation.bat if you have the AA mod.
- Run Install EvOTA2.bat if you have EvOTA.

- Run ModMan.exe.
-> there pops up a small window which have some submenus.
-> now you should have stuff under the switch -menu.
- Select any mod you installed from switch -menu.
-> Notice how it turns the files in your TASpring folder when you switch them.
-> That's it, you can now run the TASpring and select the mod with ModMan.exe without stumbling with stupid renaming stuff or batches.

After you find out it works:
-[optional] put it into your TA spring shortcuts.

FOR MOD DEVS:
Make next kind of batch file or make installer which does this:
The next example is for EvOTA2.

Code: Select all

@echo off
echo continue if you are sure you want to install this mod into your modman.
echo next batch file installs EvOTA2 mod.
echo WARNING: modman doesn't warn if you have same mod installed already.
pause
AddMod "EvOTA2" /P "taenheter.old" "taenheter.ccx" /P "OTA_settings_for_spring_patch.ufo.old" "OTA_settings_for_spring_patch.ufo" /P "Objects3Dold" "Objects3D"
pause
The AddMod works like next:
AddMod.exe "mod name" /P "file1 when disabled" "file1 when enabled" /P "file2 when disabled" "file2 when disabled" [...]

Before you release your mod, make sure you don't forget anything there.

You can also post your mod-installation batch here.

http://www.kolumbus.fi/suomen.siirtoval ... 3_5_06.zip
There is the link for people who didn't noticed it. I found it rather hard to find between the postings.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

smoth, dude, use C#

It's what I'm coding the construction set in. Very elegant language.

And to all the haters out there. :arrow: ..|..

8)

-Buggi
Liam
Posts: 93
Joined: 02 Nov 2004, 22:43

Post by Liam »

... plenty of IDEs have that kind of functionality built in smoth, i wouldn't say the language was handy, maybe the IDE is (to be honest, haven't used it so i can't say either way)
mongus
Posts: 1463
Joined: 15 Apr 2005, 18:52

Post by mongus »

THIS IS A QUESTION REALLY, NOT THE INSTRUCTION TO USE.

So, the install order for spring should be as follows.

- Install Latest version of Sring
- Install a mod on top of that installation(i.e. Absolute Annihilation).
- Follow proper instructions (Cheery's post), to install that mod into Modman.
---(if this is the first time running Modman, run reset.bat)
---(then run the mod installation .bat file, i.e. "Install Absolute Annihilation.bat")

- Switch between mods using the switch menu in the interface (ModMan.exe).

when installing a new mod (i.e. EvOTA2).

- Install that mod into the Spring folder.
- Run the mod installation bat file.


I have not tried the program yet.
Questions... doesnt AA replace some files?
doesnt this change the installation order or make it more complicated/different?.

Edit: now i installed the program...
I think it works as i described it, but....
my files ended at C:\Program Files\TASpring\
and not in C:\Archivos de programa\TASpring\
where they should... i think you need to use a system variable... (like %sysroot%) dunno its name.
e: its %PROGRAMFILES%, not sure if can (or how) be used un command prompt.
E: also, it seems pathfinding is redone for each set of units. wich means this program should enable-disable specific path files (*.pt) to each mod.
the current map universe has a path archive around 250 Mb (that is all path archives for every map out there).
Last edited by mongus on 25 May 2005, 03:49, edited 2 times in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

Liam wrote:... plenty of IDEs have that kind of functionality built in smoth, i wouldn't say the language was handy, maybe the IDE is (to be honest, haven't used it so i can't say either way)
It is mainly the IDE, but I ran into issues with C# trying to use old C++ so for the past semester I used Vb.net. I figured it would be fun to learn another language.

Buggi, since I am somewhat de-railing the topic I moved the conversation to PMs I hope you don't mind.
Post Reply

Return to “General Discussion”