mirror of
https://github.com/irmen/prog8.git
synced 2024-09-07 03:54:27 +00:00
textelite output cleanups and alignments
This commit is contained in:
parent
1bbd77fddb
commit
bdda6f502a
@ -3,14 +3,11 @@
|
|||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||||
<Languages>
|
<Languages>
|
||||||
<language minSize="100" isEnabled="false" name="JavaScript" />
|
|
||||||
<language isEnabled="false" name="Groovy" />
|
|
||||||
<language isEnabled="false" name="Style Sheets" />
|
|
||||||
<language minSize="70" name="Kotlin" />
|
<language minSize="70" name="Kotlin" />
|
||||||
<language isEnabled="false" name="TypeScript" />
|
<language isEnabled="false" name="Groovy" />
|
||||||
<language isEnabled="false" name="ActionScript" />
|
|
||||||
</Languages>
|
</Languages>
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
|
<inspection_tool class="PyInterpreterInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="SpellCheckingInspection" enabled="true" level="TYPO" enabled_by_default="true">
|
<inspection_tool class="SpellCheckingInspection" enabled="true" level="TYPO" enabled_by_default="true">
|
||||||
<option name="processCode" value="false" />
|
<option name="processCode" value="false" />
|
||||||
<option name="processLiterals" value="true" />
|
<option name="processLiterals" value="true" />
|
||||||
|
@ -20,12 +20,12 @@ main {
|
|||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
txt.lowercase()
|
txt.lowercase()
|
||||||
txt.print("\u000c\n --- TextElite v1.1 ---\n")
|
txt.print("\u000c\n --- TextElite v1.2 ---\n")
|
||||||
|
|
||||||
galaxy.travel_to(1, numforLave)
|
galaxy.travel_to(1, numforLave)
|
||||||
market.init(0) ; Lave's market is seeded with 0
|
market.init(0) ; Lave's market is seeded with 0
|
||||||
ship.init()
|
ship.init()
|
||||||
planet.display(false)
|
planet.display(false, 0)
|
||||||
|
|
||||||
repeat {
|
repeat {
|
||||||
; test_stack.test()
|
; test_stack.test()
|
||||||
@ -112,7 +112,7 @@ trader {
|
|||||||
sys.memcopy(&savedata.cargo0, ship.cargohold, len(ship.cargohold))
|
sys.memcopy(&savedata.cargo0, ship.cargohold, len(ship.cargohold))
|
||||||
galaxy.travel_to(savedata.galaxy, savedata.planet)
|
galaxy.travel_to(savedata.galaxy, savedata.planet)
|
||||||
|
|
||||||
planet.display(false)
|
planet.display(false, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
sub do_save() {
|
sub do_save() {
|
||||||
@ -158,10 +158,10 @@ trader {
|
|||||||
galaxy.init_market_for_planet()
|
galaxy.init_market_for_planet()
|
||||||
ship.fuel -= distance
|
ship.fuel -= distance
|
||||||
txt.print("\n\nHyperspace jump! Arrived at:\n")
|
txt.print("\n\nHyperspace jump! Arrived at:\n")
|
||||||
planet.display(true)
|
planet.display(true,0 )
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
txt.print("Insufficient fuel\n")
|
txt.print("\nInsufficient fuel\n")
|
||||||
} else {
|
} else {
|
||||||
txt.print(" Not found!\n")
|
txt.print(" Not found!\n")
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ trader {
|
|||||||
|
|
||||||
sub do_next_galaxy() {
|
sub do_next_galaxy() {
|
||||||
galaxy.travel_to(galaxy.number+1, planet.number)
|
galaxy.travel_to(galaxy.number+1, planet.number)
|
||||||
planet.display(false)
|
planet.display(false, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
sub do_info() {
|
sub do_info() {
|
||||||
@ -259,13 +259,13 @@ trader {
|
|||||||
if num_chars {
|
if num_chars {
|
||||||
ubyte current_planet = planet.number
|
ubyte current_planet = planet.number
|
||||||
if galaxy.search_closest_planet(input) {
|
if galaxy.search_closest_planet(input) {
|
||||||
planet.display(false)
|
planet.display(false, 0)
|
||||||
} else {
|
} else {
|
||||||
txt.print(" Not found!")
|
txt.print(" Not found!")
|
||||||
}
|
}
|
||||||
galaxy.travel_to(galaxy.number, current_planet)
|
galaxy.travel_to(galaxy.number, current_planet)
|
||||||
} else {
|
} else {
|
||||||
planet.display(false)
|
planet.display(false, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,14 +358,15 @@ market {
|
|||||||
util.print_right(13, names[ci])
|
util.print_right(13, names[ci])
|
||||||
txt.print(" ")
|
txt.print(" ")
|
||||||
util.print_10s(current_price[ci])
|
util.print_10s(current_price[ci])
|
||||||
txt.print(" ")
|
txt.column(24)
|
||||||
txt.print_ub(current_quantity[ci])
|
txt.print_ub(current_quantity[ci])
|
||||||
|
txt.chrout(' ')
|
||||||
when units[ci] {
|
when units[ci] {
|
||||||
0 -> txt.chrout('t')
|
0 -> txt.chrout('t')
|
||||||
1 -> txt.print("kg")
|
1 -> txt.print("kg")
|
||||||
2 -> txt.chrout('g')
|
2 -> txt.chrout('g')
|
||||||
}
|
}
|
||||||
txt.print(" ")
|
txt.column(32)
|
||||||
txt.print_ub(ship.cargohold[ci])
|
txt.print_ub(ship.cargohold[ci])
|
||||||
txt.nl()
|
txt.nl()
|
||||||
}
|
}
|
||||||
@ -474,10 +475,7 @@ galaxy {
|
|||||||
txt.chrout('-')
|
txt.chrout('-')
|
||||||
txt.spc()
|
txt.spc()
|
||||||
planet.name = make_current_planet_name()
|
planet.name = make_current_planet_name()
|
||||||
planet.display(true)
|
planet.display(true, distance)
|
||||||
txt.print(" (")
|
|
||||||
util.print_10s(distance)
|
|
||||||
txt.print(" LY)\n")
|
|
||||||
}
|
}
|
||||||
pn++
|
pn++
|
||||||
} until pn==0
|
} until pn==0
|
||||||
@ -838,15 +836,21 @@ planet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub display(ubyte compressed) {
|
sub display(ubyte compressed, ubyte distance) {
|
||||||
if compressed {
|
if compressed {
|
||||||
print_name_uppercase()
|
print_name_uppercase()
|
||||||
txt.print(" TL:")
|
if distance {
|
||||||
|
txt.print(" (")
|
||||||
|
util.print_10s(distance)
|
||||||
|
txt.print(" LY)")
|
||||||
|
}
|
||||||
|
txt.print(" Tech level:")
|
||||||
txt.print_ub(techlevel+1)
|
txt.print_ub(techlevel+1)
|
||||||
txt.spc()
|
txt.print("\n ")
|
||||||
txt.print(econnames[economy])
|
txt.print(econnames[economy])
|
||||||
txt.spc()
|
txt.spc()
|
||||||
txt.print(govnames[govtype])
|
txt.print(govnames[govtype])
|
||||||
|
txt.nl()
|
||||||
} else {
|
} else {
|
||||||
txt.print("\n\nSystem: ")
|
txt.print("\n\nSystem: ")
|
||||||
print_name_uppercase()
|
print_name_uppercase()
|
||||||
@ -857,6 +861,11 @@ planet {
|
|||||||
txt.spc()
|
txt.spc()
|
||||||
txt.chrout('#')
|
txt.chrout('#')
|
||||||
txt.print_ub(number)
|
txt.print_ub(number)
|
||||||
|
if distance {
|
||||||
|
txt.print("\nDistance: ")
|
||||||
|
util.print_10s(distance)
|
||||||
|
txt.print(" LY")
|
||||||
|
}
|
||||||
txt.print("\nEconomy: ")
|
txt.print("\nEconomy: ")
|
||||||
txt.print(econnames[economy])
|
txt.print(econnames[economy])
|
||||||
txt.print("\nGovernment: ")
|
txt.print("\nGovernment: ")
|
||||||
|
Loading…
Reference in New Issue
Block a user