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

Editor comment #3181

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Editor comment #3181

wants to merge 10 commits into from

Conversation

MatusGuy
Copy link
Member

The editor comment allows level designers to leave a note for themselves or other level designers collaborating on the same level. Similar to a code comment, it can be used to write to-do lists, fixmes, or notes.

This feature supports info box formatting, like what you'd see in the info block or the text scroller.

Testers: Please test all formatting features in the editor comment (of course), the info block, and the text scroller (via credits, I guess).
Use this as a reference for all formatting features:

InfoBoxLine::LineType get_linetype_by_format_char(char format_char) {
switch (format_char)
{
case ' ':
return InfoBoxLine::SMALL;
case '\t':
return InfoBoxLine::NORMAL;
case '-':
return InfoBoxLine::HEADING;
case '*':
return InfoBoxLine::REFERENCE;
case '#':
return InfoBoxLine::NORMAL_LEFT;
case '!':
return InfoBoxLine::IMAGE;
default:
return InfoBoxLine::SMALL;
//log_warning << "Unknown format_char: '" << format_char << "'" << std::endl;
}
}

@Alasdairbugs Alasdairbugs self-requested a review January 18, 2025 16:24
@Alasdairbugs
Copy link
Contributor

image

i get missing texture for the icon in the thingy

@MatusGuy
Copy link
Member Author

fixed

Copy link
Member

@Vankata453 Vankata453 left a comment

Choose a reason for hiding this comment

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

I'll test it tomorrow.

Copy link
Member

Choose a reason for hiding this comment

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

Missing copyright header.

Comment on lines +91 to +92
for (auto& line : m_lines)
line.reset();
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to do this.

Comment on lines +16 to +17
reader.get("x", m_col.m_bbox.get_left(), 0.f);
reader.get("y", m_col.m_bbox.get_top(), 0.f);
Copy link
Member

Choose a reason for hiding this comment

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

Already done by MovingObject constructor.

Comment on lines +1 to +2
#ifndef EDITOR_COMMENT_HPP
#define EDITOR_COMMENT_HPP
Copy link
Member

Choose a reason for hiding this comment

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

Missing copyright header, and also, follow the include guard convention used throughout the source.

explicit EditorComment(const ReaderMapping& reader);

virtual void draw(DrawingContext& context) override;
virtual void update(float dt_sec) override { MovingObject::update(dt_sec); }
Copy link
Member

Choose a reason for hiding this comment

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

Unnecessary


private:
void refresh_comment();
Color get_color();
Copy link
Member

Choose a reason for hiding this comment

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

const (CV) qualifier can be added.

private:
std::string m_comment;
std::vector<std::unique_ptr<InfoBoxLine>> m_lines;
};
Copy link
Member

Choose a reason for hiding this comment

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

Add a non-copyable footer to this class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants