My GUI ist still like in this Thread :
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44644.msg596325#msg596325
Problem is that I can rightclick on the Items and it will wie displayed the current Message, but if I rightclick on them my Curser stays the same and doesent get the Iventory object. So I'am not able to drag out the Objects from the Inventar.
I found some kind of Help on Adventure Treff from a Thread and added following lines:
In repeatedly_execute:
Code: ags
Inventar-Klicks:
Code: ags
But it didn't do anything.
Here my aktulized skript wich still doesent work out for that problem:
Code: ags
Code: ags
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44644.msg596325#msg596325
Problem is that I can rightclick on the Items and it will wie displayed the current Message, but if I rightclick on them my Curser stays the same and doesent get the Iventory object. So I'am not able to drag out the Objects from the Inventar.
I found some kind of Help on Adventure Treff from a Thread and added following lines:
In repeatedly_execute:
GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (gc == invCustomInv) { // Maus über Inventarfenster?
if (mouse.Mode != eModeInteract && mouse.Mode != eModeUseinv)
mouse.Mode = eModeInteract;
}
Inventar-Klicks:
// Anfang von on_mouse_click:
InventoryItem*ia = inventory[game.inv_activated]; // falls Klick auf Inv Item, in ia speichern
// dann:
...
else if (button == eMouseLeftInv) {
if (mouse.Mode == eModeUseinv) ia.RunInteraction(eModeUseinv); // aktuelles Item mit ia benutzen
else player.ActiveInventory = ia; // angeklicktes Item auswählen
}
else if (button == eModeRightInv) {
if (mouse.Mode == eModeUseinv) player.ActiveInventory = null; // aktives Item abwählen
else ia.RunInteraction(eModeLookat); // angeklicktes Item anschauen
}
But it didn't do anything.
Here my aktulized skript wich still doesent work out for that problem:
function on_mouse_click(MouseButton button) {
InventoryItem*ia = inventory[game.inv_activated]; // falls Klick auf Inv Item, in ia speichern
// called when a mouse button is clicked. button is either LEFT or RIGHT
if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}
else if (button == eMouseLeft)
{
// ProcessClick(mouse.x, mouse.y, mouse.Mode );
int nm;
if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter)
{
nm= eModeTalkto;
}
else if (GetLocationType(mouse.x, mouse.y) == eLocationNothing)
{
nm= eModeWalkto;
}
else if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
{
if(wechsel == 0)
{
nm=eModeInteract;
}
else
{
nm= eModeWalkto;
}
}
else
{
nm=eModeInteract;
}
ProcessClick(mouse.x, mouse.y, nm);
}
else if (button == eMouseRight || button == eMouseWheelSouth){
// right-click our mouse-wheel down, so cycle cursor
// mouse.SelectNextMode();
int mm;
if (GetLocationType(mouse.x, mouse.y) == eLocationNothing)
{
mm = eModeWalkto;
}
else
{
mm = eModeLookat;
}
ProcessClick(mouse.x, mouse.y, mm);
}
else if (button == eMouseMiddle) {
// Middle-button-click, default make character walk to clicked area (a little shortcut)
// Could have been just "player.Walk(mouse.x,mouse.y)", but it's best to
// leave our options open - what if you have a special script triggered
// on "walking" mode?
ProcessClick(mouse.x, mouse.y, eModeWalkto);
}
else if (button == eMouseWheelNorth) {
// Mouse-wheel up, cycle cursors
// If mode isn't WALK, set the previous mode (notice usage of numbers instead
// of eNums, when it suits us)...
if (mouse.Mode>0) mouse.Mode=mouse.Mode-1;
else
{
// ...but if it is WALK mode...
if (player.ActiveInventory!=null)
{
//...and the player has a selected inventory item, set mouse mode to UseInv.
mouse.Mode=eModeUseinv;
}
else
{
// If they don't, however, just set it to mode TALK (change this line if you add more cursor modes)
mouse.Mode=eModeTalkto;
}
}
}
else if (button == eMouseLeftInv)
{
if (mouse.Mode == eModeUseinv) ia.RunInteraction(eModeUseinv); // aktuelles Item mit ia benutzen
else player.ActiveInventory = ia; // angeklicktes Item auswählen
}
else if (button == eMouseRightInv)
{
if (mouse.Mode == eModeUseinv) player.ActiveInventory = null; // aktives Item abwählen
else ia.RunInteraction(eModeLookat); // angeklicktes Item anschauen
}
}
function repeatedly_execute() {
// Put here anything you want to happen every game cycle, even when
// the game is paused. This will not run when the game is blocked
// inside a command like a blocking Walk()
GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (gc == invCustomInv)
{ // Maus über Inventarfenster?
if (mouse.Mode != eModeInteract && mouse.Mode != eModeUseinv)
mouse.Mode = eModeInteract;
}
if (GetLocationType(mouse.x, mouse.y)==eLocationCharacter)
{
mouse.Mode = eModeTalkto;
wechsel = 0;
}
else if (GetLocationType(mouse.x, mouse.y)==eLocationObject)
{
mouse.Mode = eModeInteract;
wechsel = 0;
}
else if (GetLocationType(mouse.x, mouse.y)==eLocationHotspot)
{
if(wechsel==0)
{
mouse.Mode = eModeInteract;
wechsel = 0;
}
else
{
mouse.Mode = eModeArrowR;
}
}
else
{
mouse.Mode = eModeWalkto;
wechsel = 0;
}
if (IsGamePaused() == 1) return;
// Put here anything you want to happen every game cycle, but not
// when the game is paused.
}