These are chat archives for Spring-Chobby/Chobby

30th
Jun 2016
GoogleFrog
@GoogleFrog
Jun 30 2016 06:19
gajop I am adding a dummy map handler API
Gajo Petrovic
@gajop
Jun 30 2016 06:20
oke
GoogleFrog
@GoogleFrog
Jun 30 2016 06:21
also we need to get AIs
GoogleFrog
@GoogleFrog
Jun 30 2016 06:36
I'm making a standard with my code here
if an element is not to be reused then it is a widget. It is also not a class. Of course, the widget can use classes
Gajo Petrovic
@gajop
Jun 30 2016 06:44
that's not very good
what your statement means is "if an element is not to be reused then it is not a class."
GoogleFrog
@GoogleFrog
Jun 30 2016 06:46
yes
well perhaps it can be a class
Gajo Petrovic
@gajop
Jun 30 2016 06:47
GoogleFrog
@GoogleFrog
Jun 30 2016 06:47
but the class has to never leave the widget
sure, that extends something
Gajo Petrovic
@gajop
Jun 30 2016 06:49
but "status bar" could be a widget i guess
GoogleFrog
@GoogleFrog
Jun 30 2016 06:49
what I dislike is when things are defined as their own unrelated class and there is unspoken agreement that there will always be a unique instance of that thing
Gajo Petrovic
@gajop
Jun 30 2016 06:49
yeah
most things that are a window could be a widget probably: battlelist, queuelist, playwindow, chatroom, statusbar, teamwindow
GoogleFrog
@GoogleFrog
Jun 30 2016 07:30
MYBATTLESTATUS and CLIENTBATTLESTATUS are so clumsy on uberserver so I am going to implement something general in the wrapper but not deal with the uberserver side
actually, I don't even know if I need the wrapper
GoogleFrog
@GoogleFrog
Jun 30 2016 07:52
I'm going to write the ZK server version of this because the uberserver one is not a nice json thing
Gajo Petrovic
@gajop
Jun 30 2016 08:07
" ZK server version of this " -> "of this"?
GoogleFrog
@GoogleFrog
Jun 30 2016 08:11
the thing is that json is so much better than indexing bits
Gajo Petrovic
@gajop
Jun 30 2016 08:12
oh yeah, definitely
not even the uberserver interface callins should be using bits
just to serialize it, but not in the callin signature
GoogleFrog
@GoogleFrog
Jun 30 2016 08:18
its annoying. The wrapper will need more work because of the uberserver bit system
Gajo Petrovic
@gajop
Jun 30 2016 08:20
use the ZK version (or something better) in the wrapper, do the hacky uberserver stuff in the interface
GoogleFrog
@GoogleFrog
Jun 30 2016 08:20
the thing is that uberserver needs to remember information
information that ZK doesn't need
so the hacky stupid stuff will need to go to the wrapper
Gajo Petrovic
@gajop
Jun 30 2016 08:21
well not the bit parsing at least, that can go to the interface
create an interface function that parses the bitmask and invokes several different callins for each update (assuming that's how you want it to look)
GoogleFrog
@GoogleFrog
Jun 30 2016 08:23
the uberserver inferface wants everything to be sent to it each time
in ZK you send a table of what you want to change
Gajo Petrovic
@gajop
Jun 30 2016 08:23
the wrapper should then just override each specific update type
a key/value update also works
essentially the interface should have a function that accepts key-value changes
GoogleFrog
@GoogleFrog
Jun 30 2016 08:25
define interface
Gajo Petrovic
@gajop
Jun 30 2016 08:26
interface.lua
it's not the worst thing in the world if uberserver interface keeps track of some data
GoogleFrog
@GoogleFrog
Jun 30 2016 08:26
then it needs local data
ok
Gajo Petrovic
@gajop
Jun 30 2016 08:28
i think a lot of confusing things are happening because we are doing inheritance a bit wrong here
probably it should be like this: {wrapper} extends {interface_zk/interface_uber} extends {shared API & data}
or just {interface_zk/interface_uber} extends {shared API & data}
GoogleFrog
@GoogleFrog
Jun 30 2016 08:29
yea probably
Gajo Petrovic
@gajop
Jun 30 2016 08:30
where interface is just the protocol implementation
GoogleFrog
@GoogleFrog
Jun 30 2016 08:30
yes, and no overriding of functions
that conflates too many things
Gajo Petrovic
@gajop
Jun 30 2016 08:30
well interfaces would probably be overriding stuff, as in, providing implementation
you could go and not define functions in the {shared API & data} abstraction but then they might fail if not implemented
do you want to try converting it to such an architecture?
GoogleFrog
@GoogleFrog
Jun 30 2016 08:35
not currently
Gajo Petrovic
@gajop
Jun 30 2016 08:36
ok i'll put it on my TODO then
GoogleFrog
@GoogleFrog
Jun 30 2016 08:37
I'll implement battlerooms to function with the ZK server because that interface is nicer. That would define the API by figuring out what is useful. We can then have the uberserver interface structured to support it
Gajo Petrovic
@gajop
Jun 30 2016 08:41
okey, i'm not yet sure how ZK does it so i can't agree yet; it may be that a better top-level interface is needed, that neither of the two implementations do exactly
GoogleFrog
@GoogleFrog
Jun 30 2016 08:41
it will be that a better interface is needed
but I'll put that in the wrapper
I'm not sure if we want to store the status of other users
the battle status, that is
Gajo Petrovic
@gajop
Jun 30 2016 08:46
we do, but also there should be no guarantee that the status will be available
GoogleFrog
@GoogleFrog
Jun 30 2016 10:05
how do you control which windows are in front of other windows in chili?
Gajo Petrovic
@gajop
Jun 30 2016 10:11
@GoogleFrog I think there is no clean way to do it
hence Spring-Chobby/Chobby#12, in part
but otherwise the control order is what defines it
GoogleFrog
@GoogleFrog
Jun 30 2016 10:14
so we just need to have a way to reorder controls
a chili function which puts a control in front of another control
or all other controls
Gajo Petrovic
@gajop
Jun 30 2016 10:15
i think these should all be methods of a control
GoogleFrog
@GoogleFrog
Jun 30 2016 10:15
sure, they can be
Gajo Petrovic
@gajop
Jun 30 2016 10:15
i'd also move :FocusControl that currently exists to the control itself, instead of Screen where it is right now
GoogleFrog
@GoogleFrog
Jun 30 2016 10:15
I'm not sure actually
these are functions which are acting on a set of children
Gajo Petrovic
@gajop
Jun 30 2016 10:16
should they be though?
GoogleFrog
@GoogleFrog
Jun 30 2016 10:16
so it makes sense for the parent to be the one to have the function called
yea, how do children know about each other?
Gajo Petrovic
@gajop
Jun 30 2016 10:16
they shouldn't
but they could have SendToFront/SendToBack equivalent calls
GoogleFrog
@GoogleFrog
Jun 30 2016 10:17
so how do they reorder the list of children?
Gajo Petrovic
@gajop
Jun 30 2016 10:17
they'd call the appropriate parent's method
the same thing is with FocusControl, they don't know what is the currently focused control, only screen does, but it's cleaner to write it like that still
if there is a function that works on multiple controls, like "a chili function which puts a control in front of another control", then it would belong to the parent control exclusively
i think
although swing is a very old API
#49 yeah this is very useful, agreed
GoogleFrog
@GoogleFrog
Jun 30 2016 10:21
sure, children can be able to call "put me to front" because that doesn't rely on any other children
GoogleFrog
@GoogleFrog
Jun 30 2016 11:05
the console textbox should not use newlines
it should be lots of little textboxes
otherwise we're concatenating massive strings together and rendering a lot of text
Gajo Petrovic
@gajop
Jun 30 2016 11:12
nah that would be very just as bad (too many chili components)
the real solution is to use a table in TextBox
I think jk realized that and was going to implement it (https://github.com/jk3064/chiliui/blob/master/luaui/chili/chili/controls/textbox.lua#L21), but never got to it
GoogleFrog
@GoogleFrog
Jun 30 2016 13:39
the stackpanel is quite hilarously broken
there is probably a way to get it to function
Gajo Petrovic
@gajop
Jun 30 2016 13:39
the default, chili one, right?
GoogleFrog
@GoogleFrog
Jun 30 2016 13:40
yes
there are probably settings or things to do to children to make it function
I'm talking about the one I just used
Gajo Petrovic
@gajop
Jun 30 2016 13:40
also stackpanel is not jk design
quantum added it i think, it's just a small wrapper over layoutpanel
GoogleFrog
@GoogleFrog
Jun 30 2016 13:43
I implemented the battle room
Gajo Petrovic
@gajop
Jun 30 2016 13:44
did you clean Spring-Chobby/Chobby@6f66b99 ?

children = {

  • lblBattleTitle,
  • lblNumberOfPlayers,
  • btnQuitBattle,
  • lblHaveGame,
  • lblHaveMap,
  • btnStartBattle,
  • btnSpectate,
  • line,
  • chatPanel,
  • },

makes no sense if you define the window first

either define window last (my preference) and don't use parent = window, or delete those children
the good thing about defining window last is you can specify custom order in a very clear way
GoogleFrog
@GoogleFrog
Jun 30 2016 13:47
that is not latest
Gajo Petrovic
@gajop
Jun 30 2016 13:47
yeh just something to keep in mind
have map doesn't work or what?
gives me a green ?
maybe font thing
probably..
i can't join some games
[liblobby] Error: No such function: UpdateBotStatus, for command: UpdateBotStatus {"AllyNumber":1,"Name":"Bot_1","TeamNumber":3,"AiLib":"Null AI","Owner":"_Shaman"}
there is an error when registering listeners for battleroom
you are registering them each time you join, so it creates multiple ones
just registering once, or dispose them and re-register each time
most obvious is chat, join/leave battlerooms a few time and then you'll see each msg repeated X times
Gajo Petrovic
@gajop
Jun 30 2016 13:53
ZK also doesn't show PWd battles correctly, uber does
ZKS i guess
GoogleFrog
@GoogleFrog
Jun 30 2016 13:53
I have not touched PW or bots yet
so they won't be working
Gajo Petrovic
@gajop
Jun 30 2016 13:53
passworded
GoogleFrog
@GoogleFrog
Jun 30 2016 13:53
yes
Gajo Petrovic
@gajop
Jun 30 2016 13:54
ok
as long as we aren't talking about planetwars :D
also i only see one team
named Team 0
oh they get created if i press new team
and other weird things are happening when i joined a different, FFA room
i like that it behaves rather OK if i'm also connected via ZKL
probably has issues but still
well not bad all around
looking forward to free some time to get back at it
GoogleFrog
@GoogleFrog
Jun 30 2016 14:02
fixed the player list
Gajo Petrovic
@gajop
Jun 30 2016 14:02
I suggest you move lobby:AddListener to widget:Initialize and RemoveListener to widget:Shutdown
it may require a bit of extra fiddling if the widget creates multiple objects that should each have a different "listener", but still doable through a simple associative table
and then in the next step of liblobby we may just have widget:CallinName without explicit Add/Remove
will see, may end up being much slower to start and call using the default WH implementation
if i'm already in a battle and try to join another one, nothing happens
GoogleFrog
@GoogleFrog
Jun 30 2016 14:07
I've got a solution to the UI jumping around now
really?
I guess so
Gajo Petrovic
@gajop
Jun 30 2016 14:07
didn't test with Spring-Chobby/Chobby@e441aae
GoogleFrog
@GoogleFrog
Jun 30 2016 14:07
that makes sense
Gajo Petrovic
@gajop
Jun 30 2016 14:08
it closes the BR list window
but doesn't change the battle (GUI wise)
GoogleFrog
@GoogleFrog
Jun 30 2016 14:08
BR?
yes
Gajo Petrovic
@gajop
Jun 30 2016 14:08
battleroom
"You are already in another battle"
GoogleFrog
@GoogleFrog
Jun 30 2016 14:09
yep, looks like a server thing
Gajo Petrovic
@gajop
Jun 30 2016 14:11
user list is still odd sometimes
puts me from 1st to like 3rd position, over someone else
GoogleFrog
@GoogleFrog
Jun 30 2016 15:15
I think the battleroom is now adequet
of course, the UI could move around and be made to make more sense
but each required component is in place
except for map choosing and the minimap
well, and game specific stuff like picking colour, faction and interfacing with an autohost
Gajo Petrovic
@gajop
Jun 30 2016 15:16
empty teams should be automatically deleted
GoogleFrog
@GoogleFrog
Jun 30 2016 15:17
yes
well, a basic version of that turned out to be easy to do
Gajo Petrovic
@gajop
Jun 30 2016 15:19
and then there's still the change BR thing
make it send a leave battle + join battle
GoogleFrog
@GoogleFrog
Jun 30 2016 15:24
it doesn't do battle lists
I'm not getting into the battle list handling widget tonight
Gajo Petrovic
@gajop
Jun 30 2016 15:26
right, just something to keep in mind then
GoogleFrog
@GoogleFrog
Jun 30 2016 15:28
next step is to make a dummy team at the bottom of the battle window which is called "New Team" and has a join button
and the eventual add AI button
Gajo Petrovic
@gajop
Jun 30 2016 15:29
i think most work will go into extending the engine to do stuff it isn't already
that's how it was when i was first implementing downloading and stuff
GoogleFrog
@GoogleFrog
Jun 30 2016 15:34
the list of engine stuff doesn't look too scary
ParzivalX
@ParzivalX
Jun 30 2016 15:35
So I'm guessing this lobby is specifically for zk?
because not all AIs work with every spring mod
Gajo Petrovic
@gajop
Jun 30 2016 15:54
it's not ZK-only
Jose Luis
@TurBoss
Jun 30 2016 19:40
is posible to disable F1, F2, F3 Ctrl +F1, 2 ,3 keys?
it allows to change the default camera and start moving it