mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added empty_name to PackageChoiceField;
Package choice fields now reflect in scripts as "/:NO-WARN-DEP:packagename". This suppresses warnings when loading files in that package or using the package as a symbol font. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1187 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -47,15 +47,24 @@ void PackageChoiceValueViewer::initItems() {
|
||||
void PackageChoiceValueViewer::draw(RotatedDC& dc) {
|
||||
drawFieldBorder(dc);
|
||||
// find item
|
||||
FOR_EACH(i, items) {
|
||||
if (i.package_name != value().package_name) continue;
|
||||
// draw image
|
||||
if (i.image.Ok()) {
|
||||
dc.DrawBitmap(i.image, RealPoint(0,0));
|
||||
String text = value().package_name;
|
||||
Bitmap image;
|
||||
if (value().package_name.empty()) {
|
||||
text = field().empty_name;
|
||||
} else {
|
||||
FOR_EACH(i, items) {
|
||||
if (i.package_name == value().package_name) {
|
||||
text = i.name;
|
||||
image = i.image;
|
||||
}
|
||||
}
|
||||
// draw text
|
||||
dc.SetFont(style().font, 1.0);
|
||||
RealPoint pos = align_in_rect(ALIGN_MIDDLE_LEFT, RealSize(0, dc.GetCharHeight()), dc.getInternalRect()) + RealSize(17., 0);
|
||||
dc.DrawTextWithShadow(i.name, style().font, pos);
|
||||
}
|
||||
// draw image
|
||||
if (image.Ok()) {
|
||||
dc.DrawBitmap(image, RealPoint(0,0));
|
||||
}
|
||||
// draw text
|
||||
dc.SetFont(style().font, 1.0);
|
||||
RealPoint pos = align_in_rect(ALIGN_MIDDLE_LEFT, RealSize(0, dc.GetCharHeight()), dc.getInternalRect()) + RealSize(17., 0);
|
||||
dc.DrawTextWithShadow(text, style().font, pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user