Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added forms for variant game options panes, fixed size bug in polygonal board helper #92

Merged
merged 7 commits into from
Apr 6, 2023

Conversation

merowin
Copy link
Collaborator

@merowin merowin commented Apr 3, 2023

No description provided.

@benjaminpjones
Copy link
Collaborator

I haven't read the code yet, but I just tried it out, and looks great!

Regarding "All checks have failed": yarn lint should automatically fix most, but not all the errors. Some (such as no-unused-vars) need to be fixed manually. Fixing the eslint/prettier errors will get the CI green again.

const StartTile: PolygonalTile = new PolygonalTile(new Vector2D(0, 0));
const Tiles: PolygonalTile[] = [StartTile];
let tileQueue: PolygonalTile[] = [StartTile];

for (let i = 1; i < (size + 1) / 2; i++) {
for (let i = 1; i <= (size - 1) / 2; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a breaking change? Will this affect already-created polygonal boards?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, yes I believe this would potentially break existing games with polygonal boards.

The "bug" this change tries to fix is not really a problem actually. I just think that the size of the polygonal board grows more naturally with this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay good to know, breaking changes are okay - we don't have users to be bothered, just wanted to check!

</select>
</div>
<label>Config: </label>
<template v-if="variant==='baduk' || variant==='phantom' || variant=='capture'">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a thought..

It might nice if we could have a mapping from Variants to ConfigViews, kind of like how we map variants to boards (board_map.ts). The benefits would be brevity and separation of concerns.

But that is not a blocker, I think it looks pretty good as-is!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok I added a map from variants to the form components, named config_form_map

also ran yarn lint and removed sign restriction from komi inputs.

Copy link
Collaborator

@JonKo314 JonKo314 left a comment

Choose a reason for hiding this comment

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

Thanks for adding this 👍.

I've left a few notes but nothing important, feel free to ignore them.

.column {
display: flex;
flex-direction: column;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Somehow I don't like the name of this class. A column can also appear in a grid layout or table layout and those will probably appear in the main.css too. We can leave it like this for now, but maybe I should look up some good practices for naming CSS classes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renamed to config-form-column

style="width: fit-content"
/>
</div>
</template>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just add a CSS rule input { width: fit-content } inside a <style> block for the component? Don't repeat yourself (DRY).

Or .awesomeClassName input { width: fit-content } somewhere for all config components?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added style block and rule

@@ -0,0 +1,74 @@
<script setup lang="ts">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dear Git, why don't you recognize this file isn't new, but was just moved and modified?
See How to make git mark a deleted and a new file as a file move? if you want to avoid this in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Haha the diff is pretty significant, may have been unavoidable 😅

Edit: well maybe not- I guess 20 lines added

</script>

<template>
<div class="column">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this <div> could be a <form> with a @change, then it wouldn't be necessary to add @change to each <input>.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@merowin merowin merged commit a33784b into main Apr 6, 2023
@benjaminpjones benjaminpjones mentioned this pull request Apr 12, 2023
@merowin merowin deleted the game-options-pane branch July 20, 2023 17:20
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.

None yet

3 participants