RealmCrafter Wiki
Advertisement

Originally posted by Checkpointng


Here is the code snip for ActionBar ToolTip, i got it stable as well as getting the right spell tooltip to show from any of the 3 actionbar slots! If your not sure what this does, take a look at this youtube video: http://www.youtube.com/watch?v=Ofbc4qt2CY4

This is code snip v1.0 as there is abit more tiddy up that can be done, but its stable enough for anyone to use and no longer causes MAV on empty slots.

Usage: with Blitz3D open Client\Modules\Interface3D.bb and Find the snip below inside the UpdateInterace() Function

 ; Small (text only) tooltips
   If MilliSecs() - LastMouseMove > 1000
      If WTooltip = 0 And LTooltip = 0
         ; Action bar quick slots
         For i = 0 To 11
            If GY_MouseHovering(BActionBar(i))
               LTooltip = GY_CreateLabel(0, GY_MouseX# + 0.03, GY_MouseY#, "F" + Str$(i + 1) + " " + LanguageString$(LS_ToUse))
               Goto TooltipsDone
            EndIf
         Next

And Replace with this:

   ; Action Bar ToolTip
   If MilliSecs() - LastMouseMove > 1000
      If WTooltip = 0 And LTooltip = 0
         ; Action bar quick slots
         If ActionBarStart = 2
            Offset = 12
         ElseIf ActionBarStart = 3
            Offset = 24
         EndIf
         For i = 0 To 11
            If GY_MouseHovering(BActionBar(i))
               If ActionBarSlots(i + Offset) < 0 And ActionBarSlots(i + Offset) <> 0
                  If RequireMemorise
                     Num = ActionBarSlots(i + Offset) + 10
                     Sp.Spell = SpellsList(Me\KnownSpells[Me\MemorisedSpells[Num]])
                  Else
                     Num = ActionBarSlots(i + Offset) + 1000
                     Sp.Spell = SpellsList(Me\KnownSpells[Num])
                  EndIf
                  If Sp <> Null
                     X# = GY_MouseX#
                     Y# = GY_MouseY# + 0.008
                     If Y# + 0.4 > 0.99 Then Y# = 0.59
                     If X# + 0.4 > 0.99 Then X# = 0.59
                     If LTooltip <> 0 Then GY_FreeGadget(LTooltip) : LTooltip = 0
                     WTooltip = GY_CreateWindow(Sp\Name$, X#, Y#, 0.4, 0.2, True, False, False)
                     WTooltipReturn = WSpells
                     Desc$ = Sp\Description$
                     If Desc$ = "" Then Desc$ = LanguageString$(LS_NoDescription)
                     Y# = 0.01
                     ; Word wrap
                     While Desc$ <> ""
                        LDesc = GY_CreateLabel(WTooltip, 0.02, Y#, Desc$)
                        Y# = Y# + 0.14
                        Gad.GY_Gadget = Object.GY_Gadget(LDesc)
                        If GY_TextWidth#(Gad\EN, Desc$) >= 0.4
                           Split = False
                           For i = Len(Desc$) To 1 Step -1
                              If Mid$(Desc$, i, 1) = " "
                                 If GY_TextWidth#(Gad\EN, Left$(Desc$, i - 1)) < 0.4
                                    GY_UpdateLabel(LDesc, Left$(Desc$, i - 1))
                                    Desc$ = Mid$(Desc$, i + 1)
                                    Split = True
                                    Exit
                                 EndIf
                              EndIf
                           Next
                           If Split = False
                              For i = Len(Desc$) To 1 Step -1
                                 If GY_TextWidth#(Gad\EN, Left$(Desc$, i - 1)) < 0.4
                                    GY_UpdateLabel(LDesc, Left$(Desc$, i - 1))
                                    Desc$ = Mid$(Desc$, i)
                                    Exit
                                 EndIf
                              Next
                           EndIf
                        Else
                           Desc$ = ""
                        EndIf
                     Wend
                     GY_GadgetAlpha(WTooltip, 0.85, True)
                  EndIf
                  Goto TooltipsDone
               EndIf
            EndIf
         Next

BUG: Its not related to this snip, however its something i found when you empty a slot from the actionbar 2 or 3 by right click and then switch action bars and go back, it then seems to call ItemID 0 and displays that icon in its place. It doest cause MAV or anything, but its abit strange. Ill look further into it and see why it calls ItemID 0 when a slot is right click to empty in actionbars 2 and 3.

Id like to also add if time permits the same function to items placed, i.e. potions, armor, weapons etc...

Advertisement