Skip to content

Commit 2ba4135

Browse files
committed
Prettified and added GitHub and Discord buttons.
1 parent 0ff365d commit 2ba4135

10 files changed

+34
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Download the [***Legacy Mod Converter***](http://www.mediafire.com/file/b2qdhe55
1010

1111
If you get a "`Microsoft Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.`" popup message when trying to run the program just press `More info` -> `Run anyway`. It may take a very long time for the program to appear, which is an issue with Windows' Antimalware Service Executable. We're looking into how we can fix both of these issues.
1212

13-
![Legacy mod converter program screenshot](media/cclmc-program-screenshot.png)
13+
![Legacy mod converter program screenshot](media/cclmc-screenshot.png)
1414

1515
## Disclaimer
1616
This program will do most of the conversion work for you, but some conversion steps are too hard to automate, so it's likely that `CCCP` will still crash or print errors in the console. If this happens you'll have to manually fix these issues in the legacy mod folder. If you want to properly fix these errors then you should download this repository and follow the instructions below so you can add your own conversion cases to `conversion_rules.py`.
@@ -21,7 +21,7 @@ This program will do most of the conversion work for you, but some conversion st
2121
* Run `python gui.py` when you want to convert old mods.
2222
* `conversion_rules.py` has the `conversion_rules` dictionary inside of it. The dictionary contains entries that look like `'foo': 'bar',` which means means that any time `foo` will be encountered by `convert.py`, it will replace it with `bar`. You can add extra cases to it, see the next sections on how to do this.
2323

24-
## Detailed tutorials on creating conversion rules
24+
## Tutorials on constructing conversion rules efficiently
2525
* [Fixing CCCP crashes/errors with the program Everything](https://github.com/cortex-command-community/Cortex-Command-Legacy-Mod-Converter/wiki/Fixing-CCCP-crashes-errors-with-the-program-Everything)
2626

2727
## Contributing

gui.py

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# Run: python gui.py
22
# Build: pyinstaller --noconsole --onefile --icon=media/cclmc-icon.ico --name="Legacy Mod Converter" gui.py
33

4-
import os.path, pathlib
4+
import os.path, pathlib, webbrowser
55
import PySimpleGUI as sg
66
import config, convert
77

88

9+
no_path_set_color = "#b35858"
10+
path_set_color = "#528b30"
11+
progress_bar_color = "#17569c"
12+
13+
sg.theme("DarkGrey14")
14+
sg.theme_input_background_color(path_set_color)
15+
sg.theme_progress_bar_color((progress_bar_color, sg.theme_progress_bar_color()[1]))
16+
17+
918
def get_folder_containing_mods(mods_folder):
1019
parts = pathlib.Path(mods_folder).parts
1120
if parts[-1].endswith(".rte"):
@@ -22,7 +31,7 @@ def get_folder_containing_mods(mods_folder):
2231
size=(25, 1),
2332
enable_events=True,
2433
key="-MODS FOLDER-",
25-
background_color="light green" if sg.user_settings_get_entry("mods_folder") else "pink"
34+
background_color=sg.theme_input_background_color() if sg.user_settings_get_entry("mods_folder") else no_path_set_color
2635
),
2736
sg.FolderBrowse()
2837
],
@@ -33,11 +42,11 @@ def get_folder_containing_mods(mods_folder):
3342
size=(25, 1),
3443
enable_events=True,
3544
key="-OUTPUT FOLDER-",
36-
background_color="light green" if sg.user_settings_get_entry("output_folder") else "pink"
45+
background_color=sg.theme_input_background_color() if sg.user_settings_get_entry("output_folder") else no_path_set_color
3746
),
3847
sg.FolderBrowse()
3948
]
40-
], title="Paths", element_justification="right")],
49+
], title="Paths", element_justification="right")]
4150
]
4251

4352
options_column = [
@@ -50,8 +59,15 @@ def get_folder_containing_mods(mods_folder):
5059
run_column = [
5160
[sg.Frame(layout=[
5261
[sg.Button("Convert", key="-CONVERT-")],
53-
[sg.ProgressBar(100, size=(22.5, 20), key="-PROGRESS BAR-")]
54-
], title="Run", element_justification="center")],
62+
[sg.ProgressBar(100, size=(17.45, 20), key="-PROGRESS BAR-")]
63+
], title="Run", element_justification="center")]
64+
]
65+
66+
info_column = [
67+
[sg.Frame(layout=[
68+
[sg.Image("media/github-icon.png", enable_events=True, key="-GITHUB-")],
69+
[sg.Image("media/discord-icon.png", enable_events=True, key="-DISCORD-")]
70+
], title="", pad=(0, (8, 0)))]
5571
]
5672

5773
layout = [
@@ -60,12 +76,13 @@ def get_folder_containing_mods(mods_folder):
6076
],
6177
[
6278
sg.Column(options_column),
63-
sg.Column(run_column)
79+
sg.Column(run_column),
80+
sg.Column(info_column)
6481
]
6582
]
6683

6784
config.sg = sg
68-
window = sg.Window("Legacy Mod Converter - v1.0", layout, icon="media/cclmc-icon.ico")
85+
window = sg.Window("Legacy Mod Converter - v1.0", layout, icon="media/cclmc-icon.ico", button_color=(sg.theme_text_color(), "#2a3948"))
6986
config.progress_bar = window["-PROGRESS BAR-"]
7087

7188

@@ -76,16 +93,20 @@ def get_folder_containing_mods(mods_folder):
7693
window.close()
7794
break
7895

79-
if event == "-MODS FOLDER-":
96+
if event == "-GITHUB-":
97+
webbrowser.open("https://github.com/cortex-command-community/Cortex-Command-Legacy-Mod-Converter")
98+
elif event == "-DISCORD-":
99+
webbrowser.open("https://discord.gg/SdNnKJN")
100+
elif event == "-MODS FOLDER-":
80101
mods_folder = values[event]
81102
if mods_folder != "":
82103
sg.user_settings_set_entry("mods_folder", get_folder_containing_mods(mods_folder))
83-
window[event](background_color="light green")
104+
window[event](background_color=sg.theme_input_background_color())
84105
elif event == "-OUTPUT FOLDER-":
85106
output_folder = values[event]
86107
if output_folder != "":
87108
sg.user_settings_set_entry("output_folder", output_folder)
88-
window[event](background_color="light green")
109+
window[event](background_color=sg.theme_input_background_color())
89110
elif event == "-CONVERT-":
90111
if sg.user_settings_get_entry("mods_folder") not in (None, "") and sg.user_settings_get_entry("output_folder") not in (None, ""):
91112
sg.user_settings_set_entry("output_zips", values["-OUTPUT ZIPS-"])

media/cclmc-icon.ico

-18.5 KB
Binary file not shown.

media/cclmc-icon.png

-25.8 KB
Loading

media/cclmc-program-screenshot.png

-11.6 KB
Binary file not shown.

media/cclmc-screenshot.png

11.9 KB
Loading

media/discord-icon-original.png

8.27 KB
Loading

media/discord-icon.png

501 Bytes
Loading

media/github-icon-original.png

9.86 KB
Loading

media/github-icon.png

620 Bytes
Loading

0 commit comments

Comments
 (0)