Display a different color for buy and sell orders in market overview
This commit is contained in:
parent
eb59fd6b48
commit
ce9240d82c
1 changed files with 6 additions and 16 deletions
22
main.go
22
main.go
|
@ -470,7 +470,7 @@ func printClonesInformation(swaggerclient *ESI.App, m *Character) string {
|
||||||
for _, clone := range clones {
|
for _, clone := range clones {
|
||||||
sInfo, sErr := getStructureStationInfo(swaggerclient, clone.LocationID)
|
sInfo, sErr := getStructureStationInfo(swaggerclient, clone.LocationID)
|
||||||
if sErr != nil {
|
if sErr != nil {
|
||||||
fmt.Printf("Error on structure information read on structure %s\n", clone.LocationID)
|
fmt.Printf("Error on structure information read on structure %d\n", clone.LocationID)
|
||||||
log.Fatalf("Got error on getStructureStationInfo: %T %s", sErr, sErr)
|
log.Fatalf("Got error on getStructureStationInfo: %T %s", sErr, sErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -714,19 +714,9 @@ func printCharacterMarketOrders(swaggerclient *ESI.App, m *Character) string {
|
||||||
remainingAmount := *order.Price * float32(*order.VolumeRemain)
|
remainingAmount := *order.Price * float32(*order.VolumeRemain)
|
||||||
remainingDuration := expirationDate.Sub(time.Now())
|
remainingDuration := expirationDate.Sub(time.Now())
|
||||||
|
|
||||||
buySellStatus := "↟"
|
buySellStatus := aurora.Green("↟").Bold()
|
||||||
if *order.IsBuyOrder {
|
if *order.IsBuyOrder {
|
||||||
buySellStatus = "↡"
|
buySellStatus = aurora.Magenta("↡").Bold()
|
||||||
}
|
|
||||||
|
|
||||||
var status string
|
|
||||||
|
|
||||||
if remainingDuration.Hours() <= 0 {
|
|
||||||
status = fmt.Sprint(aurora.Red(buySellStatus).Bold())
|
|
||||||
} else if remainingDuration.Hours() <= 72 {
|
|
||||||
status = fmt.Sprint(aurora.Magenta(buySellStatus).Bold())
|
|
||||||
} else {
|
|
||||||
status = fmt.Sprint(aurora.Green(buySellStatus).Bold())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
duration := fmt.Sprintf("%d/%d", remainingDuration/time.Hour/24, *order.Duration)
|
duration := fmt.Sprintf("%d/%d", remainingDuration/time.Hour/24, *order.Duration)
|
||||||
|
@ -751,12 +741,12 @@ func printCharacterMarketOrders(swaggerclient *ESI.App, m *Character) string {
|
||||||
|
|
||||||
sInfo, sErr := getStructureStationInfo(swaggerclient, int64(*order.LocationID))
|
sInfo, sErr := getStructureStationInfo(swaggerclient, int64(*order.LocationID))
|
||||||
if sErr != nil {
|
if sErr != nil {
|
||||||
fmt.Printf("Error on structure information read on structure %s\n", order.LocationID)
|
fmt.Printf("Error on structure information read on structure %d\n", order.LocationID)
|
||||||
log.Fatalf("Got error on getStructureStationInfo: %T %s", sErr, sErr)
|
log.Fatalf("Got error on getStructureStationInfo: %T %s", sErr, sErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
line := fmt.Sprintf(" %s % 25.25s ISK % 13s ISK % 13s (%s) (%s) %s",
|
line := fmt.Sprintf(" %s % 25.25s ISK % 13s ISK % 13s (%s) (%s) %s",
|
||||||
status,
|
buySellStatus,
|
||||||
pinNames[*order.TypeID],
|
pinNames[*order.TypeID],
|
||||||
ac.FormatMoney(*order.Price),
|
ac.FormatMoney(*order.Price),
|
||||||
ac.FormatMoney(remainingAmount),
|
ac.FormatMoney(remainingAmount),
|
||||||
|
@ -846,7 +836,7 @@ func printCharacterIndustryJobs(swaggerclient *ESI.App, m *Character) string {
|
||||||
|
|
||||||
sInfo, sErr := getStructureStationInfo(swaggerclient, int64(*job.FacilityID))
|
sInfo, sErr := getStructureStationInfo(swaggerclient, int64(*job.FacilityID))
|
||||||
if sErr != nil {
|
if sErr != nil {
|
||||||
fmt.Printf("Error on structure information read on structure %s\n", *job.FacilityID)
|
fmt.Printf("Error on structure information read on structure %d\n", *job.FacilityID)
|
||||||
log.Fatalf("Got error on getStructureStationInfo: %T %s", sErr, sErr)
|
log.Fatalf("Got error on getStructureStationInfo: %T %s", sErr, sErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue