Jump to content
  • Topics

  • Posts

    • Hi @Adriano0ad, Here is a solution if you want to control the margin between buttons dynamically. No file replacement needed. If you want to change the margin for all panels: setPanelObjectPosition = new Proxy(setPanelObjectPosition, {apply: function(target, thisArg, args) { const vMargin = 3; // Vertical margin between buttons const hMargin = 3; // Horizontal margin between buttons target(args[0], args[1], args[2], vMargin, hMargin); }}); and place this code in a new file gui/session/unit_commands~MyMod.js.   If instead, you want to change the margin for one/some panel(s) only (f.e. "Construction" panel): g_SelectionPanels.Construction.setupButton = new Proxy(g_SelectionPanels.Construction.setupButton, {apply: function(target, thisArg, args) { const ret = target(...args); // Run original function const vMargin = 3; // Vertical margin between buttons const hMargin = 3; // Horizontal margin between buttons const data = args[0]; setPanelObjectPosition(data.button, data.i + getNumberOfRightPanelButtons(), data.rowLength, vMargin, hMargin); return ret; }}); and place this code in a new file gui/session/selection_panels~MyMod.js.
    • I don't quite understand what you mean here. Restate? Oh, I have a complete vision for how the game would look with hard battalions. The problem is, there are about a dozen contributors to the codebase of the game all with their own vision so that the current meta of the game just moves forward with its own limp inertia. 
    • Hi @Adriano0ad,  I'm guessing what you mean is that you resized the panel and now you want icons to fit better in the panel.   The spacing is calculated dynamically so you should only have to increase the number of items per row. In the selection_panels.js for example : g_SelectionPanels.Construction = { "getMaxNumberOfItems": function() { return 40 - getNumberOfRightPanelButtons(); }, "rowLength": 10, // <<<< INCREASE THIS NUMBER to 12 for example "getItems": function() { ...  
    • I don't know what I did wrong, but I can't find where to reduce the spacing between the icons. I've even replaced the folders, but the error persists.
    • I think a must have that would make the game a lot better is being able to build bridges over water to connect land. It would make lots of things like the movement of land troops so versatile, and if you added the ability to build walls atop bridges to make a sort of tunnel without a roof, you'd be able to make very strong fortresses on island naval maps. I think a bridge variation for not every class could work as well, but most should have. Thats all.
×
×
  • Create New...