POLL: New Crosshair Setup [ENDED]

How should crosshairs be shown, by default?

Poll ended at 24 Oct 2011, 13:11

Different crosshairs depending on the weapon in use.
9
43%
One fixed crosshair that never changes.
10
48%
There shouldn't be a crosshair at all!
2
10%
 
Total votes : 21

Re: POLL: New Crosshair Setup

Postby srbs » 27 Oct 2011, 05:43

Try something like:
{l Code}: {l Select All Code}
guilist [
  guistrut 40 1
  guislider var 0 100
]


That reminds me,
{l Code}: {l Select All Code}
guistrut 40 1

is equivalent to,
{l Code}: {l Select All Code}
guilist [guistrut 40]


srbs
srbs
 
Posts: 94
Joined: 17 Mar 2011, 07:00

Re: POLL: New Crosshair Setup

Postby ZeroKnight » 28 Oct 2011, 19:21

Well, I've been playing with it more, trying different combinations of amounts of nested guilists in different parts of the areas of interest, but I still come up with bubkiss. I've gotten close though. The best I managed to get was the right width I wanted, as well as the scrollbar to the right, and it even seemed like it wanted to scroll the amount it would have needed if it were in the actual box I wanted it, but it doesn't actually make a scrolling box. Just a list of crosshair images stretched to the bottom of the screen.

Bleh. Still waiting on quin's guidance (no rush, take your time ^^) on this, but for now, here's my most recent changes and messing-arounds. If you want to test it out, you'll have to change the loopfiles for where it looks for the crosshairs. They all have to be in one folder, no recursive dirs. It will look for a dir labelled "crosshairs.test", but you can change it, obviously. It's at the very start of "newgui options". The actual crosshair selector is under the UI tab code.

menus.cfg
Latest Screwing Around [10/28]
(88.79 KiB) Downloaded 289 times


Ignore my miscellaneous modifications :P
[ Github ][ WazuClan -- irc.wazuclan.com #wazuclan ][ Zero's Archive of RE Extensions, Scripts, WeapMods & More! ]
User avatar
ZeroKnight
 
Posts: 524
Joined: 08 Jun 2011, 01:24
Location: Ohio, United States

Re: POLL: New Crosshair Setup [ENDED]

Postby ZeroKnight » 17 Dec 2011, 06:47

Bumping as per request of quin. Reposting code; can't remember if I updated it since my last paste.

{l Code}: {l Select All Code}
// Around Line 1675-ish. Right above "newgui options ["

crosshairlist = ""
loopfiles crosshairs crosshairs.test png [
    crosshairlist = (concat $crosshairlist $crosshairs)
]

[ . . . ]

// Just after "Zoom Crosshair Size"; around Line 1890:

    guistrut 1
    crosshairscount = 24
    guinoautotab [
    guitext "Crosshair Texture"
    guicontainer [
        numcrosshairs = (- (listlen $crosshairlist) 1)
        guilist [
            guilist [
                guilist [ guistrut (listlen $crosshairlist) ] // not sure on this value. set random for now
                crosshairindex = (min (max 0 (- $numcrosshairs $crosshairscount)) $crosshairindex)
                guilist [
                    guilist [ guistrut 34 ]
                    guilistsplit n 6 $crosshairlist [
                        guiimage (format "crosshairs.test/%1" $n) [crosshairtex (format "crosshairs.test/%1" @n)] 1.5 1
                    ]
                ]
            ]
        ]
        guistrut 2
        guislider crosshairindex 0 (max (- $numcrosshairs $crosshairlist) 0) [] 1 1
    ] [ guistrut 38; guilist [ guistrut (+f (listlen $crosshairlist) 3.5) ] ]
    ]


Ignore the random out of place variables. I was trying to mimic what you did with the Map list, but unsuccessfully. I'll leave it up to you, since you managed to do this successfully. All I need is a scrollbox, then I just have to finish up the formatting, and duplicate it for the hit crosshair, and I'll give you the resulting code, and hopefully we'll see it in 1.2 :)
[ Github ][ WazuClan -- irc.wazuclan.com #wazuclan ][ Zero's Archive of RE Extensions, Scripts, WeapMods & More! ]
User avatar
ZeroKnight
 
Posts: 524
Joined: 08 Jun 2011, 01:24
Location: Ohio, United States

Re: POLL: New Crosshair Setup [ENDED]

Postby qreeves » 17 Dec 2011, 08:38

No guarantee this will work how you want, but I just spent the better part of the last hour working on this:
{l Code}: {l Select All Code}
crosshairlist = ""
crosshairindex = 0
newgui crosshair [
   guistayopen [
      crosshaircount = 5
      numcrosshairs = (- (listlen $crosshairlist) 1)
      guilist [
         guilist [
            guicomb [
               guitext "Crosshair Texture"
               guistrut 1
            ]
            guilist [
               guilist [ guistrut (*f $crosshaircount 4) ]
               guilist [
                  guilist [ guistrut 30 ]
                  crosshairindex = (min (max 0 (- $numcrosshairs $crosshaircount)) $crosshairindex) //safeguard
                  break = 0
                  loopwhile i $crosshaircount [if (= $break 0) [ 1 ] [ 0 ]] [
                     q = (+ $crosshairindex $i)
                     curcrosshair = (at $crosshairlist $q)
                     crosshairname = (concatword "crosshairs/" $curcrosshair)
                     guibody [
                        guilist [
                           guistrut 0.5
                           guilist [
                              guiimage $crosshairname [] 1.5 1
                              guistrut 1
                              guilist [
                                 guistrut 1
                                 guibutton (format "%1%2" (? (strcmp $crosshairtex $crosshairname) "^fy" "^fa") $curcrosshair) []
                              ]
                           ]
                           guistrut 0.5
                        ]
                     ] [ crosshairtex @crosshairname ] [ crosshairtex @crosshairname ]
                     if (= $q $numcrosshairs) [ break = 1 ]
                  ]
               ]
               guislider crosshairindex 0 (max 0 (- $numcrosshairs $crosshaircount)) [] 1 1
            ]
         ]
      ]
   ]
] [
    if (= $guipasses 0) [
      crosshairlist = ""
      loopfiles crosshairs crosshairs png [
         crosshairlist = (concat $crosshairlist $crosshairs)
      ]
      crosshairindex = (listfind mcurcrosshair $crosshairlist [strcmp (concatword "crosshairs/" $mcurcrosshair) $crosshairtex])
   ]
]
Quinton "quin" Reeves | Lead Developer, Red Eclipse | http://redeclipse.net/ | http://www.facebook.com/redeclipse.net
User avatar
qreeves
 
Posts: 1294
Joined: 17 Mar 2011, 03:46
Location: Queensland, Australia

Re: POLL: New Crosshair Setup [ENDED]

Postby ZeroKnight » 17 Dec 2011, 22:05

Alright quin, thanks very much for getting that scrollbox for me :) I'm sure everyone else will be thankful as well when they can change their crosshair texture from within a GUI ^_~

Here's the necessary code. The new setup goes as follows: Options > UI: Just under the Zoom Crosshair Size changer is a new button labelled "Crosshair Texture". Pressing it opens a new GUI with two tabs. The first one is for the Crosshair, the second is for the Hit Crosshair. (labelled appropriately) In each, is a large scrollbox that reads from your "crosshairs" folder (note that no crosshairs can be in subfolders) and displays each as an image. Clicking one will set your crosshair. Easy and quick, very friendly to non-console users :)
Thanks again quin, couldn't have finished it without you. Curse you, Cubescript, for needing odd code to make a fake scrollbox >_>

Anyway, here's the code. I didn't just include my menus.cfg because it's got quite a few modifications in it.
{l Code}: {l Select All Code}
// Again, this is JUST before "newgui options [", just after "macro resbutton"

crosshairlist = ""
crosshairindex = 0
newgui crosshair [
    guiheader "Crosshair"
    guistayopen [
        crosshaircount = 5
        numcrosshairs = (- (listlen $crosshairlist) 1)
        guilist [
            guilist [
                guicomb [
                    guitext "Crosshair Texture"
                    guistrut 1
                ]
                guilist [
                    guilist [ guistrut (*f $crosshaircount 4) ]
                    guilist [
                        guilist [ guistrut 30 ]
                        crosshairindex = (min (max 0 (- $numcrosshairs $crosshaircount)) $crosshairindex) //safeguard
                        break = 0
                        loopwhile i $crosshaircount [if (= $break 0) [ 1 ] [ 0 ]] [
                            q = (+ $crosshairindex $i)
                            curcrosshair = (at $crosshairlist $q)
                            crosshairname = (concatword "crosshairs/" $curcrosshair)
                            guibody [
                                guilist [
                                    guistrut 0.5
                                    guilist [
                                        guiimage $crosshairname [] 1.5 1
                                        guistrut 1
                                        guilist [
                                            guistrut 1
                                            guibutton (format "%1%2" (? (strcmp $crosshairtex $crosshairname) "^fy" "^fa") $curcrosshair) []
                                        ]
                                    ]
                                    guistrut 0.5
                                ]
                            ] [ crosshairtex @crosshairname ] [ crosshairtex @crosshairname ]
                            if (= $q $numcrosshairs) [ break = 1 ]
                        ]
                    ]
                    guislider crosshairindex 0 (max 0 (- $numcrosshairs $crosshaircount)) [] 1 1
                ]
            ]
        ]
        if (= $guipasses 0) [
            crosshairlist = ""
            loopfiles crosshairs crosshairs png [
                crosshairlist = (concat $crosshairlist $crosshairs)
            ]
            crosshairindex = (listfind mcurcrosshair $crosshairlist [strcmp (concatword "crosshairs/" $mcurcrosshair) $crosshairtex])
        ]
    ]
    guitab "Hit-Crosshair"
    guistayopen [
        hitcrosshaircount = 5
        numhitcrosshairs = (- (listlen $hitcrosshairlist) 1)
        guilist [
            guilist [
                guicomb [
                    guitext "Hit-Crosshair Texture"
                    guistrut 1
                ]
                guilist [
                    guilist [ guistrut (*f $hitcrosshaircount 4) ]
                    guilist [
                        guilist [ guistrut 30 ]
                        hitcrosshairindex = (min (max 0 (- $numhitcrosshairs $hitcrosshaircount)) $hitcrosshairindex) //safeguard
                        break = 0
                        loopwhile i $hitcrosshaircount [if (= $break 0) [ 1 ] [ 0 ]] [
                            q = (+ $hitcrosshairindex $i)
                            curhitcrosshair = (at $hitcrosshairlist $q)
                            hitcrosshairname = (concatword "crosshairs/" $curhitcrosshair)
                            guibody [
                                guilist [
                                    guistrut 0.5
                                    guilist [
                                        guiimage $hitcrosshairname [] 1.5 1
                                        guistrut 1
                                        guilist [
                                            guistrut 1
                                            guibutton (format "%1%2" (? (strcmp $hitcrosshairtex $hitcrosshairname) "^fy" "^fa") $curhitcrosshair) []
                                        ]
                                    ]
                                    guistrut 0.5
                                ]
                            ] [ hitcrosshairtex @hitcrosshairname ] [ hitcrosshairtex @hitcrosshairname ]
                            if (= $q $numhitcrosshairs) [ break = 1 ]
                        ]
                    ]
                    guislider hitcrosshairindex 0 (max 0 (- $numhitcrosshairs $hitcrosshaircount)) [] 1 1
                ]
            ]
        ]
    ]
           
] [ if (= $guipasses 0) [
            hitcrosshairlist = ""
            loopfiles hitcrosshairs crosshairs png [
                hitcrosshairlist = (concat $hitcrosshairlist $hitcrosshairs)
            ]
            hitcrosshairindex = (listfind mcurhitcrosshair $hitcrosshairlist [strcmp (concatword "crosshairs/" $mcurhitcrosshair) $hitcrosshairtex])
        ]
]


Jump ahead, this is just after the code makeup of the Zoom Crosshair Sizer in the UI tab
{l Code}: {l Select All Code}
guistrut 1    // I don't remember if that was always there, or if I added it...
guibutton "Crosshair Texture" [showgui crosshair]


Can't wait to see it in 1.2 :)
[ Github ][ WazuClan -- irc.wazuclan.com #wazuclan ][ Zero's Archive of RE Extensions, Scripts, WeapMods & More! ]
User avatar
ZeroKnight
 
Posts: 524
Joined: 08 Jun 2011, 01:24
Location: Ohio, United States

Re: POLL: New Crosshair Setup [ENDED]

Postby Catalanoic » 20 Dec 2011, 19:40

please post a image of this!
User avatar
Catalanoic
 
Posts: 46
Joined: 28 Sep 2011, 17:57
Location: Barcelona, Catalan Countries

Re: POLL: New Crosshair Setup [ENDED]

Postby ZeroKnight » 20 Dec 2011, 23:59

Image

Image
[ Github ][ WazuClan -- irc.wazuclan.com #wazuclan ][ Zero's Archive of RE Extensions, Scripts, WeapMods & More! ]
User avatar
ZeroKnight
 
Posts: 524
Joined: 08 Jun 2011, 01:24
Location: Ohio, United States

Re: POLL: New Crosshair Setup [ENDED]

Postby TheLastProject » 21 Dec 2011, 08:47

That looks pretty sweet ZeroKnight. If you can get that X to be positioned correctly this seems like a great thing for "Advanced Settings" or the like.
Hats, Afros, wings and raptor feet. This game is showing progress indeed.
TheLastProject
 
Posts: 432
Joined: 06 Nov 2011, 17:04

Re: POLL: New Crosshair Setup [ENDED]

Postby Ulukai » 21 Dec 2011, 09:38

I believe the 'close-button-problem' is resolved in SVN.
User avatar
Ulukai
 
Posts: 741
Joined: 19 Mar 2011, 10:55
Location: Mechelen, Belgium

Re: POLL: New Crosshair Setup [ENDED]

Postby Catalanoic » 22 Dec 2011, 19:12

Looks pretty and futurist with RE style! Well done!
User avatar
Catalanoic
 
Posts: 46
Joined: 28 Sep 2011, 17:57
Location: Barcelona, Catalan Countries

Re: POLL: New Crosshair Setup [ENDED]

Postby FlyinHigh » 22 Dec 2011, 19:19

I cannot access these in game right now
FlyinHigh
 
Posts: 25
Joined: 08 Nov 2011, 00:58

Re: POLL: New Crosshair Setup [ENDED]

Postby srbs » 30 Dec 2011, 04:30

qreeves {l Wrote}:
{l Code}: {l Select All Code}
loopwhile i $crosshaircount [if (= $break 0) [ 1 ] [ 0 ]] [..]


I had a good laugh from that one:
{l Code}: {l Select All Code}
loopwhile i $crosshaircount [! $break] [..]
srbs
 
Posts: 94
Joined: 17 Mar 2011, 07:00

Who is online

Users browsing this forum: No registered users and 0 guests

cron