algernon-a / algernoncommons Goto Github PK
View Code? Open in Web Editor NEWShared project commons for Cities: Skylines modding
License: MIT License
Shared project commons for Cities: Skylines modding
License: MIT License
Hi there, I'm trying to modernize Parallel Road Tool and I found out this great repo.
I've started rewriting stuff to use your code, but I'm having some issues with settings and keybindings.
Main issue is that I can change a keybinding, but the change will be lost as soon as I close the options panel and reopen it. It also doesn't correctly load the defaults that I'm setting.
Here are some implementation details:
// OptionsPanel.ctor
var keyBindingsGroup = (UIHelper)helper.AddGroup(Translations.Translate("GROUP_KEYBINDINGS_NAME"));
((UIPanel)keyBindingsGroup.self).gameObject.AddComponent<ToggleButtonOptionsKeymapping>();
// ToggleButtonOptionsKeymapping
public class ToggleButtonOptionsKeymapping : OptionsKeymapping
{
public ToggleButtonOptionsKeymapping()
{
Label = Translations.Translate("SELECT_KEYMAPPING_TOGGLEBUTTON_LABEL");
ButtonLabel = Translations.Translate("PRESS_ANY_KEY");
}
protected override InputKey KeySetting
{
get => ModSettings.KeyPaste.Encode();
set => ModSettings.KeyPaste.SetKey(value);
}
}
// ModSettings
[XmlRoot("SettingsFile")]
public class ModSettings : SettingsXMLBase
{
...
[XmlElement]
public static readonly Keybinding KeyPaste = new(KeyCode.P, true, false, false);
...
internal static void Load() => XMLFileUtils.Load<ModSettings>(SettingsFileName);
internal static void Save() => XMLFileUtils.Save<ModSettings>(SettingsFileName);
}
What I'd expect to have in my OptionsPanel
would be a pre-selected CTRL+P
keybinding, however, if I remove the ButtonLabel
, it shows as ctrl+alt+shift+A
(which rings like a default value).
Also, I click and set a new value, the value is shown correctly just for it to be reverted as soon as I close the panel.
The XML file doesn't contain anything related to the keybinding, so I assume it's not saved correctly somehow.
Can you please help me with that?
Hello.
Should I translate the languages in this shared framework?
Or if you are willing to deal with Crowdin translations, we will do nothing.
If translation is needed, we will fork it and PR it.
Just a minor but annoying find.
If I use InGameAtlas
from UITextures
I get a NRE because it seems like there's no ingame
atlas for me.
After some quick testing I found out that Ingame
works instead (capital I), so maybe a non-breaking change could be to change that line to:
public static UITextureAtlas InGameAtlas => GetTextureAtlas("ingame") ?? GetTextureAtlas("Ingame");
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.