Skip to content

Comments

Second wave of eu5 changes#314

Open
kaiser-chris wants to merge 5 commits intoamtep:mainfrom
kaiser-chris:feature/eu5
Open

Second wave of eu5 changes#314
kaiser-chris wants to merge 5 commits intoamtep:mainfrom
kaiser-chris:feature/eu5

Conversation

@kaiser-chris
Copy link
Contributor

No description provided.

Copy link
Owner

@amtep amtep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some issues in the last commit :) Otherwise good

vd.req_field_one_of(&["blend_shape", "additive_animation"]);
vd.field_item("name", Item::GeneAttribute);
vd.field_item("additive_animation", Item::GeneAttribute);
vd.field("additive_animation"); // TODO: eu5 link to defined "additive_animation"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in code shared between games, so this change needs to be guarded with Game::is_eu5()

gui.items.push(GuiItem::ActionTooltip(guiblock));
}
_ => {
let msg = "action tooltip needs to be a block";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use bv.expect_block() instead of matching.

If you do want to match to give a nicer error message, then the error key should not be WrongGame :) Probably Structure.

use crate::datatype::{Datatype, validate_datatypes};
use crate::everything::Everything;
#[cfg(feature = "ck3")]
#[cfg(any(feature = "ck3", feature = "eu5"))]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be for all games now? Since Game::is_eu5() is used in unguarded code

}
}
}
GuiValidation::ActionTooltip => match bv {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about being able to use bv.expect_block()

BV::Block(block) => {
if !Game::is_eu5() {
let msg = "action tooltip is only for EU5";
err(ErrorKey::Gui).msg(msg).loc(block).push();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error key should be WrongGame here

err(ErrorKey::Gui).msg(msg).loc(value).push();
}
BV::Block(block) => {
if !Game::is_eu5() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a TODO for the else branch, so we don't forget

| colormap_coordinates
| contextmenu_enabled
| contextmenu_widget
| debug_text
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually is eu5 only :) In vic3 it's not a field. I'll have to think about how to make tiger handle that. But it shouldn't be removed from this match branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants