diff --git a/Include/TSEItemDefs.h b/Include/TSEItemDefs.h index 0d7f4f6..2d30dae 100644 --- a/Include/TSEItemDefs.h +++ b/Include/TSEItemDefs.h @@ -81,7 +81,13 @@ enum EDisplayAttributeTypes attribNegative, attribEnhancement, - attribWeakness, + attribDegradation, + + attribControlled, + attribBanned, + + attribCustomMagenta, + attribCustomBrown, }; enum EAttributeTypes @@ -109,9 +115,8 @@ struct SDisplayAttribute if (*sText.GetASCIIZPointer() != '+') sText = strPatternSubst(CONSTLIT("+%s"), sText); break; - case attribNegative: - iType = attribWeakness; + iType = attribDegradation; if (*sText.GetASCIIZPointer() != '-') sText = strPatternSubst(CONSTLIT("-%s"), sText); break; @@ -123,7 +128,7 @@ struct SDisplayAttribute { int i; for (i = 0; i < List.GetCount(); i++) - if (List[i].iType == attribEnhancement || List[i].iType == attribWeakness) + if (List[i].iType == attribEnhancement || List[i].iType == attribDegradation) return true; return false; diff --git a/Include/TSUI.h b/Include/TSUI.h index 92f1d78..7eef19f 100644 --- a/Include/TSUI.h +++ b/Include/TSUI.h @@ -397,16 +397,31 @@ enum EColorPalette colorTextDockWarning = 28, // H:0 S:80 B:100 colorAreaAdvantage = 29, // H:210 S:100 B:65 - colorAreaDisadvantage = 30, // H:0 S:80 B:65 - colorAreaShields = 31, // H:90 S:80 B:45 - colorTextAdvantage = 32, // H:210 S:20 B:100 - colorTextDisadvantage = 33, // H:0 S:20 B:100 - colorTextShields = 34, // H:90 S:20 B:100 - colorTextAccelerator = 35, // H:60 S:100 B:100 - colorAreaAccelerator = 36, // H:60 S:100 B:80 - colorTextQuote = 37, // H:210 S:30 B:100 - - colorCount = 38, + colorAreaDisadvantage = 30, // H:30 S:80 B:65 + colorAreaEnhancement = 31, // H:120 S:80 B:65 + colorAreaDegradation = 32, // H:0 S:80 B:65 + colorAreaControlled = 33, // H:280 S:80 B:65 + colorAreaBanned = 34, // H:0 S:0 B:0 + colorAreaCustomMagenta= 35, // H:310 S:80 B:65 + colorAreaCustomBrown= 36, // H:32 S:80 B:32 + + colorAreaShields = 37, // H:90 S:80 B:45 + + colorTextAdvantage = 38, // H:210 S:20 B:100 + colorTextDisadvantage = 39, // H:30 S:20 B:100 + colorTextEnhancement = 40, // H:120 S:20 B:100 + colorTextDegradation = 41, // H:0 S:20 B:100 + colorTextControlled = 42, // H:280 S:20 B:100 + colorTextBanned = 43, // H:0 S:0 B:100 + colorTextCustomMagenta = 44, // H:310 S:20 B:100 + colorTextCustomBrown = 45, // H:32 S:20 B:100 + + colorTextShields = 46, // H:90 S:20 B:100 + colorTextAccelerator = 47, // H:60 S:100 B:100 + colorAreaAccelerator = 48, // H:60 S:100 B:80 + colorTextQuote = 49, // H:210 S:30 B:100 + + colorCount = 50, }; enum EFontScale diff --git a/TSE/CDisplayAttributeDefinitions.cpp b/TSE/CDisplayAttributeDefinitions.cpp index 04dcda7..ee79721 100644 --- a/TSE/CDisplayAttributeDefinitions.cpp +++ b/TSE/CDisplayAttributeDefinitions.cpp @@ -17,6 +17,12 @@ #define TYPE_POSITIVE CONSTLIT("advantage") #define TYPE_NEGATIVE CONSTLIT("disadvantage") #define TYPE_NEUTRAL CONSTLIT("neutral") +#define TYPE_ENHANCEMENT CONSTLIT("enhancement") //Allowed for flexibility +#define TYPE_DEGRADATION CONSTLIT("degradation") //Allowed for flexibility +#define TYPE_CONTROLLED CONSTLIT("controlled") +#define TYPE_BANNED CONSTLIT("banned") +#define TYPE_CUSTOM_MAGENTA CONSTLIT("customMagenta") +#define TYPE_CUSTOM_BROWN CONSTLIT("customBrown") const int DEFAULT_LOCATION_FREQUENCY = 20; @@ -103,6 +109,18 @@ bool CDisplayAttributeDefinitions::InitFromCCItem (ICCItem *pEntry, SDisplayAttr iType = attribPositive; else if (strEquals(sType, TYPE_NEGATIVE)) iType = attribNegative; + else if (strEquals(sType, TYPE_ENHANCEMENT)) + iType = attribEnhancement; + else if (strEquals(sType, TYPE_DEGRADATION)) + iType = attribDegradation; + else if (strEquals(sType, TYPE_CONTROLLED)) + iType = attribControlled; + else if (strEquals(sType, TYPE_BANNED)) + iType = attribBanned; + else if (strEquals(sType, TYPE_CUSTOM_MAGENTA)) + iType = attribCustomMagenta; + else if (strEquals(sType, TYPE_CUSTOM_BROWN)) + iType = attribCustomBrown; else return false; } @@ -154,12 +172,24 @@ ALERROR CDisplayAttributeDefinitions::InitFromXML (SDesignLoadCtx &Ctx, CXMLElem CString sType; if (pDef->FindAttribute(LABEL_TYPE_ATTRIB, &sType)) { - if (strEquals(sType, TYPE_POSITIVE)) + if (strEquals(sType, TYPE_NEUTRAL)) + pEntry->iType = attribNeutral; + else if (strEquals(sType, TYPE_POSITIVE)) pEntry->iType = attribPositive; else if (strEquals(sType, TYPE_NEGATIVE)) pEntry->iType = attribNegative; - else if (strEquals(sType, TYPE_NEUTRAL)) - pEntry->iType = attribNeutral; + else if (strEquals(sType, TYPE_ENHANCEMENT)) + pEntry->iType = attribEnhancement; + else if (strEquals(sType, TYPE_DEGRADATION)) + pEntry->iType = attribDegradation; + else if (strEquals(sType, TYPE_CONTROLLED)) + pEntry->iType = attribControlled; + else if (strEquals(sType, TYPE_BANNED)) + pEntry->iType = attribBanned; + else if (strEquals(sType, TYPE_CUSTOM_MAGENTA)) + pEntry->iType = attribCustomMagenta; + else if (strEquals(sType, TYPE_CUSTOM_BROWN)) + pEntry->iType = attribCustomBrown; else { Ctx.sError = strPatternSubst(CONSTLIT("Invalid label type: %s."), sType); diff --git a/TSE/CItem.cpp b/TSE/CItem.cpp index 9af68ba..268165b 100644 --- a/TSE/CItem.cpp +++ b/TSE/CItem.cpp @@ -811,10 +811,10 @@ bool CItem::GetDisplayAttributes (CItemCtx &Ctx, TArray *retL // Military and Illegal attributes if (m_pItemType->HasLiteralAttribute(CONSTLIT("Military"))) - retList->Insert(SDisplayAttribute(attribPositive, CONSTLIT("military"))); + retList->Insert(SDisplayAttribute(attribControlled, CONSTLIT("military"))); if (m_pItemType->HasLiteralAttribute(CONSTLIT("Illegal"))) - retList->Insert(SDisplayAttribute(attribNegative, CONSTLIT("illegal"))); + retList->Insert(SDisplayAttribute(attribBanned, CONSTLIT("illegal"))); // Add any enhancements @@ -830,10 +830,10 @@ bool CItem::GetDisplayAttributes (CItemCtx &Ctx, TArray *retL // type is unknown). if (IsDamaged()) - retList->Insert(SDisplayAttribute(attribNegative, CONSTLIT("damaged"))); + retList->Insert(SDisplayAttribute(attribDegradation, CONSTLIT("damaged"))); if (IsDisrupted()) - retList->Insert(SDisplayAttribute(attribNegative, CONSTLIT("ionized"))); + retList->Insert(SDisplayAttribute(attribDegradation, CONSTLIT("ionized"))); // Done diff --git a/TSUI/CArmorHUDImages.cpp b/TSUI/CArmorHUDImages.cpp index 8609ceb..98d6c13 100644 --- a/TSUI/CArmorHUDImages.cpp +++ b/TSUI/CArmorHUDImages.cpp @@ -386,19 +386,19 @@ void CArmorHUDImages::Realize (SHUDPaintCtx &Ctx) if (ItemCtx.GetEnhancementDisplayAttributes(&Attribs)) { const CString &sMods = Attribs[0].sText; - bool bDisadvantage = (Attribs[0].iType == attribWeakness); + bool bDisadvantage = (Attribs[0].iType == attribDegradation); int cx = SmallFont.MeasureText(sMods); m_Buffer.Fill(ARMOR_ENHANCE_X - cx - 4, pImage->yName + MediumFont.GetHeight() - HP_DISPLAY_HEIGHT, cx + 8, HP_DISPLAY_HEIGHT, - (bDisadvantage ? VI.GetColor(colorAreaDisadvantage) : VI.GetColor(colorAreaAdvantage))); + (bDisadvantage ? VI.GetColor(colorAreaDegradation) : VI.GetColor(colorAreaEnhancement))); SmallFont.DrawText(m_Buffer, ARMOR_ENHANCE_X - cx, pImage->yName + 3, - (bDisadvantage ? VI.GetColor(colorTextDisadvantage) : VI.GetColor(colorTextAdvantage)), + (bDisadvantage ? VI.GetColor(colorTextDegradation) : VI.GetColor(colorTextEnhancement)), sMods); } } diff --git a/TSUI/CShieldHUDDefault.cpp b/TSUI/CShieldHUDDefault.cpp index e89933a..cfb7a7f 100644 --- a/TSUI/CShieldHUDDefault.cpp +++ b/TSUI/CShieldHUDDefault.cpp @@ -251,12 +251,12 @@ void CShieldHUDDefault::OnPaint (CG32bitImage &Dest, int x, int y, SHUDPaintCtx y + SHIELD_HP_DISPLAY_Y, cx + 8, SHIELD_HP_DISPLAY_HEIGHT, - (bDisadvantage ? VI.GetColor(colorAreaDisadvantage) : VI.GetColor(colorAreaAdvantage))); + (bDisadvantage ? VI.GetColor(colorAreaDegradation) : VI.GetColor(colorAreaEnhancement))); SmallFont.DrawText(Dest, x + SHIELD_HP_DISPLAY_X - cx - 4, y + SHIELD_HP_DISPLAY_Y + (SHIELD_HP_DISPLAY_HEIGHT - SmallFont.GetHeight()) / 2, - (bDisadvantage ? VI.GetColor(colorTextDisadvantage) : VI.GetColor(colorTextAdvantage)), + (bDisadvantage ? VI.GetColor(colorTextDegradation) : VI.GetColor(colorTextEnhancement)), sMods); } } diff --git a/TSUI/CUIHelper.cpp b/TSUI/CUIHelper.cpp index aff98d1..947dc82 100644 --- a/TSUI/CUIHelper.cpp +++ b/TSUI/CUIHelper.cpp @@ -164,7 +164,7 @@ int CUIHelper::CalcItemEntryHeight (CSpaceObject *pSource, const CItem &Item, co // Reference - CString sReference = Item.GetReference(Ctx); + CString sReference = pType->GetReference(Ctx); // If this is a weapon, then add room for the weapon damage @@ -929,17 +929,38 @@ void CUIHelper::PaintDisplayAttributes (CG32bitImage &Dest, TArrayGetApparentLevel(Ctx); - CString sReference = Item.GetReference(Ctx); + CString sReference = pItemType->GetReference(Ctx); DamageTypes iDamageType; CString sDamageRef; int iDamageAdj[damageCount]; diff --git a/TSUI/CVisualPalette.cpp b/TSUI/CVisualPalette.cpp index f237ddf..ec8f657 100644 --- a/TSUI/CVisualPalette.cpp +++ b/TSUI/CVisualPalette.cpp @@ -58,12 +58,27 @@ static SColorInitTable COLOR_TABLE[] = { "TextDockText", CG32bitPixel(0xAF, 0xB7, 0xBF) }, // H:210 S:8 B:75 { "TextDockTitle", CG32bitPixel(0xE7, 0xF3, 0xFF) }, // H:210 S:9 B:100 { "TextDockTextWarning", CG32bitPixel(0xFF, 0x33, 0x33) }, // H:0 S:80 B:100 + { "AreaAdvantage", CG32bitPixel(0x00, 0x53, 0xA6) }, - { "AreaDisadvantage", CG32bitPixel(0xA6, 0x21, 0x21) }, + { "AreaDisadvantage", CG32bitPixel(0xA6, 0x63, 0x21) }, + { "AreaEnhancement", CG32bitPixel(0x21, 0xA6, 0x21) }, + { "AreaDegradation", CG32bitPixel(0xA6, 0x21, 0x21) }, + { "AreaControlled", CG32bitPixel(0x7A, 0x21, 0xA6) }, + { "AreaBanned", CG32bitPixel(0x00, 0x00, 0x00) }, + { "AreaCustomMagenta", CG32bitPixel(0xA6, 0x21, 0x90) }, + { "AreaCustomBrown", CG32bitPixel(0x52, 0x33, 0x10) }, { "AreaShields", CG32bitPixel(0x45, 0x73, 0x17) }, + { "TextAdvantage", CG32bitPixel(0xCC, 0xE5, 0xFF) }, - { "TextDisadvantage", CG32bitPixel(0xFF, 0xCC, 0xCC) }, + { "TextDisadvantage", CG32bitPixel(0xFF, 0xE6, 0xCC) }, + { "TextEnhancement", CG32bitPixel(0xCC, 0xFF, 0xCC) }, + { "TextDegradation", CG32bitPixel(0xFF, 0xCC, 0xCC) }, + { "TextControlled", CG32bitPixel(0xEE, 0xCC, 0xFF) }, + { "TextBanned", CG32bitPixel(0xFF, 0xFF, 0xFF) }, + { "TextCustomMagenta", CG32bitPixel(0xFF, 0xCC, 0xF6) }, + { "TextCustomBrown", CG32bitPixel(0xFF, 0xE7, 0xCC) }, + { "TextShields", CG32bitPixel(0xE5, 0xFF, 0xCC) }, { "TextAccelerator", CG32bitPixel(0xFF, 0xFF, 0x00) }, // H:60 S:100 B:100 diff --git a/TSUI/CWeaponHUDDefault.cpp b/TSUI/CWeaponHUDDefault.cpp index a83023f..b2bb952 100644 --- a/TSUI/CWeaponHUDDefault.cpp +++ b/TSUI/CWeaponHUDDefault.cpp @@ -168,14 +168,14 @@ void CWeaponHUDDefault::PaintDeviceStatus (CShip *pShip, DeviceNames iDev, int x rcRect.top + 1, cxBonus + 4, cyHeight - 2, - (bDisadvantage ? VI.GetColor(colorAreaDisadvantage) : VI.GetColor(colorAreaAdvantage))); + (bDisadvantage ? VI.GetColor(colorAreaDegradation) : VI.GetColor(colorAreaEnhancement))); // Bonus text SmallFont.DrawText(m_Buffer, rcRect.left, rcRect.top, - (bDisadvantage ? VI.GetColor(colorTextDisadvantage) : VI.GetColor(colorTextAdvantage)), + (bDisadvantage ? VI.GetColor(colorTextDegradation) : VI.GetColor(colorTextEnhancement)), sBonus); cxBonus += 4; diff --git a/TSUI/IHUDPainter.cpp b/TSUI/IHUDPainter.cpp index e6137ee..b128244 100644 --- a/TSUI/IHUDPainter.cpp +++ b/TSUI/IHUDPainter.cpp @@ -159,12 +159,12 @@ void IHUDPainter::DrawModifier (CG32bitImage &Dest, int x, int y, const CString yBox, cxBox, cyBox, - (bDisadvantage ? VI.GetColor(colorAreaDisadvantage) : VI.GetColor(colorAreaAdvantage))); + (bDisadvantage ? VI.GetColor(colorAreaDegradation) : VI.GetColor(colorAreaEnhancement))); SmallFont.DrawText(Dest, xBox + (cxBox - cx) / 2, yBox, - (bDisadvantage ? VI.GetColor(colorTextDisadvantage) : VI.GetColor(colorTextAdvantage)), + (bDisadvantage ? VI.GetColor(colorTextDegradation) : VI.GetColor(colorTextEnhancement)), sText); } }