xboxscene.org forums

Author Topic: Conditions And Total Number Of Menu Items  (Read 80 times)

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Conditions And Total Number Of Menu Items
« on: February 06, 2004, 06:54:00 AM »

CODE
IF x THEN
IF y THEN
z
ENDIF
ENDIF


IF x OR y THEN z
CODE
IF x THEN
z
ENDIF
IF y THEN
z
ENDIF

Or you could use GOTO's
CODE
IF x GOTO trueCondition
IF y GOTO trueCondition
GOTO falseCondition
:trueCondition
z
:falseCondition


This is better in the sense that it doesn't require writing z twice.



Don't think as skin can do that for now.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Conditions And Total Number Of Menu Items
« Reply #1 on: February 06, 2004, 07:22:00 AM »

I think he's referring to the use of conditionals in skin elements.

All skin conditionals also have "not" equivalents; which ones are you looking to use, and for what effect?
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Conditions And Total Number Of Menu Items
« Reply #2 on: February 07, 2004, 04:10:00 AM »

Well, the conditionals are "AND" only, but through clever usage of the NOT, you could simulate the OR operation.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Conditions And Total Number Of Menu Items
« Reply #3 on: February 15, 2004, 09:31:00 AM »

QUOTE (diffident @ Feb 15 2004, 12:53 PM)
QUOTE
conditionals are "AND" only


BJ, this doesn't mean I could use several conditionals for one element to get a logical AND does it? I mean like this:

<LayoutElement Type="Image" Source="Whatever">
   <Condition>ItemEntry</Condition>
   <Condition Arg1="0">ItemSelected</Condition>
</LayoutElement>

(ie IF the currently selected item isn't a submenu AND it's the first item in the list THEN show this image)

I've had a fairly thorough go at making this work, but I can only get the first conditional to have any effect (I'm testing using the WIP, so the <Condition Arg1="0">ItemSelected</Condition> does work on its own, or if I put it first).

Have I misinterpreted what you meant?

I believe all conditionals need to pass in order for the item to be displayed.  It should work... but I haven't tested it much.
Logged

diffident

  • Archived User
  • Newbie
  • *
  • Posts: 10
Conditions And Total Number Of Menu Items
« Reply #4 on: February 16, 2004, 03:34:00 AM »

QUOTE (BenJeremy @ Feb 15 2004, 07:31 PM)
I believe all conditionals need to pass in order for the item to be displayed.  It should work... but I haven't tested it much.

I'll give it another go - that's what I thought you meant.
Logged