Skip to content

Commit

Permalink
Icons and Events
Browse files Browse the repository at this point in the history
- Added many more icons (source in resource comments)
- Changed the icon used for cities
- Changed the icon used for ships
- Moved more mail types to the event tab and gave them their own icons
- Minor clean up of now unused code
  • Loading branch information
Deantwo committed Jun 23, 2014
1 parent 442cc2c commit 00f26ff
Show file tree
Hide file tree
Showing 18 changed files with 287 additions and 29 deletions.
Binary file added CommDiplomacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CommFriend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CommGovernment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CommStation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CommStdChannel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CommVoice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions HMail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ static public bool IsUni4(string filePath)
static public bool IsCityReport(int messageType) // Give true if MessageType is a CityReport (or related) mail.
{
if ( messageType == 0x01 // MSG_CityStatusReport
|| messageType == 0x03 // MSG_CityOccupationReport
|| messageType == 0x04 // MSG_CityDistressReport
|| messageType == 0x06 // MSG_CityStatusReportInfo
)
Expand Down Expand Up @@ -70,12 +69,13 @@ static public bool IsShipLog(string filePath) // Same as above but filePath inpu

static public bool IsEventNotice(int messageType) // Give true if MessageType is an EventNotice (or related) mail.
{
if ( messageType == 0x05 // MSG_CityIntelligenceReport
if ( messageType == 0x03 // MSG_CityOccupationReport
|| messageType == 0x05 // MSG_CityIntelligenceReport
|| messageType == 0x12 // MSG_ShipLogFinal
|| messageType == 0x13 // MSG_Government
|| messageType == 0x16 // MSG_OfficerDeath
|| messageType == 0x17 // MSG_CityFinalDecayReport
|| messageType == 0x18 // MSG_DiplomaticMessage
|| messageType == 0x18 // MSG_DiplomaticMessage (?)
)
return true;
return false;
Expand Down
33 changes: 22 additions & 11 deletions HObj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public override void Update(HMail mail)
_attentionCode = (byte)(_attentionCode | 0x20); // 0b00100000
if (morale < 20) // Morale not full.
_attentionCode = (byte)(_attentionCode | 0x40); // 0b01000000
if (mail.MessageType == 0x17) // MSG_CityFinalDecayReport
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x80); // 0b10000000
}
else
Expand Down Expand Up @@ -406,7 +406,7 @@ public override void Update(HMail mail)
_attentionCode = (byte)(_attentionCode | 0x20); // 0b00100000
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x40); // 0b01000000
if (mail.MessageType == 0x12) // MSG_ShipLogFinal
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x80); // 0b10000000
}
}
Expand Down Expand Up @@ -472,7 +472,7 @@ public override void Update(HMail mail)
_attentionCode = (byte)(_attentionCode | 0x20); // 0b00100000
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x40); // 0b01000000
if (mail.MessageType == 0x16) // MSG_OfficerDeath
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x80); // 0b10000000

}
Expand All @@ -493,6 +493,12 @@ public string Subject
get { return _subject; }
}

protected int _messageType = 0;
public int MessageType
{
get { return _messageType; }
}

public HEvent(HMail mail)
{
_id = HHelper.ToID(mail.SenderID);
Expand All @@ -511,27 +517,32 @@ public override void Update(HMail mail)

_messageId = mail.MessageID;
_subject = mail.Subject;
//if (mail.MessageType == 0x05) // MSG_CityIntelligenceReport
_messageType = mail.MessageType;
//if (_messageType == 0x03) // MSG_CityOccupationReport
//{
// ?
//}
//else if (mail.MessageType == 0x12) // MSG_ShipLogFinal
//if (_messageType == 0x05) // MSG_CityIntelligenceReport
//{
// ?
//}
//else if (mail.MessageType == 0x13) // MSG_Government
//else if (_messageType == 0x12) // MSG_ShipLogFinal
//{
// ?
//}
//else if (mail.MessageType == 0x16) // MSG_OfficerDeath
//else if (_messageType == 0x13) // MSG_Government
//{
// ?
//}
//else if (mail.MessageType == 0x17) // MSG_CityFinalDecayReport
//else if (_messageType == 0x16) // MSG_OfficerDeath
//{
// ?
//}
//else if (mail.MessageType == 0x18) // MSG_DiplomaticMessage
//else if (_messageType == 0x17) // MSG_CityFinalDecayReport
//{
// ?
//}
//else if (_messageType == 0x18) // MSG_DiplomaticMessage
//{
// ?
//}
Expand All @@ -543,15 +554,15 @@ public override void Update(HMail mail)
_attentionCode = (byte)(_attentionCode | 0x03); // 0b00000010
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x04); // 0b00000100
if (false) // Nothing yet!
if (_messageType == 0x05) // MSG_CityIntelligenceReport
_attentionCode = (byte)(_attentionCode | 0x08); // 0b00001000
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x10); // 0b00010000
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x20); // 0b00100000
if (false) // Nothing yet!
_attentionCode = (byte)(_attentionCode | 0x40); // 0b01000000
if (false) // Nothing yet!
if (_messageType == 0x03 || _messageType == 0x12 || _messageType == 0x16 || _messageType == 0x17) // MSG_CityOccupationReport, MSG_ShipLogFinal, MSG_OfficerDeath or MSG_CityFinalDecayReport
_attentionCode = (byte)(_attentionCode | 0x80); // 0b10000000

//}
Expand Down
42 changes: 42 additions & 0 deletions HazeronAdviser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,48 @@
<ItemGroup>
<None Include="Officer.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\c_Spacecraft.bmp" />
</ItemGroup>
<ItemGroup>
<None Include="c_Spacecraft.png" />
</ItemGroup>
<ItemGroup>
<None Include="MsgCity.png" />
</ItemGroup>
<ItemGroup>
<None Include="MsgBuyOffer.png" />
</ItemGroup>
<ItemGroup>
<None Include="CommGovernment.png" />
</ItemGroup>
<ItemGroup>
<None Include="CommFriend.png" />
</ItemGroup>
<ItemGroup>
<None Include="CommVoice.png" />
</ItemGroup>
<ItemGroup>
<None Include="CommStdChannel.png" />
</ItemGroup>
<ItemGroup>
<None Include="CommStation.png" />
</ItemGroup>
<ItemGroup>
<None Include="Locator.png" />
</ItemGroup>
<ItemGroup>
<None Include="MsgAccept.png" />
</ItemGroup>
<ItemGroup>
<None Include="CommDiplomacy.png" />
</ItemGroup>
<ItemGroup>
<None Include="c_Money.png" />
</ItemGroup>
<ItemGroup>
<None Include="MsgSpot.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file added Locator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 52 additions & 15 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ public partial class Main : Form
Image imageCity;
Image imageShip;
Image imageOfficer;
Image imageDiplomacy;
Image imageFriend;
Image imageGovernment;
Image imageChannel;
Image imageAccept;
Image imageTreasury;
Image imageLocator;
Image imageStation;
Image imageVoice;
Image imageFlag;
Image imageTarget;

Color attantionMinor = Color.FromArgb(255, 255, 150); // Somewhere between LightYellow and Yellow.
Color attantionMajor = Color.LightPink;
Expand All @@ -35,9 +46,20 @@ public Main()
#endif
toolStripProgressBar1.Visible = false;
toolStripProgressBar2.Visible = false;
imageCity = HazeronAdviser.Properties.Resources.c_Flag;
imageShip = HazeronAdviser.Properties.Resources.GovSpacecraft;
imageCity = HazeronAdviser.Properties.Resources.MsgCity;
imageShip = HazeronAdviser.Properties.Resources.c_Spacecraft;
imageOfficer = HazeronAdviser.Properties.Resources.Officer;
imageDiplomacy = HazeronAdviser.Properties.Resources.CommDiplomacy;
imageFriend = HazeronAdviser.Properties.Resources.CommFriend;
imageGovernment = HazeronAdviser.Properties.Resources.CommGovernment;
imageChannel = HazeronAdviser.Properties.Resources.CommStdChannel;
imageAccept = HazeronAdviser.Properties.Resources.MsgAccept;
imageTreasury = HazeronAdviser.Properties.Resources.c_Money;
imageLocator = HazeronAdviser.Properties.Resources.Locator;
imageStation = HazeronAdviser.Properties.Resources.CommStation;
imageVoice = HazeronAdviser.Properties.Resources.CommVoice;
imageFlag = HazeronAdviser.Properties.Resources.c_Flag;
imageTarget = HazeronAdviser.Properties.Resources.MsgSpot;
dgvCity.Columns["ColumnCityAbandonment"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
dgvCity.Columns["ColumnCityAbandonment"].DefaultCellStyle.Font = new Font("Lucida Console", 9);
cmbCharFilter.SelectedIndex = 0;
Expand Down Expand Up @@ -177,8 +199,8 @@ private void button1_Click(object sender, EventArgs e)
dgvCity.Rows[row].Cells["ColumnCityPopulation"].Style.BackColor = attantionMajor;
if (HHelper.FlagCheck(hCity.AttentionCode, 0x40)) // 0b01000000 // Morale not full.
dgvCity.Rows[row].Cells["ColumnCityMorale"].Style.BackColor = attantionMajor;
if (HHelper.FlagCheck(hCity.AttentionCode, 0x80)) // 0b10000000 // MSG_CityFinalDecayReport
dgvCity.Rows[row].Cells["ColumnCityName"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hCity.AttentionCode, 0x80)) // 0b10000000 // Nothing yet!
// dgvCity.Rows[row].Cells["ColumnCityIndex"].Style.BackColor = attantionMajor;
}
toolStripProgressBar2.Increment(1);
}
Expand Down Expand Up @@ -212,8 +234,8 @@ private void button1_Click(object sender, EventArgs e)
// dgvShip.Rows[row].Cells["ColumnShipIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hShip.AttentionCode, 0x40)) // 0b01000000 // Nothing yet!
// dgvShip.Rows[row].Cells["ColumnShipIndex"].Style.BackColor = attantionMajor;
if (HHelper.FlagCheck(hShip.AttentionCode, 0x80)) // 0b10000000 // MSG_ShipLogFinal
dgvShip.Rows[row].Cells["ColumnShipName"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hSHip.AttentionCode, 0x80)) // 0b10000000 // Nothing yet!
// dgvShip.Rows[row].Cells["ColumnShipIndex"].Style.BackColor = attantionMajor;
}
toolStripProgressBar2.Increment(1);
}
Expand Down Expand Up @@ -248,8 +270,8 @@ private void button1_Click(object sender, EventArgs e)
// dgvOfficer.Rows[row].Cells["ColumnOfficerIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hOfficer.AttentionCode, 0x40)) // 0b01000000 // Nothing yet!
// dgvOfficer.Rows[row].Cells["ColumnOfficerIndex"].Style.BackColor = attantionMajor;
if (HHelper.FlagCheck(hOfficer.AttentionCode, 0x80)) // 0b10000000 // MSG_OfficerDeath
dgvOfficer.Rows[row].Cells["ColumnOfficerName"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hOfficer.AttentionCode, 0x80)) // 0b10000000 // Nothing yet!
// dgvOfficer.Rows[row].Cells["ColumnOfficerName"].Style.BackColor = attantionMajor;
}
toolStripProgressBar2.Increment(1);
}
Expand All @@ -261,33 +283,48 @@ private void button1_Click(object sender, EventArgs e)
int row = dgvEvent.RowCount - 1;
dgvEvent.Rows[row].Cells["ColumnEventIndex"].Value = row;
dgvEvent.Rows[row].Cells["ColumnEventSelection"].Value = false;
if (true)
if (hEvent.MessageType == 0x13) // MSG_Government
{
if (hEvent.Name == "State Department")
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageFriend;
if (hEvent.Name == "War Department")
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageTarget;
if (hEvent.Name == "Treasury Department")
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageTreasury;
}
else if (hEvent.MessageType == 0x16) // MSG_OfficerDeath
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageOfficer;
else if (hEvent.MessageType == 0x17) // MSG_CityFinalDecayReport
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageCity;
else
else if (hEvent.MessageType == 0x12) // MSG_ShipLogFinal
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageShip;
else if (hEvent.MessageType == 0x18) // MSG_DiplomaticMessage (?)
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageDiplomacy;
else if (hEvent.MessageType == 0x03 || hEvent.MessageType == 0x05) // MSG_CityOccupationReport or MSG_CityIntelligenceReport
dgvEvent.Rows[row].Cells["ColumnEventIcon"].Value = imageFlag;
dgvEvent.Rows[row].Cells["ColumnEventName"].Value = hEvent.Name;
dgvEvent.Rows[row].Cells["ColumnEventSubject"].Value = hEvent.Subject;
dgvEvent.Rows[row].Cells["ColumnEventDate"].Value = hEvent.LastUpdaredString;
// AttentionCodes
if (hEvent.AttentionCode != 0x00)
{
dgvEvent.Rows[row].Cells["ColumnEventName"].Style.BackColor = attantionMinor;
//dgvEvent.Rows[row].Cells["ColumnEventName"].Style.BackColor = attantionMinor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x01)) // 0b00000001 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMinor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x02)) // 0b00000010 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x04)) // 0b00000100 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x08)) // 0b00001000 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
if (HHelper.FlagCheck(hEvent.AttentionCode, 0x08)) // 0b00001000 // Attantion
dgvEvent.Rows[row].Cells["ColumnEventName"].Style.BackColor = attantionMinor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x10)) // 0b00010000 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x20)) // 0b00100000 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x40)) // 0b01000000 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
//if (HHelper.FlagCheck(hEvent.AttentionCode, 0x80)) // 0b10000000 // Nothing yet!
// dgvEvent.Rows[row].Cells["ColumnEventIndex"].Style.BackColor = attantionMajor;
if (HHelper.FlagCheck(hEvent.AttentionCode, 0x80)) // 0b10000000 // Death
dgvEvent.Rows[row].Cells["ColumnEventName"].Style.BackColor = attantionMajor;
}
toolStripProgressBar2.Increment(1);
}
Expand Down
Binary file added MsgAccept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsgCity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsgSpot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 00f26ff

Please sign in to comment.