Aller au contenu

Photo

Strange AddListBoxRow Behavior


  • Veuillez vous connecter pour répondre
30 réponses à ce sujet

#1
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

Ran in to an interesting problem today and I was wondering if anyone here knows what's up. In short, I decided to add a tab to the ingame journal for quest items. So far all I've done was copy the main journal page, rename everything, and get the tab switching working (it all works fine, quests display as normal, etc). Here's the page I added:

	<UIPane name="ITEMS_PAGE" x=34 y=84 width=363 height=368 hidden=true >
	
		<UIListbox name="ItemEntryList" x=1 y=47 width=359 height=320 yPadding=2  
		showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32
		update=true >
			<UICollapsable prototype=true name="ItemCollapsable" x=0 y=0 height=PARENT_HEIGHT width=326 isexpanded=true 
			yPadding=1 xPadding=5 >
				<UIButton name="PROTO_HEADER" x=0 y=0 height=44 width=326 header=true >
					<UIText indent=18 hangingindent=18 align=left valign=middle fontfamily="Default" style=2 uppercase=true prototype=true maxlines=2 />
					<UIFrame state=up			fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=down			fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hilited		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=focused		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hifocus		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=disabled		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=header		fill="b_qjd_normal.tga" />
					<UIFrame state=hiheader		fill="b_qjd_normal.tga" />
					<UIFrame state=downheader	fill="b_qjd_normal.tga" />
				</UIButton>
				<UIText name="PROTO_TEXT" x=0 y=0 width=326 height=DYNAMIC prototype=true align=left valign=top multiline=true color="312A0A"
				fontfamily="NWN1_Dialog" style="bold" />
			</UICollapsable>

			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListbox>
	</UIPane>

Nothing special, it's exactly what the game has to work with for the journal. Now here's the script line I'm running to populate it:

	AddListBoxRow(oPC,"SCREEN_JOURNAL","ItemEntryList","Row1","PROTO_HEADER=Quest Item 1;PROTO_TEXT=Plenty of descriptive text for this quest item.;","","","");

Unfortunately, running the code only seems to add the UICollapsable object, that is I can see the collapse button with the correct text (and click it, which turns it from a + to a -), but there's no text field underneath it.

 

Seems like it's a problem with how AddListBoxRow adds elements from a collapsable box, but obviously the blackboxed game scripts do it just fine in the journal. Any ideas?



#2
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Psionic_Entity,
 
I have not ventured down the ListBox route yet, but I do know there are other script commands that relate to it (after a quick search):-

AddListBoxRow
ClearListBox
ModifyListBoxRow
RemoveListBoxRow
SetListBoxRowSelected

Is it possible you need one of these other commands?

Lastly, try Sunjammer's Tutorial on Listboxes:- http://nwvault.ign.c...s.Detail&id=110

That said, I have not yet found a need to use ListBoxes in any GUI I have made ... and I have made quite a few now. The point being, maybe there is another way to add what you are trying to do to the Journal GUI. i.e. Without the +/- button action?

I must take a look at working with these myself one day though. ;) So, I *might* take a closer look and let you know if I discover anything ... or, maybe (if you get it working), you could post back here and let us know how you resolved it. :)

My own GUI tutorial if you have not yet seen it:- http://nwvault.ign.c...ls.Detail&id=92 (Does not include ListBox stuff though.)

Cheers,
Lance.

#3
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

I've been doing some testing and it's definitely not an issue about functions. Seems more like some objects not existing when put in to collapsables via script. I've had trouble with listboxes in collapsables as well.

 

Since I haven't been able to make it work I just switched to a setup that displays info at the top and lets you select from a list at the bottom, like the skills or feats menu in the character sheet. I'll go back if I can ever solve this problem.



#4
Loki_999

Loki_999
  • Members
  • 430 messages

I have used listboxes but not collapsable elements. However, i have tore my hair out at times when working with listboxes. If you don't make them exactly how they are designed to work things simply fail. Sorry i cant really offer more than that, but make sure they work first without the collapsable element, then add it and see what happens,



#5
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi,

I have been reading more about these and I have an idea of what may be needed ... but still have to add and check my own code ... i.e Experiment a bit.

If I get it working, I will post my results.

Lance.
 
 
EDIT: To save me some time, please can you post your entire journal.xml script here. I am interested to see how you access your fourth tab. i.e. Are you using the "OnSelected=UIButton_Input_ShowObject" command, etc?

#6
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

Here's my current working copy with 5 tabs. It has some new .tgas so it won't work if you try to load it, but the tab switching is clear here.

<?xml version="1.0" encoding="utf-8">

<UIScene name="SCREEN_JOURNAL" x=0 y=ALIGN_CENTER width=406 height=460 draggable=true idleexpiretime="1.0" OnAdd=UIScene_Misc_RequestJournalUpdates("true","NOTES_FIELD") 
	fadeout=.3 fadein=.3 backoutkey=true priority="SCENE_INGAME" scriptloadable=true
	OnRemove=UIScene_Misc_RequestJournalUpdates("false","NOTES_FIELD") />

	<!-- ***SCENE TITLE*** -->
	<UIText name="SceneTitle" text="Journal" x=80 y=12 width=280 height=24 align=left valign=middle uppercase=true fontfamily="Title_Font" style="1" />

	<!-- Close Button -->
	<UIButton name="CloseButton" x=369 y=8 style="STYLE_CLOSE_BUTTON" 
		OnLeftClick=UIButton_Input_ScreenClose()>
	</UIButton>

	<UIIcon name="JOURNAL_ICON" img="qj_icon.tga" x=0 y=0 width=78 height=71 />

	<!-- ***JOURNAL OPTION TABS*** -->
	<UIButton name="SHOW_QUESTS_ACTIVE" x=79 y=43 width=66 height=33 style="STYLE_SMALL_TAB" strref="63497" buttontype=radio groupid=1 groupmemberid=1
		OnSelected=UIButton_Input_SetJournalPage("QUESTS_PAGE","PAGE_QUEST_ACTIVE") OnUnselected=UIButton_Input_HideObject("QUESTS_PAGE")>
	</UIButton>
	<UIButton name="SHOW_QUESTS_COMPLETED" x=146 y=43 width=60 height=33 style="STYLE_SMALL_TAB" text="Done" buttontype=radio groupid=1 groupmemberid=2 
		OnSelected=UIButton_Input_SetJournalPage("QUESTS_PAGE","PAGE_QUEST_COMPLETED") OnUnselected=UIButton_Input_HideObject("QUESTS_PAGE") >
	</UIButton>
	<UIButton name="SHOW_ITEMS" x=207 y=43 width=62 height=33 style="STYLE_SMALL_TAB" text="Items" buttontype=radio groupid=1 groupmemberid=4
		OnSelected=UIButton_Input_ShowObject("ITEMS_PAGE") OnUnselected=UIButton_Input_HideObject("ITEMS_PAGE") >
	</UIButton>
	<UIButton name="SHOW_BESTIARY" x=270 y=43 width=82 height=33 style="STYLE_BIG_TAB" text="Bestiary" buttontype=radio groupid=1 groupmemberid=5
		OnSelected=UIButton_Input_ShowObject("BESTIARY_PAGE") OnUnselected=UIButton_Input_HideObject("BESTIARY_PAGE") >
	</UIButton>
	<UIButton name="SHOW_NOTES" x=353 y=43 width=42 height=33 style="STYLE_SMALL_TAB" text="Pad" buttontype=radio groupid=1 groupmemberid=3
		OnSelected=UIButton_Input_SetJournalPage("NOTES_PAGE","PAGE_NOTES") OnUnselected=UIButton_Input_HideObject("NOTES_PAGE") >
	</UIButton>


	<!-- ***JOURNAL LIST OF COLLAPSABLES*** -->
	<UIPane name="QUESTS_PAGE" x=34 y=84 width=363 height=368 hidden=false >

		<!-- ***JOURNAL SORT OPTIONS*** -->
		<UIPane name="SORT_DATE_PANE" x=0 y=0 width=100 height=20 >
			<UIButton name="ByDate" x=0 y=0 style="ROUND_RADIO_BUTTON" groupid=2 groupmemberid=1
				OnSelected=UIButton_Input_SetJournalSort("SORT_DATE") >
			</UIButton>
			<UIText name="DATE_TEXT" strref="6325" x=22 y=0 width=78 height=20 
				align=left valign=middle fontfamily="Title_Font" style="1" uppercase=true />
		</UIPane>
		<UIPane name="SORT_NAME_PANE" x=100 y=0 width=100 height=20 >
			<UIButton name="ByAlpha" x=0 y=0 style="ROUND_RADIO_BUTTON" groupid=2 groupmemberid=2
				OnSelected=UIButton_Input_SetJournalSort("SORT_NAME") >
			</UIButton>
			<UIText name="NAME_TEXT" strref="154" x=22 y=0 width=78 height=20 
				align=left valign=middle fontfamily="Title_Font" style="1" uppercase=true />
		</UIPane>
		<UIPane name="SORT_PRIORITY_PANE" x=200 y=0 width=130 height=20 >
			<UIButton name="ByPriority" x=0 y=0 style="ROUND_RADIO_BUTTON" groupid=2 groupmemberid=3
				OnSelected=UIButton_Input_SetJournalSort("SORT_PRIORITY") >
			</UIButton>
			<UIText name="PRIORITY_TEXT" strref="6326" x=22 y=0 width=108 height=20
				align=left valign=middle fontfamily="Title_Font" style="1" uppercase=true />
		</UIPane>		
		
		<UIListbox name="JournalEntryList" x=1 y=47 width=359 height=320 yPadding=2  
		showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32
		update=true OnUpdate=UIObject_OnUpdate_GetJournalEntries() >
			<UICollapsable prototype=true name="JournalCollapsable" x=0 y=0 height=PARENT_HEIGHT width=326 isexpanded=true 
			yPadding=1 xPadding=5 >
				<UIButton name="PROTO_HEADER" x=0 y=0 height=44 width=326 header=true >
					<UIText indent=18 hangingindent=18 align=left valign=middle fontfamily="Default" style=2 uppercase=true prototype=true maxlines=2 />
					<UIFrame state=up			fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=down			fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hilited		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=focused		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hifocus		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=disabled		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=header		fill="b_qjd_normal.tga" />
					<UIFrame state=hiheader		fill="b_qjd_normal.tga" />
					<UIFrame state=downheader	fill="b_qjd_normal.tga" />
				</UIButton>
				<UIText name="PROTO_TEXT" x=0 y=0 width=326 height=DYNAMIC prototype=true align=left valign=top multiline=true color="312A0A"
				fontfamily="NWN1_Dialog" style="bold" />
			</UICollapsable>

			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListbox>
	</UIPane>

	<UIPane name="BESTIARY_PAGE" x=0 y=74 width=397 height=460 hidden=true >

		<!-- ***BESTIARY SORT OPTIONS*** -->

		<UIPane name="BESTIARY_BOX" x=20 y=9 width=366 height=136 >
					<UIText name="BESTIARY_TEXT1" x=15 y=0 width=366 height=20 align=left valign=middle fontfamily="Title_Font" style=1 />
					<UIIcon img="char_stats_title.tga" x=0 y=0 width=366 height=20 ignoreevents="true" />

					<UIIcon img="p_friend_frame.tga" x=0 y=22 width=78 height=86 />
					<UIIcon name="BESTIARY_IMAGE" x=10 y=35 height=64 width=64 />

					<UIListBox name="INNERBOX" x=80 y=27 width=281 height=106 yPadding=0 xPadding=0 showpartialchild=true
						unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=false >		
						<UIText name="BESTIARY_TEXT2" width="236" height="DYNAMIC" align="left" valign="top" fontfamily="Default" style="1" multiline="true" indent=4 hangingindent=4 />
						<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>
					</UIListBox>
					<UIIcon name="DETAIL_MIDDLE" img="stats_container_lg.tga" x=0 y=23 width=366 height=114 ignoreevents="true" />	
		</UIPane>

		
		<UIIcon name="BACKGROUND_TOP2" img="qj_top2.tga" x=10 y=0 width=387 height=167 ignoreevents="true" capturemouseclicks="false" />	
		
		<UIListbox name="BestiaryEntryList" x=35 y=163 width=359 height=211 yPadding=2 update=true updaterate="0.3" OnUpdate='UIObject_Misc_ExecuteServerScript(gui_aq_journal_populate,local:2)'
		showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32 >
				
			<UIPane name="BESTIARY_PROTO" width=234 height=40 tupple=true draggable=false prototype=true
			OnLeftClick0=UIObject_Misc_ExtractData(self:,string,5,local:1) 
			OnLeftClick1='UIObject_Misc_ExecuteServerScript(gui_aq_journal_bestiary,local:1)' >
				<UIIcon img="icon_frame.tga" x=0 y=0 width=40 height=40 />
				<UIIcon name="BESTIARY_OBJECT_IMAGE" img="ife_harmorprof.tga" x=0 y=0 width=40 height=40 />
				<UIButton name="BESTIARY_OBJECT_TEXT" x=40 y=0 width=156 height=40 prototype=true >
						<UIText name="FEAT_TEXTFIELD" indent=3 hangingindent=3 align=left valign=middle fontfamily="Title_Font" prototype=true maxlines=3 />
						<UIFrame state=up		fill="b_g_lg01_normal.tga" />
						<UIFrame state=down		fill="b_g_lg01_pressed.tga" />
						<UIFrame state=focused	fill="b_g_lg01_pressed.tga" />
						<UIFrame state=hilited	fill="b_g_lg01_normal.tga" />
						<UIFrame state=hifocus	fill="b_g_lg01_pressed.tga" />
						<UIFrame state=disabled	fill="b_g_lg01_normal.tga" />
				</UIButton>
			</UIPane>

			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListbox>


	</UIPane>

	<UIPane name="ITEMS_PAGE" x=0 y=74 width=397 height=460 hidden=true >

		<!-- ***QUESTITEMS SORT OPTIONS*** -->

		<UIPane name="QUESTITEM_BOX" x=20 y=9 width=366 height=136 >
					<UIText name="QUESTITEM_TEXT1" x=15 y=0 width=366 height=20 align=left valign=middle fontfamily="Title_Font" style=1 />
					<UIIcon img="char_stats_title.tga" x=0 y=0 width=366 height=20 ignoreevents="true" />

					<UIIcon img="p_friend_frame.tga" x=0 y=22 width=78 height=86 />
					<UIIcon name="QUESTITEM_IMAGE" x=10 y=35 height=64 width=64 />

					<UIListBox name="INNERBOX" x=80 y=27 width=281 height=106 yPadding=0 xPadding=0 showpartialchild=true
						unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=false >		
						<UIText name="QUESTITEM_TEXT2" width="236" height="DYNAMIC" align="left" valign="top" fontfamily="Default" style="1" multiline="true" indent=4 hangingindent=4 />
						<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>
					</UIListBox>
					<UIIcon name="DETAIL_MIDDLE" img="stats_container_lg.tga" x=0 y=23 width=366 height=114 ignoreevents="true" />	
		</UIPane>

		
		<UIIcon name="BACKGROUND_TOP2" img="qj_top2.tga" x=10 y=0 width=387 height=167 ignoreevents="true" capturemouseclicks="false" />	
		
		<UIListbox name="QuestItemEntryList" x=35 y=163 width=359 height=211 yPadding=2
		showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32 >
				
			<UIPane name="QUESTITEM_PROTO" width=234 height=40 tupple=true draggable=false prototype=true
			OnLeftClick0=UIObject_Misc_ExtractData(self:,string,5,local:1) 
			OnLeftClick1='UIObject_Misc_ExecuteServerScript(gui_aq_journal_questitem,local:1)' >
				<UIIcon img="icon_frame.tga" x=0 y=0 width=40 height=40 />
				<UIIcon name="QUESTITEM_OBJECT_IMAGE" img="ife_harmorprof.tga" x=0 y=0 width=40 height=40 />
				<UIButton name="QUESTITEM_OBJECT_TEXT" x=40 y=0 width=156 height=40 prototype=true >
						<UIText name="FEAT_TEXTFIELD" indent=3 hangingindent=3 align=left valign=middle fontfamily="Title_Font" prototype=true maxlines=3 />
						<UIFrame state=up		fill="b_g_lg01_normal.tga" />
						<UIFrame state=down		fill="b_g_lg01_pressed.tga" />
						<UIFrame state=focused	fill="b_g_lg01_pressed.tga" />
						<UIFrame state=hilited	fill="b_g_lg01_normal.tga" />
						<UIFrame state=hifocus	fill="b_g_lg01_pressed.tga" />
						<UIFrame state=disabled	fill="b_g_lg01_normal.tga" />
				</UIButton>
			</UIPane>

			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListbox>


	</UIPane>

	<UIPane name="NOTES_PAGE" x=34 y=84 width=336 height=368 hidden=true >
		<UIListBox name="NOTES_LISTBOX" x=1 y=47 width=359 height=320 showpartialchild=true
			unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=false >
			<UIText name="NOTES_FIELD" width=PARENT_WIDTH height=DYNAMIC align=left valign=top multiline=true color="black" fontfamily="NWN1_Dialog" style="bold" clearonescape="false"
			editable=true selectable=true maxlength=16384 allowspace="true" />
			<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	
		</UIListBox>	
	</UIPane>

	<!-- Background Image -->
	<UIIcon name="BACKGROUND_TOP" img="qj_top.tga" x=10 y=8 width=387 height=120 />
	<UIIcon name="BACKGROUND" img="qj_paper.tga" x=10 y=128 width=387 height=323 />
	<UIFrame x=0 y=0 width=PARENT_WIDTH height=PARENT_HEIGHT topleft="frame1_tl.tga" topright="frame1_tr.tga" bottomleft="frame1_bl.tga"
		bottomright="frame1_BR.tga" top="frame1_t.tga" bottom="frame1_b.tga"
		left="frame1_l.tga" right="frame1_r.tga" border=32 />	



#7
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi,

Thanks for posting this.

I am just about to test my own script, but will take a look at this as well after I have done testing.

Will report again soon ... hopefully.

UPDATE: To date, I have only been able to replicate to the same point as you:-

Add a collapsible, with a title, but been unable to update the body text. :(

I will try changing a few things and try again, although don't think I am having much success beyond this point. I could not even find any examples of anybody else's GUIs that have successfully done this either. And the OC examples (that I have found) do not have any examples of being able to update "collapsible" entries except the hard-coded journal entries themselves.

Keep me updated if you are successful.

And for your info, I have a separate MENU system that uses a conversation to select/change the text viewed in a MENU page. That's how I did the sort of thing you are doing. Check out here: http://worldofalthea...and-arcana.html
Lance.

#8
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

No problem. What I'm still looking for, however, is making AddListboxRow work in a collapsable. As of now I have not been able to create listboxes of the same form as the ones Obsidian made where you could collapse certain parts of the list.



#9
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

No problem. What I'm still looking for, however, is making AddListboxRow work in a collapsable. As of now I have not been able to create listboxes of the same form as the ones Obsidian made where you could collapse certain parts of the list.


As I mention above (you may have missed my edit of the post), I have not been able to do this either to date .. and don't know any examples where it has been achieved either. :(

Cheers,
Lance.

#10
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Again,

Actually, the answer may lie in the button type you can design and use. A button can be defined as: BEHAVIOR_COLLAPSABLE_HEADER. Therefore, it may be one has to build there own collapsible GUI objects using this ability of a button. I may give that a go and see how I get on.

Abandoned this idea ... trying something else now.

Lance.

#11
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

My biggest issue is that even a straight copy of the journal doesn't work if you use a script to add an element. I've also now had trouble populating listboxes contained in static collapsables (another thing I've never seen done).



#12
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi Again,

OK, I have been giving this some thought .... From what I have seen, the way these "collapsables" work with relation to a "listbox", they always seem to call the data from an existing database, which suggests there is a limited amount of information that needs to be presented with each addition to the list. Therefore, I do wonder of this is the way to go about what you are after anyway.

For instance, the same kind of accessibility to information that is gradually unlocked (like your quest items and bestiary), can be accessed via buttons as they are made accessible to the player (by making them unhidden), which when clicked, present information in a "top window" rather than a window that has expanded underneath a collapsible button.

It still feels like there should be some way to achieve the original method, but I am going to try some other ideas and see what I come up with ... A fresh approach might help.

E.g. A vertical column of buttons that "unlock" as you require that send info to a side panel (running alongside the buttons column) when clicked: Rough idea ... Where B represents the buttons that appear as gained and info appears in side box alongside buttons on the journal page:

------------
|B| | INFO |
|B| | BOX .|
|B| | .blah|
|B| | .blah|
------------
 
Although, I think a top window (scrollable) and a wider listbox of buttons (scrollable) underneath would be better ....
 
---------------------------------|
| Info ...............................|
| Info ...............................|
| Info ...............................|
| Info ...............................|
| Info ...............................|
----------------------------------
| BUTTON NAME ..........|
| BUTTON NAME ..........|
| BUTTON NAME ..........|
| BUTTON NAME ..........|
| BUTTON NAME ..........|
----------------------------------

EDIT: OK, I just checked out your own XML code and it looks like you are heading the same way anyway. :) 

Am I correct in saying that you are able to proceed with your current approach (like my second example above) ... or are you saying that you are still having difficulties? I wasn't sure what you meant when you said, "I've also now had trouble populating listboxes contained in static collapsables (another thing I've never seen done)."  

 

i.e. Are you going to be OK coding the second example above ... or have I missed something?

 

I will keep playing around with this a bit more to see what happens when trying to add to the listbox ... but let me know if you still need any help

anyway.

Lance.



#13
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi,
 
This works how I think you wanted (NOT WITH COLLAPSABLES THOUGH) .... IT'S VERY ROUGH AND NEEDS TIDYING/POLISHING FOR LOOKS.
 
And the scripts need editing to provide the variable data you would need of course ... but I guess you know how to do this. :)
 
For instance, the data "resets" between journal opens, but I think keeping track of activated listbox items should be fairly straightforward to implement.
 
1) THE QUEST ICON SECTION OF THE XML ....
 
NB: I also have idleexpiretime="0.1" in the UIScene.
 

<!-- ***QUESTITEMS SORT OPTIONS*** -->


	<UIPane name="ITEMS_PAGE" x=0 y=74 width=397 height=460 hidden=true >			
		
		<UIListbox name="QUESTITEMS" x=20 y=47 width=359 height=100 yPadding=2 showpartialchild=true scrollbaronright=true unequalcontrols=true scrollsegmentsize=32 update=true >

		<UIPane name="LISTBOX_ITEM" width=237 height=40 tupple=true prototype=true draggable=false OnLeftClick0=UIObject_Misc_ExtractData("self:","string",5,local:6) 							

		OnLeftClick1=UIObject_Misc_ExecuteServerScript("gui_listbox_action",local:6)>

				<UIButton name="PROTO_HEADER" x=20 y=0 height=44 width=310 header=true >
					<UIText indent=18 hangingindent=18 align=left valign=middle fontfamily="Default" style=2 uppercase=true prototype=true maxlines=2 />
					<UIFrame state=up		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=down		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hilited		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=focused		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=hifocus		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=disabled		fill="b_qjd_hover_pressed.tga" />
					<UIFrame state=header		fill="b_qjd_normal.tga" />
					<UIFrame state=hiheader		fill="b_qjd_normal.tga" />
					<UIFrame state=downheader	fill="b_qjd_normal.tga" />
				</UIButton>

				<!UIText name="PROTO_TEXT" x=0 y=0 width=326 height=DYNAMIC prototype=true align=left valign=top multiline=true color="312A0A" fontfamily="NWN1_Dialog" style="bold" />

		</UIPane>
	
		<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>	

		</UIListbox>	


	<UIPane name="QUESTITEM_BOX" x=30 y=150 width=359 height=300 >
					
		<UIText name="QUESTITEM_TEXT1" text="DESCRIPTION ONE" x=15 y=0 width=366 height=20 align=left valign=middle fontfamily="Title_Font" style=1 />
		
		<!UIIcon img="char_stats_title.tga" x=0 y=0 width=366 height=20 ignoreevents="true" />
		<!UIIcon img="p_friend_frame.tga" x=0 y=22 width=78 height=86 />
		<!UIIcon name="QUESTITEM_IMAGE" x=10 y=35 height=64 width=64 />

		<UIListBox name="DESCRIBEBOX" x=80 y=27 width=275 height=106 yPadding=0 xPadding=0 showpartialchild=true unequalcontrols=true scrollsegmentsize=30 hidescrollbarwhennotneeded=false >		

		<UIText name="QUESTITEM_TEXT2" text="DESCRIPTION TWO" width="236" height="DYNAMIC" align="left" valign="top" fontfamily="Default" style="1" multiline="true" indent=4 hangingindent=4 />

		<UIScrollBar name="SB" style="STYLE_SB_THIN"></UIScrollBar>

		</UIListBox>

		<UIIcon name="DETAIL_MIDDLE" img="stats_container_lg.tga" x=0 y=23 width=366 height=114 ignoreevents="true" />	

	</UIPane>	



	</UIPane>

2) A test script "alb_listbox_test" ...
 

void DoListboxDemo1(object oPC) 
{
	DisplayGuiScreen(oPC, "SCREEN_JOURNAL", FALSE); 
//	ClearListBox(oPC, "SCREEN_JOURNAL", "QUESTITEMS"); 		
		
	int iNUM = GetLocalInt(OBJECT_SELF, "NUMBER") + 1;
	string sRowName = "ROW_" + IntToString(iNUM);
	SetLocalInt(OBJECT_SELF, "NUMBER", iNUM);
	
	string sVariables = "5=" + "WHATEVER YOU WANT FOR ITEM NUMBER " + IntToString(iNUM);
	
	AddListBoxRow(oPC,"SCREEN_JOURNAL","QUESTITEMS",sRowName,"PROTO_HEADER=Quest Item " + sRowName,"",sVariables,"");		
}


void main()
{
	
	DoListboxDemo1(GetLastUsedBy()); 

}

3) The "gui_listbox_action" to update the info window:-
 

void main(string sValue) 
{ 

	SendMessageToPC(OBJECT_SELF, "You pressed button: " + sValue); 
	
	SetGUIObjectText(OBJECT_SELF, "SCREEN_JOURNAL","QUESTITEM_TEXT2", -1, sValue);

}

I hope that works foryou too. :) Let me know what you think ...
 
IMAGE 1: NO ENTRIES YET!

1_NOTHING.jpg

IMAGE 2: BUTTON PUSHED ONCE: FIRST ENTRY!

2_ONEPUSH.jpg

IMAGE 3: BUTTON PUSHED AGAIN FOR MORE ENTRIES (SCROLLABLE)!

3_FOURPUSH.jpg

IMAGE 4: BUTTON THREE CLICKED
4_3INFO.jpg

IMAGE 5: BUTTON FOUR CLICKED
5_4INFO.jpg

Cheers,
Lance.



#14
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

My current one already works like that.

 

IKWE8BK.png

 

What I was looking for originally was something that would work identically like the quest journal, where every entry is collapsable with a text field.



#15
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Hi Psionic-Entity,
 
I prefer the way this method looks than having a collapsible anyway! :lol:
 
I think we would be wrestling to make things worse. ;)
 
 
Can you do me a favour and let me have your "cleaned up" code? It would save me a lot of time polishing what I have considering you have already done it. ;)
 
i.e. XML code .... and any "gui_" scripts for a heads up in a downloadable zip or something? (The top background image would be neat too if you are willing?)
 
I wanted to add a bestiary to my own MAIN MENU system, but adding it to the journal instead may save me some time. That said, I have already done some journal editing (http://worldofalthea...screenshot.html) and it all depends how easy it would be to adjust to make work that way. At least it continues to help with my own GUI knowledge and improvements with such.
 
Many Thanks,
Lance.



#16
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

I'm going to do another pass at it where I bump up the size so I can set "Done" back to "Completed" but I don't mind posting it all afterwards. You'll have to do any cleanup work yourself but I don't imagine it would be hard. Uses a custom 2da for the entries and a database call to set things for players.



#17
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

I'm going to do another pass at it where I bump up the size so I can set "Done" back to "Completed" but I don't mind posting it all afterwards. You'll have to do any cleanup work yourself but I don't imagine it would be hard. Uses a custom 2da for the entries and a database call to set things for players.


Hi Psionic-Entity,

The package would be welcome. As I am already taking far longer than I wanted with all the stuff I wanted to get done, this would help save me some time.. hopefully.

Do keep me updated via this thread ... and let me know when and where I can download it.

Many Thanks,
Lance.

#18
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

https://dl.dropboxus...7/x/journal.rar

 

Not going to be doing any packaging work so you'll need to take it as is if you want to use it.

 

Let me know if you do ever manage to solve that collapsable listbox thing.



#19
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

https://dl.dropboxus...7/x/journal.rar
 
Not going to be doing any packaging work so you'll need to take it as is if you want to use it.
 
Let me know if you do ever manage to solve that collapsable listbox thing.


Many Thanks for allowing me access to this ... :)

If I ever work out how to do the original question, I will try to let you know. Maybe, just out of curiosity, it might be worth trying to work backwards. i.e. Copy the entire journal.xml as something like mytest.xml and then try populating the new GUI with your own code ... I'm still not convinced it's the best way though. ;)

Many thanks again. I'll let you know if I get stuck anywhere. ;)

EDIT: Do you have the two include files that describe your functions? E.g. FillBestiary
 
#include "aq_system_bestiary_i"
#include "aq_system_questitems_i"

I am going to look at designing a system without 2das, but gather data directly from the creatures' descriptions themselves.


Lance.

#20
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

Added them to the archive.



#21
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Added them to the archive.


Hi Psionic-Entity,

Great ... got them ... and started to look again ... and discovered I need to see #include "aa_system_database_i". :D

Any chance of having that one too? I am guessing this is probably the last include that I will need (assuming it does not reference any other include) to check out your method .. and then I will work backwards from there, seeing if I can code a method that may be able to do the same thing (bestiary part anyway) without referencing 2da, but using direct description calls instead.

EDIT: I am intrigued at your database system setup. :)

EDIT 2: Actually, I see you have simply returned TRUE for a retrieval for now, so I guess that may be WIP (work in progress) on your part. If, however, you believe it may be helpful for me to view, then I'd be happy to view it ... otherwise, I'll just return TRUE the other reference to the database section for now, so it all compiles OK.

Many Thanks,

Lance.

#22
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

You'll have to handle the database stuff yourself, they're just wrappers to local integers right now.



#23
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

You'll have to handle the database stuff yourself, they're just wrappers to local integers right now.


Hi Psionic-Entity,

Yes, that is what I figured you might have done in the end (from what I had seen of your other code). :)

And, actually, I already have some database code of my own that I can probably incorporate if need be.

I'll have a play around later and post my results for you ... :)

Lance.

#24
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
DELETED - SILLY QUESTION!

#25
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

Psionic-Entity,

 

Just out of curiosity, what trigger method were you going to use to update an entry (bestiary in this case)?

 

For example, I am currently working on an entry being added when a player "targets" an object, but am considering other methods ... if they are possible - dynamic if possible. (Bear in mind that I am trying to work a method that does not require having to use new 2da files, which is working out a lot more complicated than I first anticipated due to creature portraits file names not being readily available.)

 

So, what is your entry update method with yours? Or, are you just working on a variable setting somewhere, regardless of the setting method?

 

EDIT: I have decided to let all players in a party have any entries gained by all players (for MP gaming).

 

Cheers,

Lance.