[MODIFICATION] AGS v.3.3.2.0 Draconian Themed Code Editor

Started by ChamberOfFear, Wed 10/12/2014 05:55:34

Previous topic - Next topic

ChamberOfFear

Quote from: Crimson Wizard on Sat 24/01/2015 23:50:37
This really bugs me, whether is it alright to have these schemes hardcoded? And not just color numbers, there are even subclassed controls for particular theme (like DraconianComboBox).
My thinking / reasoning was that the editor should provide two default themes, a light and a dark one. However in retrospect the default light theme is probably enough, especially since it's built into the Windows Forms.

Quote from: Crimson Wizard on Sat 24/01/2015 23:50:37
Even more, some of the GUI classes now have a behavior selection in them, depending on chosen theme. For example, here's an excrept from "SpriteSelector" class:
No this is not OK. It shouldn't be like this if it can be avoided. I have to admit this is the result of getting increasingly frustrated of not making some aspects of the implementation work as I wanted it to. I don't remember specifics but the conclusion is that it should be redone so that there are no if-sentences in the implementation. Also the entire function "LoadColorTheme()" that I call in various GUI code-behinds should probably be split up and moved in the GUI Designer code file instead. Makes more sense from an implementation perspective.

Quote from: Crimson Wizard on Sat 24/01/2015 23:50:37
I understand this is just an experiment to bring the theme switching to AGS, but there's really no pressure for getting the feature ASAP; perhaps this all could be worked out more before merging into the main branch?

I do not do Editor design, but I would ask to consider those two ideas:
1) Reading theme from file (XML?); alternatively support plugin interface for custom theme class.
2) Hiding theme specific behavior under generalized interfaces.

Is this possible?
All of this sounds feasible I think, although it's a lot bigger task than I originally intended, so it will probably be a while before I find the time to take a look at it.

monkey0506

Quote from: ChamberOfFear on Thu 05/02/2015 03:18:39although it's a lot bigger task than I originally intended

Creating the multi-platform interface for the editor turned out to be a lot more work than I had originally anticipated too, but CW steered me in the right direction by not letting me take messy shortcuts (even if I promised to clean them up later). What he's said isn't a simple, quick fix, but it's worth doing the right way. ;) And don't worry if it takes time, that's why we're not paying you! :P

jwalts37

I actually did the same thing recently, except I had added an option to change themes from the preferences menu. The thing that bugged me was that whenever you switched it, the script had to be reopened in order for changes to take effect. I finally figured out how to "refresh" it real time. Its been so long since I was in there but if you'd like to get together and work on this feature or something ChamberOfFear, let me know. I was always too afraid to post my changes here for fear of all the exceptional programmers being like "THIS IS GOD AWFUL SHIT" even though I know they wouldnt. Let me know!
-Josh

jwalts37

Also, the 3.3.3 version doesnt seem to be working.

ChamberOfFear

Quote from: jwalts37 on Tue 07/04/2015 20:16:28
I actually did the same thing recently, except I had added an option to change themes from the preferences menu.
Note sure what you mean, this option exists, at least in the later versions. Don't remember if had this option in the older ones.

Quote from: jwalts37 on Tue 07/04/2015 20:34:04
Also, the 3.3.3 version doesnt seem to be working.
Please check that you changed the theme in preferences. I fairly certain the v3.3.3 should be working as that is the one I'm using myself.

ChamberOfFear

Quote from: Crimson Wizard on Sat 24/01/2015 23:50:37
1) Reading theme from file (XML?); alternatively support plugin interface for custom theme class.

How should I go about handling this? I imagine that having a default location on disk dedicated for said xml files would be convenient. Say there is a folder "Color Themes" in the AGS installation directory which contains xml files, each file is a theme that can be loaded into Preferences, and then be chosen by the user. Where on the disk would it be conventional to put these files?

Also, if I'm going to solve this with xml it would be convenient to have access to LINQ or lambda expressions which is currently not supported since the editor uses .NET 2.0. (Actually that would be convenient just in general.) I noticed there was a discussion some time ago about upgrading to .NET 3.5 but the discussion didn't seem to reach a conclusion http://www.adventuregamestudio.co.uk/forums/index.php?topic=50995.0
Could we do the upgrade?

Quote from: jwalts37 on Tue 07/04/2015 20:16:28
I finally figured out how to "refresh" it real time.
This sounds interesting, do you have the code online somewhere for reading?

Crimson Wizard

#26
Quote from: ChamberOfFear on Mon 13/04/2015 19:43:59
Quote from: Crimson Wizard on Sat 24/01/2015 23:50:37
1) Reading theme from file (XML?); alternatively support plugin interface for custom theme class.

How should I go about handling this? I imagine that having a default location on disk dedicated for said xml files would be convenient. Say there is a folder "Color Themes" in the AGS installation directory which contains xml files, each file is a theme that can be loaded into Preferences, and then be chosen by the user. Where on the disk would it be conventional to put these files?
Just "Themes" maybe (?); it sounds shorter and more generic :).
Regarding the location... we may consider that in future there will be an integrated theme designer (or plugin); or anyway the user should be able to modify them or upload new ones. I think therefore it won't be convenient to place them in the installation folder, because a) user may have several versions installed, b) latest Windows does not like files modified in Program Files. Perhaps find a new location in %AppData%? We could move game and room templates there too later.
Are there any files that AGS saves to AppData already?


Quote from: ChamberOfFear on Mon 13/04/2015 19:43:59
Also, if I'm going to solve this with xml it would be convenient to have access to LINQ or lambda expressions which is currently not supported since the editor uses .NET 2.0. (Actually that would be convenient just in general.) I noticed there was a discussion some time ago about upgrading to .NET 3.5 but the discussion didn't seem to reach a conclusion http://www.adventuregamestudio.co.uk/forums/index.php?topic=50995.0
Could we do the upgrade?

I recall trying that out by simply changing NET version in a project:
Quote from: Crimson Wizard on Mon 15/09/2014 16:05:47
Well, changed all projects including native lib to 3.5, it compiles and runs, did not notice anything bad.
I'd say we could changing it and make test runs. I think it should be tested on WinXP to see if it still works. Additionally, we could do tests on Wine and whichever thing Mac users use to run Windows apps (Wineskin?); I heard number of users run AGS on Linux & Mac.

ChamberOfFear

Quote from: Crimson Wizard on Thu 16/04/2015 09:54:57
Perhaps find a new location in %AppData%?
That works, thank you.

Quote from: Crimson Wizard on Thu 16/04/2015 09:54:57
Are there any files that AGS saves to AppData already?
On my computer I found a file named Layout.xml. I think it contains savedata on the docking layout of the editor.

Quote from: Crimson Wizard on Thu 16/04/2015 09:54:57
I'd say we could changing it and make test runs. I think it should be tested on WinXP to see if it still works. Additionally, we could do tests on Wine and whichever thing Mac users use to run Windows apps (Wineskin?); I heard number of users run AGS on Linux & Mac.
I don't really have access to WinXP or Mac, and is somewhat inexperienced in Linux, so I may not be that helpful in testing if it works. However it would be great if this upgrade got realized as .NET 3.5 has more convenient tools than .NET 2.0.

Monsieur OUXX

#28
Careful if you start using %AppData%. That's for custom settings, that are saved after the game's first execution (typically: the position of docking windows, in layout.xml). Big fancy apps like Photoshop will copy their default brushes there (at installation time), to demonstrate that they are all still custom in essence, but that's only for showing off.

The default themes, however, would probably be shipped along with AGS. Hence their location should be the Editor's folder (inside /Themes subfolder).

Maybe what I wrote above is utter bullshit ^ Please ignore it if it turns out I made a complete fool out of myself.

 

ChamberOfFear

Well the one and only default theme, which I so far have just referred to as the Vanilla theme, comes from the code itself(Windows Forms), not xml-files. The custom themes works independently from that, so I don't think it should be a problem. In fact, the way you describe it makes %AppData% the perfect location to store these files if the implementation turns out as I have intended it.

jwalts37

Haha I guess now Im confused. I had added an option in preferences to change the theme.

At the time I couldn't figure out how to refresh real-time so the current script had to be reopened. But I actually ended up figuring out how to redraw/fresh it. I dont remember this option being in any of the major releases. Is that what you meant?

Dave Gilbert

Sorry to necropost! Lately I've been getting annoyed by the light-blue text on the white background (in the dialog editor specifically) and was hoping there was a way to change the colors. Has there been any further attempts to merge this with the latest version of AGS?

Crimson Wizard

Two years ago I was suggesting to improve the code, but since the development of Editor has since stopped, I guess there is not much sense to aim code beauty. So, yes, let's put this in.

Dave Gilbert


AnasAbdin

Sorry to bump this, I'm using "v3.3.3, December 2014"..
is there a way I can get the dark theme with/without a patch that I don't know about? :-[
MY RETINAS GOT BLEACHED FROM THE WHITE BACKGROUND

Crimson Wizard

IDK if we should continue in the same topic, but there is a new pull request by persn (aka ChamberOfFear) with the new version of this feature: https://github.com/adventuregamestudio/ags/pull/427

Crimson Wizard

Compiled editor for those who'd like to test: https://www.dropbox.com/s/4peq0unk29grqrs/ags-editor-themes.zip?dl=0

WARNING: This is built over master branch, which is WIP code. I do not remember if AGS game format was changed there compared to 3.4.1. Maybe not, but make backups if you are opening your real game projects.

How to test: go to %USERPROFILE%/AppData/Local/AGS and manually create "Themes" folder there (there is a small bug in the editor, so you need to do that by hand).
Then, download this: https://github.com/adventuregamestudio/ags/files/1613027/VisualStudioDark.zip
Unpack and place the VisualStudioDark.json into the folder.

Start the Editor, open Preferences and change Color Themes option in "Editor Appearance" group.

Alan v.Drake

Quote from: Crimson Wizard on Wed 10/01/2018 16:14:01
Compiled editor for those who'd like to test: https://www.dropbox.com/s/4peq0unk29grqrs/ags-editor-themes.zip?dl=0

You should include "Newtonsoft.Json.dll" in the archive, or else no one but us, who hold the knowledge of gods, will be able to try it out.  :=

- Alan


Crimson Wizard

#39
Updated version from the latest source (with some fixes): https://www.dropbox.com/s/4peq0unk29grqrs/ags-editor-themes.zip?dl=0

Reminder: DO NOT SAVE YOUR ACTUAL GAME PROJECT in that editor (yet), because it is based on untested post-3.4.1 version.

How to:
Download this: https://github.com/adventuregamestudio/ags/files/1613027/VisualStudioDark.zip and unpack somewhere.
Open the Editor, go to File -> Preferences: Editor Appearance - Import Color Theme. Choose the theme file you unpacked. Make sure it is selected in the combo box. Press OK.
Now restart the Editor.

Pull request on github: https://github.com/adventuregamestudio/ags/pull/427

SMF spam blocked by CleanTalk