GithubHelp home page GithubHelp logo

seclerp / rider-monogame Goto Github PK

View Code? Open in Web Editor NEW
27.0 1.0 1.0 3.93 MB

MonoGame plugin for JetBrains Rider

Home Page: https://plugins.jetbrains.com/plugin/18415-monogame

License: MIT License

Kotlin 78.69% C# 17.29% Lex 3.23% HLSL 0.80%
dotnet dotnet-core jetbrains-plugin jetbrains-rider monogame monogame-gui monogame-pipeline monogame-framework

rider-monogame's Introduction

MonoGame plugin for JetBrains Rider

Logo

This plugin improves MonoGame usage experience inside JetBrains Rider.

Build

MGCB file editing

How to use 1

Autocomplete and syntax highlighting

All supported MGCB options properly highlighted and could be autocompleted



How to use 1

Build entries previewer

See all your assets in a realtime tree view according to their declarations



How to use 1

Table view for a build entry properties

Review build entry properties and processor parameters in a table representation



How to use 1

Open in external MGCB editor action

Jump to external MGCB editor GUI in one click


Other

How to use 1

Additional file templates

Easily create MonoGame related assets using file templates under Add menu



How to install

Using marketplace:

For EAP users: you should add https://plugins.jetbrains.com/plugins/eap/list to your plugin repositories list before installing

  1. Go to Settings / Plugins / Marketplace
  2. Search for "MonoGame"
  3. Click Install, then Save
  4. After saving restart Rider

Using .zip file

  1. Go to Releases
  2. Download the latest release of plugin for your edition of JetBrains Rider (Stable or EAP)
  3. Proceed to Settings / Plugins / โš™ / Install plugin from disk
  4. Click Save
  5. After saving restart Rider

How to use

Just open .mgcb file for editing. Previewer will be on the right side of the editor.

Additional file templates are located under Add section of a folder or project context menu.

Requirements

  • JetBrains Rider 2022.3+

  • Project with MonoGame installed (3.8+ is recommended)

Note: Projects with older versions of MonoGame might work, but with issues

Development

Note: You should have JDK 11 and .NET SDK 5.0+ installed and configured.

Preparing

./gradlew rdgen - generates RD protocol data for plugin internal communication

Building plugin parts

  • for stable version of Rider:

    ./gradlew buildPlugin

  • for EAP version of Rider:

    ./gradlew buildPlugin -PRiderSdkVersion=2022.3.0-eap01 -PProductVersion=2022.3-EAP1-SNAPSHOT

It will build both frontend and backend parts.

Running

Next command will start instance of JetBrains Rider with plugin attached to it:

./gradlew runIde

Contributing

Contributions are welcome! ๐ŸŽ‰

It's better to create an issue with description of your bug/feature before creating pull requests.

About branching

This project uses customized git strategy.

Each release/* branch plays main development branch role for specific release.

For example, release/222 means that branch is related to 222.* release cycle for 2022.2 Rider version.

See also

rider-monogame's People

Contributors

alls-cpp avatar seclerp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

alls-cpp

rider-monogame's Issues

General: Implement other MonoGame-related file templates

Need to implement file templates for corresponding MGCB Editor dialog:

image

https://docs.monogame.net/articles/content/using_mgcb_editor.html#adding-content-items

Implementation details:

  1. Effect (.fx): just regular file with .fs extension. Syntax highlighting will be added in later versions (maybe)
  2. Both SpriteFont Descriptions (.spritefont): introduce as a custom XML file type SpriteFontFileType
  3. Sprite Effect (.fx): the same as (1)
  4. Xml Content (.xml): just regular XML file type

All templates content should be the same as what MGCB generates when creating new files

Spritefont: Add XML schema for `.spritefont` files

Currently, .spritefont files are just dommy XML files with syntax highlighting, without any autocompletion. It would be great to create a schema for that type of asset and provide it via com.intellij.xml.XmlSchemaProvider.

General: refactor MGCB Editor Tool detection and installation logic

Currently, MGCB Editor Tool is detected from the frontend side in quite an ineffective and buggy way.

ReSharper 2022.2 SDK comes with NuGetDotnetToolsTracker that could be used on a project-scoped level to detect mgcb-editor tool instance (both local and global ones).

We should also keep in mind that according to #13 MonoGame 3.8.1 has changed the way of installing and using mgcb-editor tool. It will be great if we come to a generic approach that could work on any MonoGame version without branching.

Solution-level MGCB not found

Hi there,
I am currently trying to access the MGCB through the plugin. I have set up my project in such a way that the sln is in a separate directory to the csproj, and this is preventing me from being able to open the MGCB whilst I am working in the solution. In my Rider settings, going to Tools > MonoGame > MGCB shows:

  • Global tools mgcb-editor: Not Found
  • Solution-level tools mgcb-editor: Not Found
  • Project-level tools {ProjectName}: dotnet-mgcb-editor-windows: 3.8.1.303
    I am able to fix this by editing the project through the .csproj instead of the .sln, but I prefer to use the .sln because it's where the git repo is. Is there a workaround for this?
    I have also considered using the global MGCB tool, but the website advises against this.
    Thank you!

Update to latest Rider version

Hello!

Would it be possible to update the current version of the plugin to Rider 2023.1?
At the moment it does not work completely due to compatibility with the latest builds

MGCB Actions: Check for mgcb-editor installation

Currently "Open in MGCB editor" action does not respect the state of MGCB Editor installation before executing.

Need to:

  • Implement checking inside MgcbEditorCheckService.checkInstalled() using mgcb-editor --help probing
  • Create notification "Seems like you don't have MGCB Editor global tool installed." with "Install" button on startup (CheckMgcbEditorInstalledActivity)
  • Disable/enable "Open in MGCB editor" action according to the current installation state

MGCB Previewer: Implement read-only Properties panel

At right to the build entries tree we need to implement Properties panel. It should have 2 tables: Properties and Processor parameters, splitter vertically, example:

Properties

Key Value
Name wood.png
Content Path Textures/wood
Build Path Textures/wood.png
Importer TextureImporter
Processor TextureProcessor

Processor Parameters

Key Value
ColorKeyEnabled false

Data for this UI will be available after #1

Exception Thrown when switching solutions

First, thank you for this plugin.

Receive this exception when opening a solution after closing an open solution:

com.intellij.serviceContainer.AlreadyDisposedException: Cannot create light service me.seclerp.rider.plugins.monogame.mgcb.services.MgcbEditorCheckService because container is already disposed (container=Project(name=ProjectName, containerState=DISPOSE_COMPLETED, componentStore=/home/username/Development/SourceCode/ProjectName) (disposed))
at com.intellij.serviceContainer.ContainerUtilKt.throwAlreadyDisposedError(containerUtil.kt:34)
at com.intellij.serviceContainer.ComponentManagerImpl.checkThatCreatingOfLightServiceIsAllowed(ComponentManagerImpl.kt:671)
at com.intellij.serviceContainer.ComponentManagerImpl.getOrCreateLightService(ComponentManagerImpl.kt:643)
at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:607)
at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:569)
at com.intellij.openapi.client.ClientAwareComponentManager.getFromSelfOrCurrentSession(ClientAwareComponentManager.kt:37)
at com.intellij.openapi.client.ClientAwareComponentManager.getService(ClientAwareComponentManager.kt:22)
at me.seclerp.rider.plugins.monogame.mgcb.startup.CheckMgcbEditorInstalledActivity.check(CheckMgcbEditorInstalledActivity.kt:24)
at me.seclerp.rider.plugins.monogame.mgcb.startup.CheckMgcbEditorInstalledActivity.runActivity$lambda-0(CheckMgcbEditorInstalledActivity.kt:12)
at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:317)
at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:249)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

MGCB Previewer: Analyze `.mgcb` file

Need to parse all entries in .mgcb file and create entries with properties attached.

Example:

From:

/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyEnabled=false
/build:Textures\wood.png
/build:Textures\metal.png
/build:Textures\plastic.png

To:

BuildEntryProperties "Textures/wood.png" {
  importer = TextureImporter
  processor = TextureProcessor
  ProcessorParameters {
    ColorKeyEnabled = false
  }
}

BuildEntryProperties "Textures/metal.png" {
  importer = TextureImporter
  processor = TextureProcessor
  ProcessorParameters {
    ColorKeyEnabled = false
  }
}

BuildEntryProperties "Textures/plastic.png" {
  importer = TextureImporter
  processor = TextureProcessor
  ProcessorParameters {
    ColorKeyEnabled = false
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.