Jump to content

Breaking Changes following 22379


Stan`
 Share

Recommended Posts

  • 1 month later...
On 6/16/2019 at 8:44 PM, Stan` said:

This change will then allow any modder to add different types of attack to his mod.

The followup (rP22527/D1938) has also been committed. This change means that not every damage type needs to be stated in all the templates (an armour of "0" is assumed against a non-declared damage type). No extra template changes are needed following this change.

Questions? Please ask :)

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
1 minute ago, Stan` said:

What part of what @Nescio propose did you disagree with ?

"Spear" is for the weapon. When I upgrade spears at the blacksmith, then every unit with a spear is upgraded, not just the "spearman" class. Nescio's patch strips out the weapon classes for unit classes, when before the unit classes were a combination of classes that put the weapon type front and center, e.g. "Spear Infantry," at least in DE. 

Link to comment
Share on other sites

13 minutes ago, wowgetoffyourcellphone said:

"Spear" is for the weapon. When I upgrade spears at the blacksmith, then every unit with a spear is upgraded, not just the "spearman" class. Nescio's patch strips out the weapon classes for unit classes, when before the unit classes were a combination of classes that put the weapon type front and center, e.g. "Spear Infantry," at least in DE. 

To be honest SVN doesn't really work that way right now + we don't really have spear-specific upgrades. This is just a good example of how your mod handles things differently.

  • Like 1
Link to comment
Share on other sites

rP22854 rewrote the main menu code.

Mods that wnat to specify their name to be displayed in the main menu can easily do so by adding a new file instead of rewriting mainmenu.xml.

@wowgetoffyourcellphone

Your mainmenu.xml contained this diff to svn:

Spoiler

< 					<action on="Press">
< 						closeMenu();
< 						Engine.PushGuiPage("page_structree.xml", {});
< 					</action>
---
> 					<action on="Press">openStrucTree("page_structree.xml");</action>
138,141c134
< 					<action on="Press">
< 						closeMenu();
< 						Engine.PushGuiPage("page_civinfo.xml");
< 					</action>
---
> 					<action on="Press">openStrucTree("page_civinfo.xml");</action>
463c456
< 					<translatableAttribute id="caption">Atlas Scenario Editor</translatableAttribute>
---
> 					<translatableAttribute id="caption">Scenario Editor</translatableAttribute>
499c492
< 						<translate>Delenda Est v0.0.03</translate>
---
> 						<translate>Alpha XXIV</translate>
501c494
< 						<translate>WARNING: This is an early development version of the mod. Many features have not been added yet.</translate>
---
> 						<translate>WARNING: This is an early development version of the game. Many features have not been added yet.</translate>

and I would recommend to delete this file and put this file under pregame/ProjectInformation_DelendaEst.js:

g_ProjectInformation.productDescription.caption =
	setStringTags(translate("Delenda Est v0.0.03"), { "font": "sans-bold-16" }) + "\n\n" +
	translate("Notice: This mod is under development and many features have not been added yet.");

g_MainMenuItems[4].caption = translate("Atlas Scenario Editor");

g_CommunityButtons[0].tooltip = translate("Click to open https://0ad.mod.io/delenda-est in your web browser.");
g_CommunityButtons[0].onPress = () => {
	openURL("https://0ad.mod.io/delenda-est");
};

The mods that have more weblinks or information to add, see ProjectInformation.js:

Spoiler



/**
 * IMPORTANT: Remember to update session/top_panel/label.xml in sync with this.
 */
var g_ProjectInformation = {
	"organizationName": {
		"caption": translate("WILDFIRE GAMES")
	},
	"organizationLogo": {
		"sprite": "WildfireGamesLogo"
	},
	"productLogo": {
		"sprite": "0ADLogo"
	},
	"productBuild": {
		"caption": getBuildString()
	},
	"productDescription": {
		"caption": setStringTags(translate("Alpha XXIV"), { "font": "sans-bold-16" }) + "\n\n" +
			translate("Notice: This game is under development and many features have not been added yet.")
	}
};

var g_CommunityButtons = [
	{
		"caption": translate("Website"),
		"tooltip": translate("Click to open play0ad.com in your web browser."),
		"size": "8 100%-180 50%-4 100%-152",
		"onPress": () => {
			openURL("https://play0ad.com/");
		}
	},
	{
		"caption": translate("Chat"),
		"tooltip": translate("Click to open the 0 A.D. IRC chat in your browser. (#0ad on webchat.quakenet.org)"),
		"size": "50%+4 100%-180 100%-8 100%-152",
		"onPress": () => {
			openURL("https://webchat.quakenet.org/?channels=0ad");
		}
	},
	{
		"caption": translate("Report a Bug"),
		"tooltip": translate("Click to visit 0 A.D. Trac to report a bug, crash, or error."),
		"size": "8 100%-144 100%-8 100%-116",
		"onPress": () => {
			openURL("https://trac.wildfiregames.com/wiki/ReportingErrors/");
		}
	},
	{
		"caption": translate("Translate the Game"),
		"tooltip": translate("Click to open the 0 A.D. translate page in your browser."),
		"size": "8 100%-108 100%-8 100%-80",
		"onPress": () => {
			openURL("https://trac.wildfiregames.com/wiki/Localization");
		}
	},
	{
		"caption": translate("Donate"),
		"tooltip": translate("Help with the project expenses by donating."),
		"size": "8 100%-72 100%-8 100%-44",
		"onPress": () => {
			openURL("https://play0ad.com/community/donate/");
		}
	},
	{
		"caption": translate("Credits"),
		"tooltip": translate("Click to see the 0 A.D. credits."),
		"size": "8 100%-36 100%-8 100%-8",
		"onPress": () => {
			Engine.PushGuiPage("page_credits.xml");
		}
	}
];


 

 

  • Like 4
Link to comment
Share on other sites

Neat. Looks useful. Got this though:

 

Spoiler

ERROR: JavaScript error: gui/pregame/MainMenuItemHandler.js line 61 TypeError: Engine.SetGlobalHotkey is not a function setupHotkeys@gui/pregame/MainMenuItemHandler.js:61:5 setupHotkeys@gui/pregame/MainMenuItemHandler.js:68:5 MainMenuItemHandler@gui/pregame/MainMenuItemHandler.js:19:3 init@gui/pregame/mainmenu.js:12:18

ERROR: GUI page 'page_pregame.xml': Failed to call init() function

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

ERROR: JavaScript error: gui/pregame/mainmenu.js line 23 TypeError: g_MenuHandler is undefined onTick@gui/pregame/mainmenu.js:23:2 __eventhandler2 (tick)@__internal(0) tick:0:1

 

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

17 hours ago, elexis said:

rP22854 rewrote the main menu code.

Today I noticed that clicking the History button when the Structure Tree window is opened no longer works in A24, nor does clicking the Structure Tree when the History window is opened. Interestingly, the hotkeys (Alt+Shift+H and Alt+Shift+T) do work. I don't know what broke the buttons, but the problem isn't there in A23.

Link to comment
Share on other sites

55 minutes ago, Nescio said:

Today I noticed that clicking the History button when the Structure Tree window is opened no longer works in A24, nor does clicking the Structure Tree when the History window is opened. Interestingly, the hotkeys (Alt+Shift+H and Alt+Shift+T) do work. I don't know what broke the buttons, but the problem isn't there in A23.

Can you check whether it's that commit and raise a concern if so ? Thank you

Link to comment
Share on other sites

3 hours ago, Nescio said:

Today I noticed that clicking the History button when the Structure Tree window is opened no longer works in A24, nor does clicking the Structure Tree when the History window is opened. Interestingly, the hotkeys (Alt+Shift+H and Alt+Shift+T) do work. I don't know what broke the buttons, but the problem isn't there in A23.

It works for me, any mods active? Or leftover mainmenu.xml? I suppose windows?

43 minutes ago, wowgetoffyourcellphone said:

For a couple days now adjusting settings in game causes the game to pause with no dialogue. You have to pause and unpause again.

I suppose that is the outdated menu.js copy. The commits after July 27th are missing. Your only change is this:

--- /tmp/menu.js_orig	2019-09-07 01:04:59.261486333 +0200
+++ /tmp/menu.js_de	2019-09-07 01:03:29.124822542 +0200
@@ -849,7 +849,9 @@
 		});
 	};
 
-	barterButton.Buy.hidden = isSelected;
+	if (g_BarterSell == "coin"){
+		barterButton.Buy.hidden = isSelected;}
+	else {barterButton.Buy.hidden = resourceCode != "coin";}
 	barterButton.Buy.enabled = controlsPlayer(player);
 	barterButton.Sell.hidden = false;
 	selectionIcon.hidden = !isSelected;

Perhaps to keep track of your chances, you might want to store the diffs along the mod? i.e. the above in menu.js.diff, and then when theres a new menu.js in svn, you can apply the patch again rather than applying the svn commit to your copy.

  • Thanks 1
Link to comment
Share on other sites

9 hours ago, elexis said:

It works for me, any mods active? Or leftover mainmenu.xml? I suppose windows?

No mods active, just the newest svn version; gui/pregame/mainmenu.xml is identical to what it's supposed to be; and Fedora 30, not Windows.

Also, in game (session) the buttons do work. Only when opening them from the pre-game main menu clicking the History button in the Structure Tree window closes the Structure Tree, rather than opening the History window, and clicking the Structure Tree button in the History window closes the History, rather than opening the Structure Tree. And as said before, the hotkeys do work, so I don't really understand why the buttons don't on my end.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...