Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Mon Feb 14, 2022 6:58 am   

Once again, Window screw-up
 
Start session this morning and every window has the same buttons. Thus, starting is a bit longer than usual.

Oh how I long for an answer.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Feb 18, 2022 12:27 pm   
 
If you have these buttons inside a separate package... Make an onLoad event that does the following:

Code:
$list=%names
#CALL %pop($list)
#FORALL $list {#CALL @pkgState(%i, %class, 0)}


And the XML for the @pkgState function is:

Code:
<func name="pkgState" id="723">
  <value>#IF (!$window OR !$package) {
  #SAY "Syntax: #CALL @pkgState(window, package, optional 0 or 1)"
  #EXIT
  }
#IF %null( $boolean) {#IF %ismember( $package, %packages( $window)) {$boolean = 0} {$boolean = 1}}
$packages = %packages( $window)
#IF $boolean {#CALL %packages( $window, %additem( $package, $packages))} {#CALL %packages( $window, %delitem( $package, $packages))}</value>
  <arglist>$window,$package,$boolean</arglist>
</func>
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Mon Feb 21, 2022 6:00 am   
 
Oof! Can you break that down into useful English: what is it trying to do?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Feb 23, 2022 5:19 pm   
 
@pkgState() is a #FUNCTION that allows you to toggle a given package on and off in a given window.

My #EVENT loops through all your windows and toggles off the package it is executed from in everything but the main window.

%names is a list of all the windows in a given session with the self-titled one always being first
%pop calls and deletes the first item of a list
%class by itself would refer to the name of the parent object, in this case, the self-titled module that is the root folder of any package.

So you would want a copy of it in every package that has buttons (to prevent buttons in all windows) or #CAPTURE triggers (to prevent recursive loops).
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri Feb 25, 2022 11:07 am   
 
I only have buttons in one package. It is not the buttons which are the problem. This is, once again, a window-handling problem.

I closed all the windows and deleted them from settings then just waited for triggers to re-make them. No extra buttons. Problem fixed.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Feb 25, 2022 12:37 pm   
 
You asked for an answer.
This is my answer.

No one is forcing you to use this code.

P.S. I am pretty sure the issue is caused by Windows force quitting CMUD to restart.
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sun Feb 27, 2022 7:21 am   
 
Thanks.

As I said, I only have buttons defined in one package so I couldn't see any value in using code. It was much easier to remove the windows and let them make their own way back.

In its properties, the package with the buttons has only itself and the main session checked.
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Mon Mar 07, 2022 5:31 am   
 
Layout shit itself again.

I tried using your event/function. I have it in the main session and the only other package with buttons. Whatever it is supposed to be doing...it isn't. I still have buttons all over the place, in every child window. 14 Windows each with 31 buttons.

Plus, "invalid local variable $window"


I deleted the windows (again).
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Mar 09, 2022 2:20 am   
 
you need to make the function as well and they only need to be in the child package with the buttons
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri Mar 11, 2022 8:53 pm   
 
What I am currently at is that I floated all the windows. Then I saved the layout and deleted those window settings. These windows all open and are written to by triggers. So just a matter of waiting for them to recreate.

My buttons started off in the main session window (where I expect them to be) but when one package window opened, which was still docked to another window, all the buttons hopped there. I undocked it and all the buttons hopped back to the main window. Then another. Not happened with all windows though so I have no idea what the pattern is.

Is there a way to fix buttons to a package or window? Are windows/packages classes?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Fri Mar 11, 2022 9:32 pm   
 
Windows are indeed a container.
Though for scoping reasons they are higher up than a class.
Usually, the contents of one window cannot see the contents of another window.

Packages are similar in regards to scoping, only the contents of a package are written to a separate file.
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri Mar 11, 2022 10:20 pm   
 
By default, the packages have their box ticked and the main session ticked when I look at the properties. All others are off.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Mar 12, 2022 1:27 am   
 
Something happens when CMUD is forced to quit for a windows update that toggles all available packages for each window to on.
I developed the settings above because I used too many (11) child windows in my layout to nuke it every time it messed up.
I needed a way to fix it as it sits.
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sat Mar 12, 2022 12:48 pm   
 
That HAS happened a couple of times as I leave the session connected at the weekend to alarm a command at 8am.

I farkin' hate windows10
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sun Mar 13, 2022 9:28 am   
 
So, last night I was getting 16's instead of sent commands. Every trigger failed, speedwalks, etc...just 16s (very No Man's Sky).

This morning I dropped everything (except the func/onload you provided) from the abilities package (has almost all the buttons) back into the main session. Nothing amiss as yet.

Very disappointing.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net