bckobayashimaru.de

Bridge Commander Kobayashi Maru Project
It is currently Tue Jun 25, 2019 4:34 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sun Jun 08, 2008 10:06 pm 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
The Interstellar Library has three sub-catagories: Ships, Systems, and Races. Clicking on 'Races' gives me a list of buttons, starting with species 8472 ... then Borg, Romulan, Dominion, etc.

Clicking on any of the buttons except 8472 gives me a description ... and, in some cases, an icon. The first button (8472) gives me nothing. If it's the first button I select, the data window remains blank ... if it's selected after clicking on another button, the window doesn't change to reflect 8472 data.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 09, 2008 2:37 am 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
:idea: Fixed.

I changed a couple short statements in the Library.py file from "i = 0" to "i = 1" ... and that allowed me to bring up data on the first menu item (species 8472).

:? I then discovered that the race icons were out of sync ... so I made a few changes to the RaceIcons.py file and now that works too.

Next question: How to alphabetize the listings in the Interstellar Library, similar to those of the QB and helm destination lists?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 09, 2008 6:46 am 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
Try this:
Replace "FdtnSystems" in for iIndex in range(len(FdtnSystems)): with "FdtnSystems.sort()"

Same with for race in Races.keys() - Races.keys.sort()

Topic moved to scripting.

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 09, 2008 4:42 pm 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
Adding the "sort" function seems like a way to list things alphabetically. Thanks. I'll try it today.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 09, 2008 6:37 pm 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
:? I couldn't get it to work. Either nothing showed up or (after making a few more changes to the file) only the buttons would show ... but clicking on them didn't give me any data. And, when they did show, they were in their original order (not alphabetical).

After fiddling with the file, I figure the first half defines the buttons and the second half pairs the buttons with data. And that the .TGL files are only used to define the data. Wouldn't it just be easier (I don't really know ... I'm just asking) to use the .TGL files for everything?

Anyway, I restored the file to what I had before trying to alphabetize the listings. I'll try to take a closer look later. I think you've pointed me in the right direction ... I must be missing something somehow.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 10, 2008 6:22 am 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
PJCham wrote:
After fiddling with the file, I figure the first half defines the buttons and the second half pairs the buttons with data. And that the .TGL files are only used to define the data. Wouldn't it just be easier (I don't really know ... I'm just asking) to use the .TGL files for everything?

I guess I was unable to get a list of all available TGLs.

No the problem is somewhere else: If you click on a button, the program remembers only the id 0..."some number".

So if you sort one list you have to sort them all.
In SelectTopic(), try "FdtnShips = Foundation.shipList.sort()", "FdtnSystems = Foundation.systemList.sort()" and "for race in Races.keys().sort()".

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 10, 2008 5:28 pm 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
Okay, I'll try those ('though I think I tried some of them already).

After I posted the suggestion about the .TGL file, I couldn't remember why I thought it was important. Later, I remembered that both the Systems list and the Ships list apparently load all the default systems/ships ... in alphabetical order. Then the other systems/ships are appended via the .TGL file. Which could've been why anything beyond Yiles is out of order in the list of systems.

Or so I thought. I'm still working on it.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 10, 2008 8:33 pm 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
I tried it two ways ... no luck either way. Note: Both times, I first deleted the library.pyc file.

1st way, I made the following changes (changes in bold face):
Quote:
SelectedTopic = pEvent.GetInt()
if SelectedTopic:
pLibraryWindow = GetLibraryWindow()
pLibraryWindow.ScrollToTop()
pBodyMenu.KillChildren()
if SelectedCategory == 1:
FdtnShips = Foundation.shipList.sort()


Quote:
elif SelectedCategory == 2:
FdtnSystems = Foundation.systemList.sort()


Quote:
elif SelectedCategory == 3:
pRaceDatabase = App.g_kLocalizationManager.Load("data/TGL/Races.tgl")

i = 1
iIconNumber = 0
myRace = None
for race in Races.keys().sort():



The lists showed up ... but in the same order as before. And the description/data was missing ... clicking on the buttons didn't work.

2nd way, I added the following changes (to those already made):
Quote:
def CreateShipsSelect(pTopicMenu):
pLibraryWindow = GetLibraryWindow()
FdtnShips = Foundation.shipList.sort()


Quote:
def CreateSystemSelect(pTopicMenu):
pLibraryWindow = GetLibraryWindow()
FdtnSystems = Foundation.systemList.sort()


Quote:
def CreateRacesSelect(pTopicMenu):
pLibraryWindow = GetLibraryWindow()
pRaceDatabase = App.g_kLocalizationManager.Load("data/TGL/Races.tgl")

i = 1
for race in Races.keys().sort():



At which point, nothing showed at all.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 11, 2008 6:59 am 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
Sorry, can't help, since I can not test atm.

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 11, 2008 2:50 pm 
Offline
Cadet 1st Year
Cadet 1st Year

Joined: Sun Jun 08, 2008 7:00 pm
Posts: 7
NP. I'll try to get back to it after I finish the TOS system pack I'm working on. All the "Races" buttons function now (my primary objective) ... putting the lists into alphabetical order was pretty much secondary.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 08, 2008 3:04 pm 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
Try the following changed files:
http://bckobayashimaru.de/svn/trunk/scr ... esIcons.py
http://bckobayashimaru.de/svn/trunk/scr ... Library.py

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group